Package org.springframework.retry.context

Examples of org.springframework.retry.context.RetryContextSupport


  SoftReferenceMapRetryContextCache cache = new SoftReferenceMapRetryContextCache();
 
  @Test
  public void testPut() {
    RetryContextSupport context = new RetryContextSupport(null);
    cache.put("foo", context);
    assertEquals(context, cache.get("foo"));
  }
View Full Code Here


    assertEquals(context, cache.get("foo"));
  }

  @Test(expected=RetryCacheCapacityExceededException.class)
  public void testPutOverLimit() {
    RetryContextSupport context = new RetryContextSupport(null);
    cache.setCapacity(1);
    cache.put("foo", context);
    cache.put("foo", context);
  }
View Full Code Here

  }

  @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"));
  }
View Full Code Here

  MapRetryContextCache cache = new MapRetryContextCache();
 
  @Test
  public void testPut() {
    RetryContextSupport context = new RetryContextSupport(null);
    cache.put("foo", context);
    assertEquals(context, cache.get("foo"));
  }
View Full Code Here

    assertEquals(context, cache.get("foo"));
  }

  @Test(expected=RetryCacheCapacityExceededException.class)
  public void testPutOverLimit() {
    RetryContextSupport context = new RetryContextSupport(null);
    cache.setCapacity(1);
    cache.put("foo", context);
    cache.put("foo", context);
  }
View Full Code Here

  }

  @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"));
  }
View Full Code Here

    assertNull(status);
  }

  @Test
  public void testStatusRegistration() throws Exception {
    RetryContext status = new RetryContextSupport(null);
    RetryContext value = RetrySynchronizationManager.register(status);
    assertNull(value);
    value = RetrySynchronizationManager.register(status);
    assertEquals(status, value);
  }
View Full Code Here

    assertEquals(status, value);
  }

  @Test
  public void testClear() throws Exception {
    RetryContext status = new RetryContextSupport(null);
    RetryContext value = RetrySynchronizationManager.register(status);
    assertNull(value);
    RetrySynchronizationManager.clear();
    value = RetrySynchronizationManager.register(status);
    assertNull(value);
View Full Code Here

    assertNull(value);
  }

  @Test
  public void testParent() throws Exception {
    RetryContext parent = new RetryContextSupport(null);
    RetryContext child = new RetryContextSupport(parent);
    assertSame(parent, child.getParent());
  }
View Full Code Here

TOP

Related Classes of org.springframework.retry.context.RetryContextSupport

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.