mirror of https://github.com/apache/nifi.git
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 <alopresto@apache.org>
This commit is contained in:
parent
7e97946c35
commit
b2290b24a6
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue