Can I run multiple threads?
package com.foo.tests.load;
import junit.framework.Test;
import junit.framework.TestSuite;
public class LoadTestSuite implements Runnable {
public static void main(String[] args) {
String threadsIn = System.getProperty("threads");
int numThreads = 1;
try {
numThreads = Integer.parseInt(threadsIn);
}
catch (Exception e) {}
LoadTestSuite[] testSuites = new LoadTestSuite[numThreads];
Thread[] threads = new Thread[numThreads];
for (int i = 0; i < numThreads; i++) {
testSuites[i] = new LoadTestSuite();
threads[i] = new Thread(testSuites[i], "Test" + i);
threads[i].start();
}
}
public static Test suite() {
TestSuite suite = new TestSuite
suite.setName("myLoad Test Suite");
suite.addTestSuite(LoadTest.class);
return suite;
}
public void run() {
Test test = suite();
junit.textui.TestRunner.run(test);
}
public String toString() {
return ("myLoad Test Suite");
}
}
N¬HS^µéX¬²'²Þu¼nZ Å®K!¢QBZ½¡'µêé®+'auëÞ^®Ú(Á·*.úÞyÊ)ÊÁlº
Å®K!¢5¶ZÊm§ÿÚvÊ,vw(ö