1 package org.apache.commons.jcs3.auxiliary.lateral.socket.tcp;
2
3 import org.apache.commons.jcs3.JCS;
4 import org.apache.commons.jcs3.engine.control.CompositeCacheManager;
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 import junit.extensions.ActiveTestSuite;
26 import junit.framework.Test;
27 import junit.framework.TestCase;
28
29
30
31
32
33 public class LateralTCPNoDeadLockConcurrentTest
34 extends TestCase
35 {
36
37
38
39
40
41 public LateralTCPNoDeadLockConcurrentTest( final String testName )
42 {
43 super( testName );
44 }
45
46
47
48
49
50
51 public static Test suite()
52 {
53
54 System.setProperty( "jcs.auxiliary.LTCP.attributes.PutOnlyMode", "false" );
55
56 final ActiveTestSuite suite = new ActiveTestSuite();
57
58 suite.addTest( new LateralTCPConcurrentRandomTestUtil( "testLateralTCPCache1" )
59 {
60 @Override
61 public void runTest()
62 throws Exception
63 {
64 this.runTestForRegion( "region1", 1, 200, 1 );
65 }
66 } );
67
68 suite.addTest( new LateralTCPConcurrentRandomTestUtil( "testLateralTCPCache2" )
69 {
70 @Override
71 public void runTest()
72 throws Exception
73 {
74 this.runTestForRegion( "region2", 10000, 12000, 2 );
75 }
76 } );
77
78 suite.addTest( new LateralTCPConcurrentRandomTestUtil( "testLateralTCPCache3" )
79 {
80 @Override
81 public void runTest()
82 throws Exception
83 {
84 this.runTestForRegion( "region3", 10000, 12000, 3 );
85 }
86 } );
87
88 suite.addTest( new LateralTCPConcurrentRandomTestUtil( "testLateralTCPCache4" )
89 {
90 @Override
91 public void runTest()
92 throws Exception
93 {
94 this.runTestForRegion( "region3", 10000, 13000, 4 );
95 }
96 } );
97
98 suite.addTest( new LateralTCPConcurrentRandomTestUtil( "testLateralTCPCache5" )
99 {
100 @Override
101 public void runTest()
102 throws Exception
103 {
104 this.runTestForRegion( "region4", 10000, 11000, 5 );
105 }
106 } );
107
108 return suite;
109 }
110
111
112
113
114 @Override
115 public void setUp()
116 {
117 JCS.setConfigFilename( "/TestTCPLateralCacheConcurrent.ccf" );
118 }
119
120
121
122
123 @Override
124 public void tearDown()
125 {
126 try
127 {
128 final CompositeCacheManager cacheMgr = CompositeCacheManager.getInstance();
129 cacheMgr.shutDown();
130 }
131 catch ( final Exception e )
132 {
133 e.printStackTrace();
134 }
135 }
136 }