/** Verify that we get the default. */ public void testCreateRemoteHttpCacheClient_default() { // SETUP RemoteHttpCacheAttributes cattr = new RemoteHttpCacheAttributes(); RemoteHttpCacheFactory factory = new RemoteHttpCacheFactory(); // DO WORK IRemoteHttpCacheClient<String, String> result = factory.createRemoteHttpCacheClientForAttributes( cattr ); // VEIFY assertNotNull( "Should have a cache.", result ); assertTrue( "Wrong default.", result instanceof RemoteHttpCacheClient ); }
/** Verify that we get a cache no wait. */ public void testGetCache_normal() { // SETUP ICompositeCacheManager cacheMgr = new MockCompositeCacheManager(); ICacheEventLogger cacheEventLogger = null; IElementSerializer elementSerializer = null; RemoteHttpCacheAttributes cattr = new RemoteHttpCacheAttributes(); RemoteHttpCacheFactory factory = new RemoteHttpCacheFactory(); // DO WORK AuxiliaryCache<String, String> result = factory.createCache(cattr, cacheMgr, cacheEventLogger, elementSerializer); // VEIFY assertNotNull( "Should have a cache.", result ); } }
/** Verify that we get the default. */ public void testCreateRemoteHttpCacheClient_Bad() { // SETUP String remoteHttpClientClassName = "junk"; RemoteHttpCacheAttributes cattr = new RemoteHttpCacheAttributes(); cattr.setRemoteHttpClientClassName( remoteHttpClientClassName ); RemoteHttpCacheFactory factory = new RemoteHttpCacheFactory(); // DO WORK IRemoteHttpCacheClient<String, String> result = factory.createRemoteHttpCacheClientForAttributes( cattr ); // VEIFY assertNotNull( "Should have a cache.", result ); assertTrue( "Wrong default.", result instanceof RemoteHttpCacheClient ); assertTrue( "Should be initialized", ((RemoteHttpCacheClient<String, String>)result).isInitialized() ); }