Repository: nifi
Updated Branches:
  refs/heads/0.x 6e7b67e84 -> 03c937623


NIFI-2097 Changing RemoteProcessGroupStatusTest.java to use a random open port 
instead of a statically defined one

This closes #569


Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/03c93762
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/03c93762
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/03c93762

Branch: refs/heads/0.x
Commit: 03c9376233e4669c32bf4b62e3f33368b1184619
Parents: 6e7b67e
Author: jpercivall <joeperciv...@yahoo.com>
Authored: Thu Jun 23 13:24:15 2016 -0400
Committer: Oleg Zhurakousky <o...@suitcase.io>
Committed: Thu Jun 23 14:25:11 2016 -0400

----------------------------------------------------------------------
 .../apache/nifi/remote/RemoteProcessGroupStatusTest.java  | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi/blob/03c93762/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/remote/RemoteProcessGroupStatusTest.java
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/remote/RemoteProcessGroupStatusTest.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/remote/RemoteProcessGroupStatusTest.java
index 56f7074..98e9eb9 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/remote/RemoteProcessGroupStatusTest.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/remote/RemoteProcessGroupStatusTest.java
@@ -19,7 +19,9 @@ package org.apache.nifi.remote;
 import static org.junit.Assert.assertEquals;
 import static org.mockito.Mockito.mock;
 
+import java.io.IOException;
 import java.lang.reflect.Method;
+import java.net.ServerSocket;
 import java.net.URL;
 import java.util.Collections;
 
@@ -58,12 +60,18 @@ public class RemoteProcessGroupStatusTest {
     }
 
     @Before
-    public void before() {
+    public void before() throws IOException {
+        int port;
+        try (ServerSocket socket = new ServerSocket(0)) {
+            socket.setReuseAddress(true);
+            port = socket.getLocalPort();
+        }
         NiFiProperties properties = NiFiProperties.getInstance();
         
properties.setProperty(NiFiProperties.PROVENANCE_REPO_IMPLEMENTATION_CLASS, 
MockProvenanceEventRepository.class.getName());
         properties.setProperty(NiFiProperties.STATE_MANAGEMENT_CONFIG_FILE, 
"src/test/resources/state-management.xml");
         
properties.setProperty(NiFiProperties.STATE_MANAGEMENT_LOCAL_PROVIDER_ID, 
"local-provider");
         properties.setProperty(NiFiProperties.REMOTE_INPUT_HOST, "localhost");
+        properties.setProperty(NiFiProperties.REMOTE_INPUT_PORT, 
String.valueOf(port));
         properties.setProperty("nifi.remote.input.secure", "false");
 
         RingBufferEventRepository repository = new 
RingBufferEventRepository(1);

Reply via email to