1 package org.apache.commons.jcs;
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
26
27
28
29 public class ConcurrentRemovalLoadTest
30 extends TestCase
31 {
32
33
34
35
36 public ConcurrentRemovalLoadTest( String testName )
37 {
38 super( testName );
39 }
40
41
42
43
44
45 public static void main( String args[] )
46 {
47 String[] testCaseName = { RemovalTestUtil.class.getName() };
48 junit.textui.TestRunner.main( testCaseName );
49 }
50
51
52
53
54
55
56 public static Test suite()
57 {
58 ActiveTestSuite suite = new ActiveTestSuite();
59
60 suite.addTest( new RemovalTestUtil( "testRemoveCache1" )
61 {
62 @Override
63 public void runTest()
64 throws Exception
65 {
66 runTestPutThenRemoveCategorical( 0, 200 );
67 }
68 } );
69
70 suite.addTest( new RemovalTestUtil( "testPutCache1" )
71 {
72 @Override
73 public void runTest()
74 throws Exception
75 {
76 runPutInRange( 300, 400 );
77 }
78 } );
79
80 suite.addTest( new RemovalTestUtil( "testPutCache2" )
81 {
82 @Override
83 public void runTest()
84 throws Exception
85 {
86 runPutInRange( 401, 600 );
87 }
88 } );
89
90
91 suite.addTest( new RemovalTestUtil( "testPutCache3" )
92 {
93 @Override
94 public void runTest()
95 throws Exception
96 {
97 runPutInRange( 401, 600 );
98 }
99 } );
100
101 suite.addTest( new RemovalTestUtil( "testRemoveCache1" )
102 {
103 @Override
104 public void runTest()
105 throws Exception
106 {
107 runTestPutThenRemoveCategorical( 601, 700 );
108 }
109 } );
110
111 suite.addTest( new RemovalTestUtil( "testRemoveCache1" )
112 {
113 @Override
114 public void runTest()
115 throws Exception
116 {
117 runTestPutThenRemoveCategorical( 701, 800 );
118 }
119 } );
120
121 suite.addTest( new RemovalTestUtil( "testRemoveCache1" )
122 {
123 @Override
124 public void runTest()
125 throws Exception
126 {
127 runTestPutThenRemoveCategorical( 901, 1000 );
128 }
129 } );
130
131 suite.addTest( new RemovalTestUtil( "testPutCache2" )
132 {
133
134 @Override
135 public void runTest()
136 throws Exception
137 {
138 runGetInRange( 0, 1000, false );
139 }
140 } );
141 return suite;
142 }
143
144
145
146
147
148
149 @Override
150 public void setUp()
151 throws Exception
152 {
153 JCS.setConfigFilename( "/TestRemoval.ccf" );
154 JCS.getInstance( "testCache1" );
155 }
156 }