/** 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() ); }
/** Verify that we get the default. */ public void testCreateRemoteHttpCacheClient_Bad() { // SETUP ICompositeCacheManager cacheMgr = new MockCompositeCacheManager(); ICacheEventLogger cacheEventLogger = null; IElementSerializer elementSerializer = null; String remoteHttpClientClassName = "junk"; RemoteHttpCacheAttributes cattr = new RemoteHttpCacheAttributes(); cattr.setRemoteHttpClientClassName( remoteHttpClientClassName ); RemoteHttpCacheManager manager = RemoteHttpCacheManager.getInstance( cacheMgr, cacheEventLogger, elementSerializer ); // DO WORK IRemoteHttpCacheClient<String, String> result = manager.createRemoteHttpCacheClientForAttributes( cattr ); // VEIFY assertNotNull( "Should have a cache.", result ); assertTrue( "Wrong default.", result instanceof RemoteHttpCacheClient ); assertTrue( "Should be initialized", ((RemoteHttpCacheClient<String, String>)result).isInitialized() ); }