activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stanlyDoge <...@git.apache.org>
Subject [GitHub] activemq-artemis pull request #1629: ARTEMIS-1486 Core client should be noti...
Date Thu, 02 Nov 2017 13:28:21 GMT
Github user stanlyDoge commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/1629#discussion_r148531299
  
    --- Diff: tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java
---
    @@ -1978,6 +1980,36 @@ public void testConnectorServiceManagement() throws Exception {
           Assert.assertEquals("myconn2", managementControl.getConnectorServices()[0]);
        }
     
    +   @Test
    +   public void testCloseConsumer() throws Exception {
    +      SimpleString address = RandomUtil.randomSimpleString();
    +      SimpleString name = RandomUtil.randomSimpleString();
    +      boolean durable = true;
    +
    +      ActiveMQServerControl serverControl = createManagementControl();
    +
    +      checkNoResource(ObjectNameBuilder.DEFAULT.getQueueObjectName(address, name, RoutingType.ANYCAST));
    +      serverControl.createAddress(address.toString(), "ANYCAST");
    +      serverControl.createQueue(address.toString(), "ANYCAST", name.toString(), null,
durable, -1, false, false);
    +
    +      ServerLocator receiveLocator = createInVMNonHALocator();
    +      ClientSessionFactory receiveCsf = createSessionFactory(receiveLocator);
    +      ClientSession receiveClientSession = receiveCsf.createSession(true, false, false);
    +      final ClientConsumer consumer = receiveClientSession.createConsumer(name);
    +      final ClientProducer producer = receiveClientSession.createProducer(name);
    +
    +      ServerSession ss = server.getSessions().iterator().next();
    +      ServerConsumer sc = ss.getServerConsumers().iterator().next();
    +
    +      producer.send(receiveClientSession.createMessage(true));
    +      consumer.receive(1000);
    +
    +      Assert.assertFalse(consumer.isClosed());
    +      serverControl.closeConsumerWithID(((ClientSessionImpl)receiveClientSession).getName(),
Long.toString(sc.sequentialID()));
    +      Wait.waitFor(() -> consumer.isClosed(), 1000, 100);
    --- End diff --
    
    ah, thanks


---

Mime
View raw message