Skip to content

Instantly share code, notes, and snippets.

@alexanderfloh
Created March 6, 2014 09:32
Show Gist options
  • Save alexanderfloh/9386120 to your computer and use it in GitHub Desktop.
Save alexanderfloh/9386120 to your computer and use it in GitHub Desktop.
Powerlauncher!
package agentlaunching;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
import com.borland.silktest.jtf.Desktop;
public class PowerLauncher {
@Test
public void testLaunching() throws InterruptedException {
List<Thread> threads = new ArrayList<Thread>();
for (int i = 0; i < 10; i++) {
final int threadId = i;
Runnable r = new Runnable() {
@Override
public void run() {
try {
Desktop d = new Desktop();
d.exists(".", 5000);
} catch (Exception e) {
System.out.println("thead " + threadId + ": " + e.toString());
}
}
};
Thread t = new Thread(r);
threads.add(t);
t.start();
Thread.sleep(5);
}
for (Thread thread : threads) {
thread.join();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment