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