Author: borges
Date: 2011-11-04 06:34:47 -0400 (Fri, 04 Nov 2011)
New Revision: 11662
Modified:
trunk/hornetq-core/src/test/java/org/hornetq/tests/util/ServiceTestBase.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/util/RemoteProcessHornetQServer.java
Log:
Fix NPE in test setUp when using RemoteProcessHornetQServer
Modified: trunk/hornetq-core/src/test/java/org/hornetq/tests/util/ServiceTestBase.java
===================================================================
---
trunk/hornetq-core/src/test/java/org/hornetq/tests/util/ServiceTestBase.java 2011-11-04
10:09:55 UTC (rev 11661)
+++
trunk/hornetq-core/src/test/java/org/hornetq/tests/util/ServiceTestBase.java 2011-11-04
10:34:47 UTC (rev 11662)
@@ -306,6 +306,8 @@
protected void waitForServer(HornetQServer server) throws InterruptedException
{
+ if (server == null)
+ return;
long timetowait = System.currentTimeMillis() + 5000;
while (!server.isStarted() && System.currentTimeMillis() < timetowait)
{
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/util/RemoteProcessHornetQServer.java
===================================================================
---
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/util/RemoteProcessHornetQServer.java 2011-11-04
10:09:55 UTC (rev 11661)
+++
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/util/RemoteProcessHornetQServer.java 2011-11-04
10:34:47 UTC (rev 11662)
@@ -63,8 +63,7 @@
}
catch (Exception e)
{
- e.printStackTrace();
- return false;
+ throw new RuntimeException(e);
}
return false;
}
@@ -118,7 +117,7 @@
{
crash(true, sessions);
}
-
+
public void crash(final boolean waitFailure, ClientSession... sessions) throws
Exception
{
final CountDownLatch latch = new CountDownLatch(sessions.length);
@@ -149,7 +148,7 @@
{
// Wait to be informed of failure
boolean ok = latch.await(10000, TimeUnit.MILLISECONDS);
-
+
Assert.assertTrue(ok);
}
}