PolicyCachePartitionConfiguration partition =
configuration.getPolicyCachePartition();
assertNotNull(partition);
assertEquals(box(100), partition.getSize());
RemotePolicyCacheConfiguration constraints =
partition.getConstraintsConfiguration();
assertNotNull(constraints);
assertEquals(box(true), constraints.getDefaultCacheThisPolicy());
assertEquals(box(false), constraints.getDefaultRetainDuringRetry());
assertEquals(box(true), constraints.getDefaultRetryFailedRetrieval());
assertEquals(box(50), constraints.getDefaultRetryInterval());
assertEquals(box(5), constraints.getDefaultRetryMaxCount());
assertEquals(box(Integer.MAX_VALUE), constraints.getDefaultTimeToLive());
assertEquals(box(true), constraints.getAllowCacheThisPolicy());
assertEquals(box(true), constraints.getAllowRetainDuringRetry());
assertEquals(box(true), constraints.getAllowRetryFailedRetrieval());
assertEquals(box(Integer.MAX_VALUE), constraints.getMaxRetryMaxCount());
assertEquals(box(Integer.MAX_VALUE), constraints.getMaxTimeToLive());
assertEquals(box(10), constraints.getMinRetryInterval());
assertEquals(1, partition.getTypeSpecificPartitionCount());
PolicyTypePartitionConfiguration typePartition =
partition.getTypePartition(PolicyType.AUDIO);
assertNotNull(typePartition);
PolicyTypePartitionConfiguration imagePartition =
partition.getTypePartition(PolicyType.IMAGE);
assertSame(typePartition, imagePartition);
assertEquals(Arrays.asList(new PolicyType[] {
PolicyType.AUDIO, PolicyType.IMAGE
}), typePartition.getPolicyTypes());
assertEquals(50, typePartition.getSize());
constraints = typePartition.getConstraints();
assertNotNull(constraints);
assertEquals(null, constraints.getDefaultCacheThisPolicy());
assertEquals(null, constraints.getDefaultRetainDuringRetry());
assertEquals(null, constraints.getDefaultRetryFailedRetrieval());
assertEquals(null, constraints.getDefaultRetryInterval());
assertEquals(null, constraints.getDefaultRetryMaxCount());
assertEquals(null, constraints.getDefaultTimeToLive());
assertEquals(box(false), constraints.getAllowCacheThisPolicy());
assertEquals(null, constraints.getAllowRetainDuringRetry());
assertEquals(null, constraints.getAllowRetryFailedRetrieval());
assertEquals(null, constraints.getMaxRetryMaxCount());
assertEquals(null, constraints.getMaxTimeToLive());
assertEquals(null, constraints.getMinRetryInterval());
}