@Test(expected = IllegalArgumentException.class) public void testRemoveNonPresentMessageTTL() { _metadataRepo.remove(new UOID()); fail("Unexpected absence of IllegalArgumentException"); }
@Test public void testContainsNonPresentMessageTTL() { assertFalse( "checking containsMetricTTL for absent message ID", _metadataRepo.containsMetricTTL(new UOID())); }
@Test public void testRemoveAvailableMessage() { _metadataRepo.remove(AVAILABLE_ID); assertFalse("Checking availablity after remove", _metadataRepo.containsMetricTTL(AVAILABLE_ID)); }
@Test public void testContainsPresentMessageTTL() { assertTrue( "checking containsMetricTTL for available message ID", _metadataRepo.containsMetricTTL(AVAILABLE_ID)); }
@Test public void testGetPresent() { long getTtl = _metadataRepo.getMetricTTL(AVAILABLE_ID); assertEquals("getMetricTTL returned value", AVAILABLE_TTL, getTtl); }
@Test(expected = IllegalArgumentException.class) public void testGetNotPreset() { UOID id = new UOID(); _metadataRepo.getMetricTTL(id); fail("Unexpected absence of IllegalArguemtnException"); }
@Test(expected = NullPointerException.class) public void testPutNull() { _metadataRepo.putMetricTTL(null, 3); fail("Unexpected absence of NullPointerException"); }
@Before public void setUp() { _metadataRepo = new MessageHandlerChain(); _metadataRepo.putMetricTTL(AVAILABLE_ID, AVAILABLE_TTL); }