throws Exception
{
ArrayList noWaits = new ArrayList();
ILateralCacheAttributes attr = new LateralCacheAttributes();
attr.setCacheName( "testCache1" );
LateralCacheNoWaitFacade lcnwf = new LateralCacheNoWaitFacade( (LateralCacheNoWait[]) noWaits
.toArray( new LateralCacheNoWait[0] ), attr );
TCPLateralCacheAttributes lac = new TCPLateralCacheAttributes();
lac.setTransmissionType( LateralCacheAttributes.TCP );
lac.setTcpServer( "localhost" + ":" + 1111 );
LateralCache cache = new MockLateralCache( lac );
// add one
LateralCacheNoWait noWait = new LateralCacheNoWait( cache );
lcnwf.addNoWait( noWait );
assertEquals( "Facade should have 1 no wait", 1, lcnwf.noWaits.length );
// add another
LateralCacheNoWait noWait2 = new LateralCacheNoWait( cache );
lcnwf.addNoWait( noWait2 );
assertEquals( "Facade should have 2 no waits", 2, lcnwf.noWaits.length );
// try adding the same one again
lcnwf.addNoWait( noWait2 );
assertEquals( "Facade should still have 2 no waits", 2, lcnwf.noWaits.length );
}