1 package org.apache.commons.jcs.auxiliary.remote.server;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import junit.framework.TestCase;
23 import org.apache.commons.jcs.auxiliary.remote.server.behavior.RemoteType;
24
25
26
27
28
29
30 public class RemoteCacheServerAttributesUnitTest
31 extends TestCase
32 {
33
34
35
36
37 public void testToString()
38 {
39 RemoteCacheServerAttributes attributes = new RemoteCacheServerAttributes();
40 assertNotNull( "Should have a string.", attributes.toString() );
41 }
42
43
44
45
46 public void testSetRemoteTypeName_local()
47 {
48 RemoteCacheServerAttributes attributes = new RemoteCacheServerAttributes();
49 attributes.setRemoteTypeName( "LOCAL" );
50 assertEquals( "Wrong type.", RemoteType.LOCAL, attributes.getRemoteType() );
51 assertEquals( "Wrong name", "LOCAL", attributes.getRemoteTypeName() );
52 }
53
54
55
56
57 public void testSetRemoteTypeName_cluster()
58 {
59 RemoteCacheServerAttributes attributes = new RemoteCacheServerAttributes();
60 attributes.setRemoteTypeName( "CLUSTER" );
61 assertEquals( "Wrong type.", RemoteType.CLUSTER, attributes.getRemoteType() );
62 assertEquals( "Wrong name", "CLUSTER", attributes.getRemoteTypeName() );
63 }
64 }