ARTEMIS-2333 Making tests more reliable
This commit is contained in:
parent
3f08e7f359
commit
7f7194f779
|
@ -66,7 +66,7 @@ public class MQTTConnection implements RemotingConnection {
|
|||
|
||||
@Override
|
||||
public boolean isWritable(ReadyListener callback) {
|
||||
return transportConnection.isWritable(callback);
|
||||
return transportConnection.isWritable(callback) && transportConnection.isOpen();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -2612,7 +2612,16 @@ public class ActiveMQServerControlTest extends ManagementTestBase {
|
|||
JsonArray array = (JsonArray) producersAsJsonObject.get("data");
|
||||
|
||||
Assert.assertTrue("number of producers returned from query", 2 <= array.size());
|
||||
JsonObject jsonSession = array.getJsonObject(0);
|
||||
|
||||
boolean foundElement = false;
|
||||
for (int i = 0; i < array.size(); i++) {
|
||||
|
||||
JsonObject jsonSession = array.getJsonObject(i);
|
||||
if (jsonSession.getString("address").equals("activemq.management")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
foundElement = true;
|
||||
|
||||
//check all fields
|
||||
Assert.assertNotEquals("id", "", jsonSession.getString("id"));
|
||||
|
@ -2624,7 +2633,10 @@ public class ActiveMQServerControlTest extends ManagementTestBase {
|
|||
Assert.assertNotEquals("localAddress", "", jsonSession.getString("localAddress"));
|
||||
Assert.assertNotEquals("remoteAddress", "", jsonSession.getString("remoteAddress"));
|
||||
Assert.assertNotEquals("creationTime", "", jsonSession.getString("creationTime"));
|
||||
}
|
||||
|
||||
|
||||
Assert.assertTrue("Valid session not found", foundElement);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue