@Test
public void testRetryCount() throws Exception {
CompositeRetryPolicy policy = new CompositeRetryPolicy();
policy.setPolicies(new RetryPolicy[] { new MockRetryPolicySupport(), new MockRetryPolicySupport() });
RetryContext context = policy.open(null);
assertNotNull(context);
policy.registerThrowable(context, null);
assertEquals(0, context.getRetryCount());
policy.registerThrowable(context, new RuntimeException("foo"));
assertEquals(1, context.getRetryCount());
assertEquals("foo", context.getLastThrowable().getMessage());
}