Return-Path: X-Original-To: apmail-activemq-dev-archive@www.apache.org Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EEB1E180EF for ; Thu, 4 Jun 2015 03:35:06 +0000 (UTC) Received: (qmail 63261 invoked by uid 500); 4 Jun 2015 03:35:06 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 63193 invoked by uid 500); 4 Jun 2015 03:35:06 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 63182 invoked by uid 99); 4 Jun 2015 03:35:06 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Jun 2015 03:35:06 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 1C8B4DFF7B; Thu, 4 Jun 2015 03:35:06 +0000 (UTC) From: clebertsuconic To: dev@activemq.apache.org Reply-To: dev@activemq.apache.org References: In-Reply-To: Subject: [GitHub] activemq-artemis pull request: Connection Factory updates Content-Type: text/plain Message-Id: <20150604033506.1C8B4DFF7B@git1-us-west.apache.org> Date: Thu, 4 Jun 2015 03:35:06 +0000 (UTC) Github user clebertsuconic commented on a diff in the pull request: https://github.com/apache/activemq-artemis/pull/15#discussion_r31691246 --- Diff: tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/ConnectionTest.java --- @@ -65,6 +67,33 @@ public void testManyConnections() throws Exception // @Test + public void testThroughNewConnectionFactory() throws Exception + { + testThroughNewConnectionFactory(new ActiveMQConnectionFactory()); + testThroughNewConnectionFactory(new ActiveMQConnectionFactory("tcp://localhost:61616")); + testThroughNewConnectionFactory(new ActiveMQConnectionFactory("tcp://localhost:61616", "guest", "guest")); + } + + private void testThroughNewConnectionFactory(ActiveMQConnectionFactory factory) throws Exception + { + Connection conn = factory.createConnection(); + conn.close(); + + try (JMSContext ctx = factory.createContext()) + { + ctx.createProducer().send(ctx.createQueue("queue"),"Test"); + } + + try (JMSContext ctx = factory.createContext()) + { + Assert.assertNotNull(ctx.createConsumer(ctx.createQueue("queue")).receiveNoWait()); + Assert.assertNull(ctx.createConsumer(ctx.createQueue("queue")).receiveNoWait()); + } + + factory.close(); --- End diff -- good idea!! --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---