From 417cf6738b35932b28aea984389988d87eae0477 Mon Sep 17 00:00:00 2001 From: Martin Ritchie Date: Wed, 12 Aug 2009 18:13:32 +0000 Subject: Augmented QpidTestCase to proved details of the currently active management port git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@803646 13f79535-47bb-0310-9956-ffa450edef68 --- .../main/java/org/apache/qpid/test/utils/QpidTestCase.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'qpid/java') diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java b/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java index cd8071527c..02c8ed2c10 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java @@ -361,6 +361,16 @@ public class QpidTestCase extends TestCase startBroker(0); } + /** + * Return the management portin use by the broker on this main port + * @param mainPort the broker's main port. + * @return the management port that corresponds to the broker on the given port + */ + protected int getManagementPort(int mainPort) + { + return mainPort + (DEFAULT_MANAGEMENT_PORT - DEFAULT_PORT); + } + /** * Get the Port that is use by the current broker * @@ -392,7 +402,7 @@ public class QpidTestCase extends TestCase return _broker .replace("@PORT", "" + port) .replace("@SSL_PORT", "" + (port - 1)) - .replace("@MPORT", "" + (port + (DEFAULT_MANAGEMENT_PORT - DEFAULT_PORT))) + .replace("@MPORT", "" + getManagementPort(port)) .replace("@CONFIG_FILE", _configFile.toString()); } -- cgit v1.2.1