From b2290b24a6a0c556b52f4bd9343970c9d1a5268d Mon Sep 17 00:00:00 2001 From: Koji Kawamura Date: Tue, 14 Feb 2017 14:29:02 +0900 Subject: [PATCH] NIFI-3107: Unit test failure for DBCPServiceTest H2 and Kafka broker uses the same default port 9092. If an user is running Kafka broker on the same machine, or run the unit tests in parallel, DBCPServiceTest can fail since some of its test methods connects to port 9092. This closes #1504. Signed-off-by: Andy LoPresto --- .../src/test/java/org/apache/nifi/dbcp/DBCPServiceTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service/src/test/java/org/apache/nifi/dbcp/DBCPServiceTest.java b/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service/src/test/java/org/apache/nifi/dbcp/DBCPServiceTest.java index 6234cbebc5..a07f064171 100644 --- a/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service/src/test/java/org/apache/nifi/dbcp/DBCPServiceTest.java +++ b/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service/src/test/java/org/apache/nifi/dbcp/DBCPServiceTest.java @@ -187,7 +187,7 @@ public class DBCPServiceTest { final DBCPConnectionPool service = new DBCPConnectionPool(); runner.addControllerService("test-dropcreate", service); - runner.setProperty(service, DBCPConnectionPool.DATABASE_URL, "jdbc:h2:tcp://localhost/~/test"); + runner.setProperty(service, DBCPConnectionPool.DATABASE_URL, "jdbc:h2:tcp://localhost:" + server.getPort() + "/~/test"); runner.setProperty(service, DBCPConnectionPool.DB_DRIVERNAME, "org.h2.Driver"); runner.enableControllerService(service); @@ -238,7 +238,7 @@ public class DBCPServiceTest { final DBCPConnectionPool service = new DBCPConnectionPool(); runner.addControllerService("test-dropcreate", service); - runner.setProperty(service, DBCPConnectionPool.DATABASE_URL, "jdbc:h2:tcp://localhost/~/test"); + runner.setProperty(service, DBCPConnectionPool.DATABASE_URL, "jdbc:h2:tcp://localhost:" + server.getPort() + "/~/test"); runner.setProperty(service, DBCPConnectionPool.DB_DRIVERNAME, "org.h2.Driver"); runner.setProperty(service, DBCPConnectionPool.VALIDATION_QUERY, "SELECT 5"); runner.enableControllerService(service);