ServiceCachingPolicyBuilder { public static ServiceCachingPolicy getMultiThreadedClientPolicy() { return DEFAULT_MULTI_THREADED_CLIENTS_POLICY; }  static ServiceCachingPolicy getMultiThreadedClientPolicy(); ServiceCachingPolicyBuilder withMaxNumServiceInstances(int maxNumServiceInstances); ServiceCachingPolicyBuilder withMaxNumServiceInstancesPerEndPoint(int maxNumServiceInstancesPerEndPoint); ServiceCachingPolicyBuilder withMaxServiceInstanceIdleTime(int maxServiceInstanceIdleTime, TimeUnit unit); ServiceCachingPolicyBuilder withCacheExhaustionAction(ExhaustionAction action); ServiceCachingPolicy build(); static final ServiceCachingPolicy NO_CACHING; }
@Test public void testUseMultiThreadedClientPolicy() { ServiceCachingPolicy cachingPolicy = ServiceCachingPolicyBuilder.getMultiThreadedClientPolicy(); assertEquals(true, cachingPolicy.useMultiThreadedClientPolicy()); }
@Test (expected = UnsupportedOperationException.class) public void testUseMultiThreadedClientPolicyWithMaxNumServiceInstancesPerEndPoint() { ServiceCachingPolicy cachingPolicy = ServiceCachingPolicyBuilder.getMultiThreadedClientPolicy(); assertEquals(1, cachingPolicy.getMaxNumServiceInstancesPerEndPoint()); }
@Test (expected = UnsupportedOperationException.class) public void testUseMultiThreadedClientPolicyWithMaxServiceInstanceIdleTime() { ServiceCachingPolicy cachingPolicy = ServiceCachingPolicyBuilder.getMultiThreadedClientPolicy(); assertEquals(1, cachingPolicy.getMaxServiceInstanceIdleTime(TimeUnit.SECONDS)); }
@Test (expected = UnsupportedOperationException.class) public void testUseMultiThreadedClientPolicyWithMaxNumServiceInstances() { ServiceCachingPolicy cachingPolicy = ServiceCachingPolicyBuilder.getMultiThreadedClientPolicy(); assertEquals(1, cachingPolicy.getMaxNumServiceInstances()); }
@Test (expected = UnsupportedOperationException.class) public void testUseMultiThreadedClientPolicyWithCacheExhaustionAction() { ServiceCachingPolicy cachingPolicy = ServiceCachingPolicyBuilder.getMultiThreadedClientPolicy(); assertEquals(ServiceCachingPolicy.ExhaustionAction.GROW, cachingPolicy.getCacheExhaustionAction()); }