git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GitHub] activemq-artemis pull request #2084: ARTEMIS-1859 Adding testAnonymousProduc...


Github user jdanekrh commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/2084#discussion_r187642736
  
    --- Diff: tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSMessageProducerTest.java ---
    @@ -70,10 +70,31 @@ public void testAnonymousProducer() throws Exception {
        }
     
        @Test(timeout = 30000)
    -   public void testAnonymousProducerWithAutoCreation() throws Exception {
    -      Connection connection = createConnection();
    +   public void testAnonymousProducerWithQueueAutoCreation() throws Exception {
    +      try (Connection connection = createConnection()) {
    +         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
    +         Queue queue = session.createQueue(UUID.randomUUID().toString());
    +         MessageProducer p = session.createProducer(null);
     
    -      try {
    +         TextMessage message = session.createTextMessage();
    +         message.setText("hello");
    +         // this will auto-create the address
    +         p.send(queue, message);
    --- End diff --
    
    How so? I do need at least one send when dealing with anonymous producer. That is the point of the test, to send a message on the broker, that is the point where any auto-creation happens.


---