Commit 8d64dbfd authored by Patrick D. Hunt's avatar Patrick D. Hunt
Browse files

ZOOKEEPER-1969. Fix Port Already In Use for JettyAdminServerTest (Hongchao Deng via phunt)

git-svn-id: https://svn.apache.org/repos/asf/zookeeper/trunk@1611714 13f79535-47bb-0310-9956-ffa450edef68
parent cc63f25c
......@@ -702,6 +702,9 @@ BUGFIXES:
ZOOKEEPER-1683. ZooKeeper client NPE when updating server list on disconnected
client (shralex via michim)
ZOOKEEPER-1969. Fix Port Already In Use for JettyAdminServerTest
(Hongchao Deng via phunt)
IMPROVEMENTS:
ZOOKEEPER-1170. Fix compiler (eclipse) warnings: unused imports,
......
......@@ -40,11 +40,13 @@ public class JettyAdminServerTest extends ZKTestCase{
protected static final Logger LOG = LoggerFactory.getLogger(JettyAdminServerTest.class);
private static final String URL_FORMAT = "http://localhost:%d/commands";
private static final int jettyAdminPort = PortAssignment.unique();
@Before
public void enableServer() {
// Override setting in ZKTestCase
System.setProperty("zookeeper.admin.enableServer", "true");
System.setProperty("zookeeper.admin.serverPort", "" + jettyAdminPort);
}
/**
......@@ -55,7 +57,7 @@ public class JettyAdminServerTest extends ZKTestCase{
JettyAdminServer server = new JettyAdminServer();;
try {
server.start();
queryAdminServer(JettyAdminServer.DEFAULT_PORT);
queryAdminServer(jettyAdminPort);
} finally {
server.shutdown();
}
......@@ -77,7 +79,7 @@ public class JettyAdminServerTest extends ZKTestCase{
ClientBase.waitForServerUp("127.0.0.1:" + CLIENT_PORT,
ClientBase.CONNECTION_TIMEOUT));
queryAdminServer(JettyAdminServer.DEFAULT_PORT);
queryAdminServer(jettyAdminPort);
main.shutdown();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment