1 package org.apache.commons.jcs.auxiliary.remote;
2
3 import java.util.ArrayList;
4 import java.util.List;
5
6 import org.apache.commons.jcs.auxiliary.remote.behavior.IRemoteCacheAttributes;
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27 import junit.framework.TestCase;
28
29
30
31
32 public class RemoteCacheNoWaitFacadeUnitTest
33 extends TestCase
34 {
35
36
37
38 public void testAddNoWait_InList()
39 {
40
41 List<RemoteCacheNoWait<String, String>> noWaits = new ArrayList<RemoteCacheNoWait<String,String>>();
42 IRemoteCacheAttributes cattr = new RemoteCacheAttributes();
43 cattr.setCacheName( "testCache1" );
44
45 RemoteCache<String, String> client = new RemoteCache<String, String>(cattr, null, null, null);
46 RemoteCacheNoWait<String, String> noWait = new RemoteCacheNoWait<String, String>( client );
47 noWaits.add( noWait );
48
49 RemoteCacheNoWaitFacade<String, String> facade = new RemoteCacheNoWaitFacade<String, String>(noWaits, cattr, null, null, null );
50
51
52 assertEquals( "Should have one entry.", 1, facade.noWaits.size() );
53 assertTrue( "Should be in the list.", facade.noWaits.contains( noWait ) );
54 assertSame( "Should have same facade.", facade, ((RemoteCache<String, String>)facade.noWaits.get(0).getRemoteCache()).getFacade() );
55 }
56 }