summaryrefslogtreecommitdiff
path: root/java/systests/src
diff options
context:
space:
mode:
Diffstat (limited to 'java/systests/src')
-rw-r--r--java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java18
-rw-r--r--java/systests/src/main/java/org/apache/qpid/util/LogMonitor.java4
2 files changed, 9 insertions, 13 deletions
diff --git a/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java b/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java
index 7f43a3ee68..5e209e69d6 100644
--- a/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java
+++ b/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java
@@ -34,6 +34,7 @@ import org.apache.qpid.server.registry.ApplicationRegistry;
import org.apache.qpid.server.registry.ConfigurationFileApplicationRegistry;
import org.apache.qpid.server.store.DerbyMessageStore;
import org.apache.qpid.url.URLSyntaxException;
+import org.apache.qpid.util.LogMonitor;
import org.apache.log4j.Level;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -76,7 +77,8 @@ public class QpidTestCase extends TestCase
protected File _configFile = new File(System.getProperty("broker.config"));
protected static final Logger _logger = LoggerFactory.getLogger(QpidTestCase.class);
-
+ protected static final int LOGMONITOR_TIMEOUT = 5000;
+
protected long RECEIVE_TIMEOUT = 1000l;
private Map<String, String> _propertiesSetForTestOnly = new HashMap<String, String>();
@@ -1251,7 +1253,7 @@ public class QpidTestCase extends TestCase
{
if (_broker.equals(VM))
{
- ApplicationRegistry.getInstance().getConfiguration().reparseConfigFile();
+ ApplicationRegistry.getInstance().getConfiguration().reparseConfigFileSecuritySections();
}
else // FIXME: should really use the JMX interface to do this
{
@@ -1264,15 +1266,9 @@ public class QpidTestCase extends TestCase
String cmd = "/bin/kill -SIGHUP " + reader.readLine();
p = Runtime.getRuntime().exec(cmd);
- //delay to ensure the reload time has time to occur
- try
- {
- Thread.sleep(1000);
- }
- catch (InterruptedException e)
- {
- //ignore
- }
+ LogMonitor _monitor = new LogMonitor(_outputFile);
+ assertTrue("The expected server security configuration reload did not occur",
+ _monitor.waitForMessage(ServerConfiguration.SECURITY_CONFIG_RELOADED, LOGMONITOR_TIMEOUT));
}
}
diff --git a/java/systests/src/main/java/org/apache/qpid/util/LogMonitor.java b/java/systests/src/main/java/org/apache/qpid/util/LogMonitor.java
index 44ac5b4838..7d55c68b75 100644
--- a/java/systests/src/main/java/org/apache/qpid/util/LogMonitor.java
+++ b/java/systests/src/main/java/org/apache/qpid/util/LogMonitor.java
@@ -151,9 +151,9 @@ public class LogMonitor
}
- public boolean waitForMessage(String messageCountAlert, long alertLogWaitPeriod) throws FileNotFoundException, IOException
+ public boolean waitForMessage(String message, long alertLogWaitPeriod) throws FileNotFoundException, IOException
{
- return waitForMessage(messageCountAlert, alertLogWaitPeriod, true);
+ return waitForMessage(message, alertLogWaitPeriod, true);
}