@@ -0,0 +1,1977 @@
+package lab.dynafig.jcache;%0A%0Aimport lab.dynafig.Default;%0Aimport lab.dynafig.Tracking;%0Aimport lab.dynafig.Updating;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Aimport javax.cache.Cache;%0Aimport javax.cache.configuration.FactoryBuilder.SingletonFactory;%0Aimport javax.cache.configuration.MutableCacheEntryListenerConfiguration;%0Aimport javax.cache.configuration.MutableConfiguration;%0Aimport javax.cache.event.CacheEntryListener;%0A%0Aimport static javax.cache.Caching.getCachingProvider;%0Aimport static org.hamcrest.Matchers.equalTo;%0Aimport static org.hamcrest.Matchers.is;%0Aimport static org.junit.Assert.assertThat;%0A%0A/**%0A * %7B@code JCacheListenerTest%7D tests %7B@link JCacheListener%7D.%0A *%0A * @author %3Ca href=%22mailto:boxley@thoughtworks.com%22%3EBrian Oxley%3C/a%3E%0A */%0Apublic class JCacheListenerTest %7B%0A    private Updating updating;%0A    private Tracking tracking;%0A    private Cache%3CString, String%3E cache;%0A%0A    @Before%0A    public void setUp() %7B%0A        final Default dynafig = new Default();%0A        updating = dynafig;%0A        tracking = dynafig;%0A%0A        final SingletonFactory%3CCacheEntryListener%3C? super String, ? super String%3E%3E%0A                listenerFactory = new SingletonFactory%3C%3E(%0A                new JCacheListener(updating));%0A        final MutableCacheEntryListenerConfiguration%3CString, String%3E%0A                listenerConfiguration%0A                = new MutableCacheEntryListenerConfiguration%3C%3E(%0A                listenerFactory, null, true, true);%0A        final MutableConfiguration%3CString, String%3E configuration%0A                = new MutableConfiguration%3CString, String%3E().%0A                setTypes(String.class, String.class).%0A                addCacheEntryListenerConfiguration(listenerConfiguration);%0A%0A        cache = getCachingProvider().getCacheManager().%0A                createCache(%22test%22, configuration);%0A    %7D%0A%0A    @Test%0A    public void should() %7B%0A        cache.put(%22bob%22, %22pretzel%22);%0A%0A        assertThat(tracking.track(%22bob%22).get().get(), is(equalTo(%22pretzel%22)));%0A    %7D%0A%7D%0A

Test for dynafig-jcache.