1 package org.apache.commons.jcs.auxiliary.disk.indexed;
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 junit.textui.TestRunner;
26 import org.apache.commons.jcs.JCS;
27 import org.apache.commons.jcs.engine.control.CompositeCacheManager;
28
29
30
31
32
33
34
35
36 public class IndexedDiskCacheConcurrentNoDeadLockUnitTest
37 extends TestCase
38 {
39
40
41
42
43
44 public IndexedDiskCacheConcurrentNoDeadLockUnitTest( String testName )
45 {
46 super( testName );
47 }
48
49
50
51
52
53
54 public static void main( String args[] )
55 {
56 String[] testCaseName = { IndexedDiskCacheConcurrentNoDeadLockUnitTest.class.getName() };
57 TestRunner.main( testCaseName );
58 }
59
60
61
62
63
64
65 public static Test suite()
66 {
67 ActiveTestSuite suite = new ActiveTestSuite();
68
69 suite.addTest( new IndexedDiskCacheRandomConcurrentTestUtil( "testIndexedDiskCache1" )
70 {
71 @Override
72 public void runTest()
73 throws Exception
74 {
75 this.runTestForRegion( "indexedRegion4", 1, 200, 1 );
76 }
77 } );
78
79 suite.addTest( new IndexedDiskCacheRandomConcurrentTestUtil( "testIndexedDiskCache2" )
80 {
81 @Override
82 public void runTest()
83 throws Exception
84 {
85 this.runTestForRegion( "indexedRegion4", 10000, 50000, 2 );
86 }
87 } );
88
89 suite.addTest( new IndexedDiskCacheRandomConcurrentTestUtil( "testIndexedDiskCache3" )
90 {
91 @Override
92 public void runTest()
93 throws Exception
94 {
95 this.runTestForRegion( "indexedRegion4", 10000, 50000, 3 );
96 }
97 } );
98
99 suite.addTest( new IndexedDiskCacheRandomConcurrentTestUtil( "testIndexedDiskCache4" )
100 {
101 @Override
102 public void runTest()
103 throws Exception
104 {
105 this.runTestForRegion( "indexedRegion4", 10000, 50000, 4 );
106 }
107 } );
108
109 suite.addTest( new IndexedDiskCacheRandomConcurrentTestUtil( "testIndexedDiskCache5" )
110 {
111 @Override
112 public void runTest()
113 throws Exception
114 {
115 this.runTestForRegion( "indexedRegion4", 10000, 50000, 5 );
116 }
117 } );
118
119 return suite;
120 }
121
122
123
124
125 @Override
126 public void setUp()
127 {
128 JCS.setConfigFilename( "/TestDiskCacheCon.ccf" );
129 }
130
131
132
133
134 @Override
135 public void tearDown()
136 {
137 try
138 {
139 CompositeCacheManager cacheMgr = CompositeCacheManager.getInstance();
140 cacheMgr.shutDown();
141 }
142 catch ( Exception e )
143 {
144
145 }
146 }
147
148 }