You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2020/10/26 13:45:52 UTC

[activemq-artemis] branch master updated: NO-JIRA Fixing QueueControlTest in certains envs

This is an automated email from the ASF dual-hosted git repository.

clebertsuconic pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git


The following commit(s) were added to refs/heads/master by this push:
     new 0c5d030  NO-JIRA Fixing QueueControlTest in certains envs
0c5d030 is described below

commit 0c5d0303ba07a23ec32310fb5fc10dd6c0122c32
Author: Clebert Suconic <cl...@apache.org>
AuthorDate: Mon Oct 26 09:45:40 2020 -0400

    NO-JIRA Fixing QueueControlTest in certains envs
---
 .../artemis/tests/integration/management/QueueControlTest.java     | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlTest.java
index b581071..f9cf4a6 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlTest.java
@@ -26,8 +26,10 @@ import javax.transaction.xa.XAResource;
 import javax.transaction.xa.Xid;
 import java.lang.reflect.Field;
 import java.nio.ByteBuffer;
+import java.text.DateFormat;
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.LinkedList;
 import java.util.Map;
@@ -87,6 +89,7 @@ import static org.apache.activemq.artemis.core.management.impl.openmbean.Composi
 
 @RunWith(value = Parameterized.class)
 public class QueueControlTest extends ManagementTestBase {
+   private static final String NULL_DATE = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM).format(new Date(0));
 
    @Rule
    public RetryRule retryRule = new RetryRule(2);
@@ -2742,7 +2745,7 @@ public class QueueControlTest extends ManagementTestBase {
       Assert.assertEquals(1, info.getCount());
       Assert.assertEquals(1, info.getCountDelta());
       Assert.assertEquals(info.getUpdateTimestamp(), info.getLastAddTimestamp());
-      Assert.assertTrue(info.getLastAckTimestamp() + " does not contain 12/31/69", info.getLastAckTimestamp().contains("12/31/69")); // no acks received yet
+      Assert.assertEquals(NULL_DATE, info.getLastAckTimestamp()); // no acks received yet
 
       producer.send(session.createMessage(durable));
       Wait.assertTrue(() -> server.locateQueue(queue).getMessageCount() == 2);
@@ -2756,7 +2759,7 @@ public class QueueControlTest extends ManagementTestBase {
       Assert.assertEquals(2, info.getCount());
       Assert.assertEquals(1, info.getCountDelta());
       Assert.assertEquals(info.getUpdateTimestamp(), info.getLastAddTimestamp());
-      Assert.assertTrue(info.getLastAckTimestamp().contains("12/31/69")); // no acks received yet
+      Assert.assertEquals(NULL_DATE, info.getLastAckTimestamp()); // no acks received yet
 
       consumeMessages(2, session, queue);