summaryrefslogtreecommitdiffstats
path: root/framework/src/onos/utils/junit
diff options
context:
space:
mode:
authorAshlee Young <ashlee@wildernessvoice.com>2015-11-07 09:43:53 -0800
committerAshlee Young <ashlee@wildernessvoice.com>2015-11-07 09:43:53 -0800
commit8f92448e4f2f5d9c98036097bdabd1c40166908a (patch)
tree37a8594f7da7f3a1b6757fdd40d8a6901280e450 /framework/src/onos/utils/junit
parent571c7bfc8f51e511d3151311f0d87aa999a89624 (diff)
Updated ONOS sources to commit ID 3f28c6803193d493b636dd3c43e08a3e6b35acca
Change-Id: I08d1eb7ee31b38491b046933c502894d133b2a2d Signed-off-by: Ashlee Young <ashlee@wildernessvoice.com>
Diffstat (limited to 'framework/src/onos/utils/junit')
-rw-r--r--framework/src/onos/utils/junit/src/main/java/org/onlab/junit/TestTools.java17
-rw-r--r--framework/src/onos/utils/junit/src/main/resources/org/onosproject/openflow/controller/impl/ControllerTestKeystore.jksbin0 -> 1295 bytes
2 files changed, 17 insertions, 0 deletions
diff --git a/framework/src/onos/utils/junit/src/main/java/org/onlab/junit/TestTools.java b/framework/src/onos/utils/junit/src/main/java/org/onlab/junit/TestTools.java
index e2fcefce..40e8686c 100644
--- a/framework/src/onos/utils/junit/src/main/java/org/onlab/junit/TestTools.java
+++ b/framework/src/onos/utils/junit/src/main/java/org/onlab/junit/TestTools.java
@@ -20,6 +20,7 @@ import com.google.common.io.Files;
import java.io.File;
import java.io.IOException;
+import java.net.ServerSocket;
import java.util.List;
import java.util.Random;
@@ -207,4 +208,20 @@ public final class TestTools {
}
}
+ /*
+ * Finds an available port that a test can bind to.
+ */
+ public static int findAvailablePort(int defaultPort) {
+ try {
+ ServerSocket socket = new ServerSocket(0);
+ socket.setReuseAddress(true);
+ int port = socket.getLocalPort();
+ socket.close();
+ return port;
+ } catch (IOException ex) {
+ return defaultPort;
+ }
+ }
+
+
}
diff --git a/framework/src/onos/utils/junit/src/main/resources/org/onosproject/openflow/controller/impl/ControllerTestKeystore.jks b/framework/src/onos/utils/junit/src/main/resources/org/onosproject/openflow/controller/impl/ControllerTestKeystore.jks
new file mode 100644
index 00000000..ba750519
--- /dev/null
+++ b/framework/src/onos/utils/junit/src/main/resources/org/onosproject/openflow/controller/impl/ControllerTestKeystore.jks
Binary files differ