Search in sources :

Example 6 with RetryContextSupport

use of cn.taketoday.retry.context.RetryContextSupport in project today-framework by TAKETODAY.

the class MapRetryContextCacheTests method testPut.

@Test
public void testPut() {
    RetryContextSupport context = new RetryContextSupport(null);
    cache.put("foo", context);
    assertEquals(context, cache.get("foo"));
}
Also used : RetryContextSupport(cn.taketoday.retry.context.RetryContextSupport) Test(org.junit.Test)

Example 7 with RetryContextSupport

use of cn.taketoday.retry.context.RetryContextSupport in project today-framework by TAKETODAY.

the class MapRetryContextCacheTests method testRemove.

@Test
public void testRemove() {
    assertFalse(cache.containsKey("foo"));
    RetryContextSupport context = new RetryContextSupport(null);
    cache.put("foo", context);
    assertTrue(cache.containsKey("foo"));
    cache.remove("foo");
    assertFalse(cache.containsKey("foo"));
}
Also used : RetryContextSupport(cn.taketoday.retry.context.RetryContextSupport) Test(org.junit.Test)

Example 8 with RetryContextSupport

use of cn.taketoday.retry.context.RetryContextSupport in project today-framework by TAKETODAY.

the class SoftReferenceMapRetryContextCacheTests method testPut.

@Test
public void testPut() {
    RetryContextSupport context = new RetryContextSupport(null);
    cache.put("foo", context);
    assertEquals(context, cache.get("foo"));
}
Also used : RetryContextSupport(cn.taketoday.retry.context.RetryContextSupport) Test(org.junit.Test)

Example 9 with RetryContextSupport

use of cn.taketoday.retry.context.RetryContextSupport in project today-framework by TAKETODAY.

the class SoftReferenceMapRetryContextCacheTests method testRemove.

@Test
public void testRemove() {
    assertFalse(cache.containsKey("foo"));
    RetryContextSupport context = new RetryContextSupport(null);
    cache.put("foo", context);
    assertTrue(cache.containsKey("foo"));
    cache.remove("foo");
    assertFalse(cache.containsKey("foo"));
}
Also used : RetryContextSupport(cn.taketoday.retry.context.RetryContextSupport) Test(org.junit.Test)

Example 10 with RetryContextSupport

use of cn.taketoday.retry.context.RetryContextSupport in project today-framework by TAKETODAY.

the class BinaryExceptionClassifierRetryPolicy method registerThrowable.

@Override
public void registerThrowable(RetryContext context, Throwable throwable) {
    RetryContextSupport simpleContext = ((RetryContextSupport) context);
    simpleContext.registerThrowable(throwable);
}
Also used : RetryContextSupport(cn.taketoday.retry.context.RetryContextSupport)

Aggregations

RetryContextSupport (cn.taketoday.retry.context.RetryContextSupport)22 Test (org.junit.Test)18 RetryContext (cn.taketoday.retry.RetryContext)6 RetryPolicy (cn.taketoday.retry.RetryPolicy)2