1 5 package com.opensymphony.oscache.web; 6 7 import com.clarkware.junitperf.LoadTest; 8 import com.clarkware.junitperf.RandomTimer; 9 10 import junit.extensions.RepeatedTest; 11 12 import junit.framework.Test; 13 import junit.framework.TestCase; 14 import junit.framework.TestSuite; 15 16 26 public final class TestLoadCompleteWeb extends TestCase { 27 30 public TestLoadCompleteWeb(String str) { 31 super(str); 32 } 33 34 39 public static void main(String [] args) { 40 junit.swingui.TestRunner testRunner = new junit.swingui.TestRunner(); 42 testRunner.setLoading(false); 43 44 String [] args2 = {TestLoadCompleteWeb.class.getName()}; 45 testRunner.start(args2); 46 } 47 48 53 public static Test suite() { 54 final int clientThreads = 10; final int iterations = 20; 57 TestSuite suite = new TestSuite("Test all osCache web"); 58 59 RandomTimer tm = new RandomTimer(300, 100); 61 62 Test repeatedTest = new RepeatedTest(new TestOscacheJsp("testOscacheBasicForLoad"), iterations); 64 Test loadTest = new LoadTest(repeatedTest, clientThreads, tm); 65 suite.addTest(loadTest); 66 67 repeatedTest = new RepeatedTest(new TestOscacheServlet("testOscacheServletBasicForLoad"), iterations); 69 loadTest = new LoadTest(repeatedTest, clientThreads, tm); 70 suite.addTest(loadTest); 71 72 repeatedTest = new RepeatedTest(new TestOscacheFilter("testOscacheFilterBasicForLoad"), iterations); 74 loadTest = new LoadTest(repeatedTest, clientThreads, tm); 75 suite.addTest(loadTest); 76 77 return suite; 78 } 79 } 80 | Popular Tags |