Created
March 6, 2014 09:32
-
-
Save alexanderfloh/9386120 to your computer and use it in GitHub Desktop.
Powerlauncher!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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