/** * Add a no wait facade. */ public void testAddNoWaitFacade_NotInList() { // SETUP String cacheName = "testAddNoWaitFacade_NotInList"; @SuppressWarnings("unchecked") LateralCacheNoWait<String, String>[] noWaits = new LateralCacheNoWait[0]; ILateralCacheAttributes cattr = new LateralCacheAttributes(); cattr.setCacheName( cacheName ); LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<String, String>( null, noWaits, cattr ); // DO WORK listener.addNoWaitFacade( cacheName, facade ); // VERIFY assertTrue( "Should have the facade.", listener.containsNoWaitFacade( cacheName ) ); }
/** * Add a no wait facade. */ public void testAddNoWaitFacade_NotInList() { // SETUP String cacheName = "testAddNoWaitFacade_NotInList"; @SuppressWarnings("unchecked") LateralCacheNoWait<String, String>[] noWaits = new LateralCacheNoWait[0]; ILateralCacheAttributes cattr = new LateralCacheAttributes(); cattr.setCacheName( cacheName ); LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<String, String>( null, noWaits, cattr ); // DO WORK listener.addNoWaitFacade( cacheName, facade ); // VERIFY assertTrue( "Should have the facade.", listener.containsNoWaitFacade( cacheName ) ); }
/** * Verify that we can remove an item. */ public void testAddThenRemoveNoWait_NotInList() { // SETUP @SuppressWarnings("unchecked") LateralCacheNoWait<String, String>[] noWaits = new LateralCacheNoWait[0]; ILateralCacheAttributes cattr = new LateralCacheAttributes(); cattr.setCacheName( "testCache1" ); LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<String, String>( null, noWaits, cattr ); LateralCache<String, String> cache = new LateralCache<String, String>( cattr ); LateralCacheNoWait<String, String> noWait = new LateralCacheNoWait<String, String>( cache ); // DO WORK facade.removeNoWait( noWait ); // VERIFY assertFalse( "Should not be in the list.", facade.containsNoWait( noWait ) ); } }
/** * Add a no wait to a known facade. */ public void testAddNoWait_FacadeInList() { // SETUP String cacheName = "testAddNoWaitFacade_FacadeInList"; @SuppressWarnings("unchecked") LateralCacheNoWait<String, String>[] noWaits = new LateralCacheNoWait[0]; ILateralCacheAttributes cattr = new LateralCacheAttributes(); cattr.setCacheName( cacheName ); LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<String, String>( null, noWaits, cattr ); listener.addNoWaitFacade( cacheName, facade ); LateralCache<String, String> cache = new LateralCache<String, String>( cattr ); LateralCacheNoWait<String, String> noWait = new LateralCacheNoWait<String, String>( cache ); // DO WORK boolean result = listener.addNoWait( noWait ); // VERIFY assertTrue( "Should have added the no wait.", result ); }
/** * Remove a no wait from a known facade. */ public void testRemoveNoWait_FacadeInList_NoWaitNot() { // SETUP String cacheName = "testAddNoWaitFacade_FacadeInList"; @SuppressWarnings("unchecked") LateralCacheNoWait<String, String>[] noWaits = new LateralCacheNoWait[0]; ILateralCacheAttributes cattr = new LateralCacheAttributes(); cattr.setCacheName( cacheName ); LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<String, String>( null, noWaits, cattr ); listener.addNoWaitFacade( cacheName, facade ); LateralCache<String, String> cache = new LateralCache<String, String>( cattr ); LateralCacheNoWait<String, String> noWait = new LateralCacheNoWait<String, String>( cache ); // DO WORK boolean result = listener.removeNoWait( noWait ); // VERIFY assertFalse( "Should not have removed the no wait.", result ); }
/** * Add a no wait to a known facade. */ public void testAddNoWait_FacadeInList() { // SETUP String cacheName = "testAddNoWaitFacade_FacadeInList"; @SuppressWarnings("unchecked") LateralCacheNoWait<String, String>[] noWaits = new LateralCacheNoWait[0]; ILateralCacheAttributes cattr = new LateralCacheAttributes(); cattr.setCacheName( cacheName ); LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<String, String>( null, noWaits, cattr ); listener.addNoWaitFacade( cacheName, facade ); LateralCache<String, String> cache = new LateralCache<String, String>( cattr ); LateralCacheNoWait<String, String> noWait = new LateralCacheNoWait<String, String>( cache ); // DO WORK boolean result = listener.addNoWait( noWait ); // VERIFY assertTrue( "Should have added the no wait.", result ); }
/** * Verify that we can remove an item. */ public void testAddThenRemoveNoWait_NotInList() { // SETUP @SuppressWarnings("unchecked") LateralCacheNoWait<String, String>[] noWaits = new LateralCacheNoWait[0]; ILateralCacheAttributes cattr = new LateralCacheAttributes(); cattr.setCacheName( "testCache1" ); LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<String, String>( null, noWaits, cattr ); LateralCache<String, String> cache = new LateralCache<String, String>( cattr ); LateralCacheNoWait<String, String> noWait = new LateralCacheNoWait<String, String>( cache ); // DO WORK facade.removeNoWait( noWait ); // VERIFY assertFalse( "Should not be in the list.", facade.containsNoWait( noWait ) ); } }
/** * Remove a no wait from a known facade. */ public void testRemoveNoWait_FacadeInList_NoWaitIs() { // SETUP String cacheName = "testRemoveNoWaitFacade_FacadeInListNoWaitIs"; @SuppressWarnings("unchecked") LateralCacheNoWait<String, String>[] noWaits = new LateralCacheNoWait[0]; ILateralCacheAttributes cattr = new LateralCacheAttributes(); cattr.setCacheName( cacheName ); LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<String, String>( null, noWaits, cattr ); listener.addNoWaitFacade( cacheName, facade ); LateralCache<String, String> cache = new LateralCache<String, String>( cattr ); LateralCacheNoWait<String, String> noWait = new LateralCacheNoWait<String, String>( cache ); listener.addNoWait( noWait ); // DO WORK boolean result = listener.removeNoWait( noWait ); // VERIFY assertTrue( "Should have removed the no wait.", result ); }
/** * Remove a no wait from a known facade. */ public void testRemoveNoWait_FacadeInList_NoWaitNot() { // SETUP String cacheName = "testAddNoWaitFacade_FacadeInList"; @SuppressWarnings("unchecked") LateralCacheNoWait<String, String>[] noWaits = new LateralCacheNoWait[0]; ILateralCacheAttributes cattr = new LateralCacheAttributes(); cattr.setCacheName( cacheName ); LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<String, String>( null, noWaits, cattr ); listener.addNoWaitFacade( cacheName, facade ); LateralCache<String, String> cache = new LateralCache<String, String>( cattr ); LateralCacheNoWait<String, String> noWait = new LateralCacheNoWait<String, String>( cache ); // DO WORK boolean result = listener.removeNoWait( noWait ); // VERIFY assertFalse( "Should not have removed the no wait.", result ); }
/** * Remove a no wait from a known facade. */ public void testRemoveNoWait_FacadeInList_NoWaitIs() { // SETUP String cacheName = "testRemoveNoWaitFacade_FacadeInListNoWaitIs"; @SuppressWarnings("unchecked") LateralCacheNoWait<String, String>[] noWaits = new LateralCacheNoWait[0]; ILateralCacheAttributes cattr = new LateralCacheAttributes(); cattr.setCacheName( cacheName ); LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<String, String>( null, noWaits, cattr ); listener.addNoWaitFacade( cacheName, facade ); LateralCache<String, String> cache = new LateralCache<String, String>( cattr ); LateralCacheNoWait<String, String> noWait = new LateralCacheNoWait<String, String>( cache ); listener.addNoWait( noWait ); // DO WORK boolean result = listener.removeNoWait( noWait ); // VERIFY assertTrue( "Should have removed the no wait.", result ); }
/** * Verify that we can remove an item. */ public void testAdd_InList() { // SETUP @SuppressWarnings("unchecked") LateralCacheNoWait<String, String>[] noWaits = new LateralCacheNoWait[0]; ILateralCacheAttributes cattr = new LateralCacheAttributes(); cattr.setCacheName( "testCache1" ); LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<String, String>( null, noWaits, cattr ); LateralCache<String, String> cache = new LateralCache<String, String>( cattr ); LateralCacheNoWait<String, String> noWait = new LateralCacheNoWait<String, String>( cache ); // DO WORK facade.addNoWait( noWait ); facade.addNoWait( noWait ); // VERIFY assertTrue( "Should be in the list.", facade.containsNoWait( noWait ) ); assertEquals( "Should only have 1", 1, facade.noWaits.length ); }
/** * Verify that we can remove an item. */ public void testAdd_InList() { // SETUP @SuppressWarnings("unchecked") LateralCacheNoWait<String, String>[] noWaits = new LateralCacheNoWait[0]; ILateralCacheAttributes cattr = new LateralCacheAttributes(); cattr.setCacheName( "testCache1" ); LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<String, String>( null, noWaits, cattr ); LateralCache<String, String> cache = new LateralCache<String, String>( cattr ); LateralCacheNoWait<String, String> noWait = new LateralCacheNoWait<String, String>( cache ); // DO WORK facade.addNoWait( noWait ); facade.addNoWait( noWait ); // VERIFY assertTrue( "Should be in the list.", facade.containsNoWait( noWait ) ); assertEquals( "Should only have 1", 1, facade.noWaits.length ); }
/** * Verify that we can remove an item. */ public void testAddThenRemoveNoWait_InList() { // SETUP @SuppressWarnings("unchecked") LateralCacheNoWait<String, String>[] noWaits = new LateralCacheNoWait[0]; ILateralCacheAttributes cattr = new LateralCacheAttributes(); cattr.setCacheName( "testCache1" ); LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<String, String>( null, noWaits, cattr ); LateralCache<String, String> cache = new LateralCache<String, String>( cattr ); LateralCacheNoWait<String, String> noWait = new LateralCacheNoWait<String, String>( cache ); // DO WORK facade.addNoWait( noWait ); // VERIFY assertTrue( "Should be in the list.", facade.containsNoWait( noWait ) ); // DO WORK facade.removeNoWait( noWait ); // VERIFY assertEquals( "Should have 0", 0, facade.noWaits.length ); assertFalse( "Should not be in the list. ", facade.containsNoWait( noWait ) ); }
/** * Verify that we can remove an item. */ public void testAddThenRemoveNoWait_InList() { // SETUP @SuppressWarnings("unchecked") LateralCacheNoWait<String, String>[] noWaits = new LateralCacheNoWait[0]; ILateralCacheAttributes cattr = new LateralCacheAttributes(); cattr.setCacheName( "testCache1" ); LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<String, String>( null, noWaits, cattr ); LateralCache<String, String> cache = new LateralCache<String, String>( cattr ); LateralCacheNoWait<String, String> noWait = new LateralCacheNoWait<String, String>( cache ); // DO WORK facade.addNoWait( noWait ); // VERIFY assertTrue( "Should be in the list.", facade.containsNoWait( noWait ) ); // DO WORK facade.removeNoWait( noWait ); // VERIFY assertEquals( "Should have 0", 0, facade.noWaits.length ); assertFalse( "Should not be in the list. ", facade.containsNoWait( noWait ) ); }
ILateralCacheAttributes cattr = new LateralCacheAttributes(); cattr.setCacheName( cacheName ); LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<String, String>( null, noWaits, cattr ); listener.addNoWaitFacade( cacheName, facade );
ILateralCacheAttributes cattr = new LateralCacheAttributes(); cattr.setCacheName( cacheName ); LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<String, String>( null, noWaits, cattr ); listener.addNoWaitFacade( cacheName, facade );
ILateralCacheAttributes cattr = new LateralCacheAttributes(); cattr.setCacheName( cacheName ); LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<String, String>( null, noWaits, cattr ); listener.addNoWaitFacade( cacheName, facade ); listener.addDiscoveredService( service );
ILateralCacheAttributes cattr = new LateralCacheAttributes(); cattr.setCacheName( cacheName ); LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<String, String>( null, noWaits, cattr ); listener.addNoWaitFacade( cacheName, facade ); listener.addDiscoveredService( service );
/** * Verify that we can remove an item. */ public void testAddThenRemoveNoWait_InListSize2() { // SETUP @SuppressWarnings("unchecked") LateralCacheNoWait<String, String>[] noWaits = new LateralCacheNoWait[0]; ILateralCacheAttributes cattr = new LateralCacheAttributes(); cattr.setCacheName( "testCache1" ); LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<String, String>( null, noWaits, cattr ); LateralCache<String, String> cache = new LateralCache<String, String>( cattr ); LateralCacheNoWait<String, String> noWait = new LateralCacheNoWait<String, String>( cache ); LateralCacheNoWait<String, String> noWait2 = new LateralCacheNoWait<String, String>( cache ); // DO WORK facade.addNoWait( noWait ); facade.addNoWait( noWait2 ); // VERIFY assertEquals( "Should have 2", 2, facade.noWaits.length ); assertTrue( "Should be in the list.", facade.containsNoWait( noWait ) ); assertTrue( "Should be in the list.", facade.containsNoWait( noWait2 ) ); // DO WORK facade.removeNoWait( noWait ); // VERIFY assertEquals( "Should only have 1", 1, facade.noWaits.length ); assertFalse( "Should not be in the list. ", facade.containsNoWait( noWait ) ); assertTrue( "Should be in the list.", facade.containsNoWait( noWait2 ) ); }
/** * Verify that we can remove an item. */ public void testAddThenRemoveNoWait_InListSize2() { // SETUP @SuppressWarnings("unchecked") LateralCacheNoWait<String, String>[] noWaits = new LateralCacheNoWait[0]; ILateralCacheAttributes cattr = new LateralCacheAttributes(); cattr.setCacheName( "testCache1" ); LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<String, String>( null, noWaits, cattr ); LateralCache<String, String> cache = new LateralCache<String, String>( cattr ); LateralCacheNoWait<String, String> noWait = new LateralCacheNoWait<String, String>( cache ); LateralCacheNoWait<String, String> noWait2 = new LateralCacheNoWait<String, String>( cache ); // DO WORK facade.addNoWait( noWait ); facade.addNoWait( noWait2 ); // VERIFY assertEquals( "Should have 2", 2, facade.noWaits.length ); assertTrue( "Should be in the list.", facade.containsNoWait( noWait ) ); assertTrue( "Should be in the list.", facade.containsNoWait( noWait2 ) ); // DO WORK facade.removeNoWait( noWait ); // VERIFY assertEquals( "Should only have 1", 1, facade.noWaits.length ); assertFalse( "Should not be in the list. ", facade.containsNoWait( noWait ) ); assertTrue( "Should be in the list.", facade.containsNoWait( noWait2 ) ); }