Fixed RemoteTest to use unique port numbers.
Added time trace to RemoteTestNG.
diff --git a/src/main/java/org/testng/remote/RemoteTestNG.java b/src/main/java/org/testng/remote/RemoteTestNG.java
index 5ad38b1..0e29399 100644
--- a/src/main/java/org/testng/remote/RemoteTestNG.java
+++ b/src/main/java/org/testng/remote/RemoteTestNG.java
@@ -154,6 +154,8 @@
}
public static void main(String[] args) throws ParameterException {
+ System.out.println("RemoteTestNG starting");
+ long start = System.currentTimeMillis();
CommandLineArgs cla = new CommandLineArgs();
RemoteArgs ra = new RemoteArgs();
new JCommander(Arrays.asList(cla, ra), args);
@@ -171,6 +173,8 @@
else {
initAndRun(args, cla, ra);
}
+ long end = System.currentTimeMillis();
+ System.out.println("RemoteTesTNG ending:" + ((end - start) / 1000) + " seconds");
}
private static void initAndRun(String[] args, CommandLineArgs cla, RemoteArgs ra) {
diff --git a/src/test/java/test/remote/RemoteTest.java b/src/test/java/test/remote/RemoteTest.java
index 60bbdde..a36559a 100644
--- a/src/test/java/test/remote/RemoteTest.java
+++ b/src/test/java/test/remote/RemoteTest.java
@@ -22,6 +22,10 @@
* @author Cedric Beust <cedric@beust.com>
*/
public class RemoteTest extends SimpleBaseTest {
+ // Note: don't use the ports used by the plug-in or the RemoteTestNG processes
+ // launched in this test will interfere with the plug-in.
+ private static final int PORT1 = 1243;
+ private static final int PORT2 = 1242;
private static final List<String> EXPECTED_MESSAGES = new ArrayList<String>() {{
add("GenericMessage"); // method and test counts
add("SuiteMessage"); // suite started
@@ -36,12 +40,12 @@
@Test
public void testSerialized() {
- runTest("-serport", 12345, new SerializedMessageSender("localhost", 12345));
+ runTest("-serport", PORT1, new SerializedMessageSender("localhost", PORT1));
}
@Test
public void testString() {
- runTest("-port", 12346, new StringMessageSender("localhost", 12346));
+ runTest("-port", PORT2, new StringMessageSender("localhost", PORT2));
}
private void launchRemoteTestNG(final String portArg, final int portValue) {