@@ -0,0 +1,2369 @@
+package info.noconfuse.modules.cache.support;%0A%0Aimport info.noconfuse.modules.cache.MemcachedCache;%0Aimport net.rubyeye.xmemcached.MemcachedClient;%0Aimport net.rubyeye.xmemcached.MemcachedClientBuilder;%0Aimport org.junit.Assert;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.cache.Cache;%0Aimport org.springframework.test.context.ContextConfiguration;%0Aimport org.springframework.test.context.junit4.SpringJUnit4ClassRunner;%0A%0Aimport java.io.IOException;%0Aimport java.util.Collections;%0Aimport java.util.Set;%0A%0A@RunWith(SpringJUnit4ClassRunner.class)%0A@ContextConfiguration(locations = %7B%22classpath:context-cache.xml%22%7D)%0Apublic class MemcachedCacheManagerTest %7B%0A%0A    @Autowired%0A    private MemcachedClientBuilder clientBuilder;%0A%0A    private MemcachedClient memcachedClient;%0A%0A    @Before%0A    public void setUp() throws IOException %7B%0A        memcachedClient = clientBuilder.build();%0A    %7D%0A%0A    @Test(expected = IllegalArgumentException.class)%0A    public void testLoadCachesWithoutCacheNames() %7B%0A        MemcachedCacheManager manager = new MemcachedCacheManager();%0A        manager.setMemcachedClient(memcachedClient);%0A        manager.loadCaches();%0A    %7D%0A%0A    @Test(expected = IllegalArgumentException.class)%0A    public void testLoadCachesWithEmptyCacheNames() %7B%0A        MemcachedCacheManager manager = new MemcachedCacheManager();%0A        manager.setCacheNames(Collections.EMPTY_SET);%0A        manager.setMemcachedClient(memcachedClient);%0A        manager.loadCaches();%0A    %7D%0A%0A    @Test(expected = IllegalArgumentException.class)%0A    public void testLoadCachesWithoutClient() %7B%0A        MemcachedCacheManager manager = new MemcachedCacheManager();%0A        manager.setCacheNames(Collections.singleton(%22hello%22));%0A        manager.loadCaches();%0A    %7D%0A%0A    @Test%0A    public void testLoadCaches() %7B%0A        MemcachedCacheManager manager = new MemcachedCacheManager();%0A        manager.setCacheNames(Collections.singleton(%22hello%22));%0A        manager.setMemcachedClient(memcachedClient);%0A        Set%3CCache%3E caches = (Set%3CCache%3E) manager.loadCaches();%0A        Assert.assertTrue(caches.size() == 1);%0A        Cache cache = caches.iterator().next();%0A        Assert.assertTrue(cache instanceof MemcachedCache);%0A        Assert.assertTrue(cache.getName().equals(%22hello%22));%0A    %7D%0A%7D%0A

Create unit test for MemcachedCacheManager