You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by GitBox <gi...@apache.org> on 2020/03/25 15:30:07 UTC

[GitHub] [activemq-artemis] jbertram opened a new pull request #3049: ARTEMIS-2681 timestamp not set on notif msgs

jbertram opened a new pull request #3049: ARTEMIS-2681 timestamp not set on notif msgs
URL: https://github.com/apache/activemq-artemis/pull/3049
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [activemq-artemis] clebertsuconic commented on a change in pull request #3049: ARTEMIS-2681 timestamp not set on notif msgs

Posted by GitBox <gi...@apache.org>.
clebertsuconic commented on a change in pull request #3049: ARTEMIS-2681 timestamp not set on notif msgs
URL: https://github.com/apache/activemq-artemis/pull/3049#discussion_r398156316
 
 

 ##########
 File path: tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityNotificationTest.java
 ##########
 @@ -155,6 +163,8 @@ public void testCONSUMER_CREATED() throws Exception {
       Assert.assertEquals("guest", notifications[0].getObjectProperty(ManagementHelper.HDR_VALIDATED_USER).toString());
       Assert.assertEquals(address.toString(), notifications[0].getObjectProperty(ManagementHelper.HDR_ADDRESS).toString());
       Assert.assertEquals(SimpleString.toSimpleString("unavailable"), notifications[0].getSimpleStringProperty(ManagementHelper.HDR_CERT_SUBJECT_DN));
+      Assert.assertTrue(notifications[0].getTimestamp() >= start);
+      Assert.assertTrue((Long) notifications[0].getObjectProperty(ManagementHelper.HDR_NOTIFICATION_TIMESTAMP) >= start);
 
 Review comment:
   shouldn't we assert for == .getTimestamp()? given the way it's implemented?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [activemq-artemis] asfgit closed pull request #3049: ARTEMIS-2681 timestamp not set on notif msgs

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #3049: ARTEMIS-2681 timestamp not set on notif msgs
URL: https://github.com/apache/activemq-artemis/pull/3049
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [activemq-artemis] jbertram commented on a change in pull request #3049: ARTEMIS-2681 timestamp not set on notif msgs

Posted by GitBox <gi...@apache.org>.
jbertram commented on a change in pull request #3049: ARTEMIS-2681 timestamp not set on notif msgs
URL: https://github.com/apache/activemq-artemis/pull/3049#discussion_r398880178
 
 

 ##########
 File path: tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/NotificationTest.java
 ##########
 @@ -79,13 +79,17 @@ public void testBINDING_ADDED() throws Exception {
 
       NotificationTest.flush(notifConsumer);
 
+      long start = System.currentTimeMillis();
       session.createQueue(address, queue, durable);
 
       //the first message received will be for the address creation
       ClientMessage[] notifications = NotificationTest.consumeMessages(2, notifConsumer);
       Assert.assertEquals(BINDING_ADDED.toString(), notifications[1].getObjectProperty(ManagementHelper.HDR_NOTIFICATION_TYPE).toString());
       Assert.assertEquals(queue.toString(), notifications[1].getObjectProperty(ManagementHelper.HDR_ROUTING_NAME).toString());
       Assert.assertEquals(address.toString(), notifications[1].getObjectProperty(ManagementHelper.HDR_ADDRESS).toString());
+      Assert.assertTrue(notifications[1].getTimestamp() > start);
+      Assert.assertTrue((long) notifications[1].getObjectProperty(ManagementHelper.HDR_NOTIFICATION_TIMESTAMP) >= start);
 
 Review comment:
   It just means that the notification was sent *after* the binding was added. It's a simple validation of the timestamp.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [activemq-artemis] jbertram commented on a change in pull request #3049: ARTEMIS-2681 timestamp not set on notif msgs

Posted by GitBox <gi...@apache.org>.
jbertram commented on a change in pull request #3049: ARTEMIS-2681 timestamp not set on notif msgs
URL: https://github.com/apache/activemq-artemis/pull/3049#discussion_r398260105
 
 

 ##########
 File path: tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityNotificationTest.java
 ##########
 @@ -155,6 +163,8 @@ public void testCONSUMER_CREATED() throws Exception {
       Assert.assertEquals("guest", notifications[0].getObjectProperty(ManagementHelper.HDR_VALIDATED_USER).toString());
       Assert.assertEquals(address.toString(), notifications[0].getObjectProperty(ManagementHelper.HDR_ADDRESS).toString());
       Assert.assertEquals(SimpleString.toSimpleString("unavailable"), notifications[0].getSimpleStringProperty(ManagementHelper.HDR_CERT_SUBJECT_DN));
+      Assert.assertTrue(notifications[0].getTimestamp() >= start);
+      Assert.assertTrue((Long) notifications[0].getObjectProperty(ManagementHelper.HDR_NOTIFICATION_TIMESTAMP) >= start);
 
 Review comment:
   Fair enough. I updated the tests to assert both timestamps are equal.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [activemq-artemis] michaelpearce-gain commented on a change in pull request #3049: ARTEMIS-2681 timestamp not set on notif msgs

Posted by GitBox <gi...@apache.org>.
michaelpearce-gain commented on a change in pull request #3049: ARTEMIS-2681 timestamp not set on notif msgs
URL: https://github.com/apache/activemq-artemis/pull/3049#discussion_r398212978
 
 

 ##########
 File path: tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityNotificationTest.java
 ##########
 @@ -155,6 +163,8 @@ public void testCONSUMER_CREATED() throws Exception {
       Assert.assertEquals("guest", notifications[0].getObjectProperty(ManagementHelper.HDR_VALIDATED_USER).toString());
       Assert.assertEquals(address.toString(), notifications[0].getObjectProperty(ManagementHelper.HDR_ADDRESS).toString());
       Assert.assertEquals(SimpleString.toSimpleString("unavailable"), notifications[0].getSimpleStringProperty(ManagementHelper.HDR_CERT_SUBJECT_DN));
+      Assert.assertTrue(notifications[0].getTimestamp() >= start);
+      Assert.assertTrue((Long) notifications[0].getObjectProperty(ManagementHelper.HDR_NOTIFICATION_TIMESTAMP) >= start);
 
 Review comment:
   i think the point here, is shouldnt the test be check timestamp >= start, and check timestamp aloing with hdr notif timestamp field are the same.
   
   current logic in test doesnt check both are the same.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [activemq-artemis] franz1981 commented on a change in pull request #3049: ARTEMIS-2681 timestamp not set on notif msgs

Posted by GitBox <gi...@apache.org>.
franz1981 commented on a change in pull request #3049: ARTEMIS-2681 timestamp not set on notif msgs
URL: https://github.com/apache/activemq-artemis/pull/3049#discussion_r398367732
 
 

 ##########
 File path: tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/NotificationTest.java
 ##########
 @@ -79,13 +79,17 @@ public void testBINDING_ADDED() throws Exception {
 
       NotificationTest.flush(notifConsumer);
 
+      long start = System.currentTimeMillis();
       session.createQueue(address, queue, durable);
 
       //the first message received will be for the address creation
       ClientMessage[] notifications = NotificationTest.consumeMessages(2, notifConsumer);
       Assert.assertEquals(BINDING_ADDED.toString(), notifications[1].getObjectProperty(ManagementHelper.HDR_NOTIFICATION_TYPE).toString());
       Assert.assertEquals(queue.toString(), notifications[1].getObjectProperty(ManagementHelper.HDR_ROUTING_NAME).toString());
       Assert.assertEquals(address.toString(), notifications[1].getObjectProperty(ManagementHelper.HDR_ADDRESS).toString());
+      Assert.assertTrue(notifications[1].getTimestamp() > start);
+      Assert.assertTrue((long) notifications[1].getObjectProperty(ManagementHelper.HDR_NOTIFICATION_TIMESTAMP) >= start);
 
 Review comment:
   I would use Assert.assertThat and Matchers.greaterXXX so when it fails we have a more communicative error (that is just a lil' thing but I have introduced the core matchers of hamcrest for this reason some time ago)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [activemq-artemis] jbertram commented on a change in pull request #3049: ARTEMIS-2681 timestamp not set on notif msgs

Posted by GitBox <gi...@apache.org>.
jbertram commented on a change in pull request #3049: ARTEMIS-2681 timestamp not set on notif msgs
URL: https://github.com/apache/activemq-artemis/pull/3049#discussion_r398203947
 
 

 ##########
 File path: tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityNotificationTest.java
 ##########
 @@ -155,6 +163,8 @@ public void testCONSUMER_CREATED() throws Exception {
       Assert.assertEquals("guest", notifications[0].getObjectProperty(ManagementHelper.HDR_VALIDATED_USER).toString());
       Assert.assertEquals(address.toString(), notifications[0].getObjectProperty(ManagementHelper.HDR_ADDRESS).toString());
       Assert.assertEquals(SimpleString.toSimpleString("unavailable"), notifications[0].getSimpleStringProperty(ManagementHelper.HDR_CERT_SUBJECT_DN));
+      Assert.assertTrue(notifications[0].getTimestamp() >= start);
+      Assert.assertTrue((Long) notifications[0].getObjectProperty(ManagementHelper.HDR_NOTIFICATION_TIMESTAMP) >= start);
 
 Review comment:
   Are you saying we should assert `getTimestamp() == start` or something else? Both timestamps should be the same and both should be *after* `start`. I'm just asserting the latter.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [activemq-artemis] clebertsuconic commented on a change in pull request #3049: ARTEMIS-2681 timestamp not set on notif msgs

Posted by GitBox <gi...@apache.org>.
clebertsuconic commented on a change in pull request #3049: ARTEMIS-2681 timestamp not set on notif msgs
URL: https://github.com/apache/activemq-artemis/pull/3049#discussion_r398878831
 
 

 ##########
 File path: tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/NotificationTest.java
 ##########
 @@ -79,13 +79,17 @@ public void testBINDING_ADDED() throws Exception {
 
       NotificationTest.flush(notifConsumer);
 
+      long start = System.currentTimeMillis();
       session.createQueue(address, queue, durable);
 
       //the first message received will be for the address creation
       ClientMessage[] notifications = NotificationTest.consumeMessages(2, notifConsumer);
       Assert.assertEquals(BINDING_ADDED.toString(), notifications[1].getObjectProperty(ManagementHelper.HDR_NOTIFICATION_TYPE).toString());
       Assert.assertEquals(queue.toString(), notifications[1].getObjectProperty(ManagementHelper.HDR_ROUTING_NAME).toString());
       Assert.assertEquals(address.toString(), notifications[1].getObjectProperty(ManagementHelper.HDR_ADDRESS).toString());
+      Assert.assertTrue(notifications[1].getTimestamp() > start);
+      Assert.assertTrue((long) notifications[1].getObjectProperty(ManagementHelper.HDR_NOTIFICATION_TIMESTAMP) >= start);
 
 Review comment:
   I'm trying to understand what this means?? :) can you clarify?
   
   What for anyways? it's just an assertion? I guess I'm not understanding you.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services