[seam-commits] Seam SVN: r12764 - in modules/jms/branches/eventbridge/impl/src/test/java/org/jboss/seam/jms/test: bridge/route and 1 other directory.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Thu May 20 19:27:41 EDT 2010


Author: jganoff
Date: 2010-05-20 19:27:41 -0400 (Thu, 20 May 2010)
New Revision: 12764

Modified:
   modules/jms/branches/eventbridge/impl/src/test/java/org/jboss/seam/jms/test/Util.java
   modules/jms/branches/eventbridge/impl/src/test/java/org/jboss/seam/jms/test/bridge/route/RouteTest.java
   modules/jms/branches/eventbridge/impl/src/test/java/org/jboss/seam/jms/test/bridge/route/RoutingConfig.java
Log:
Updated RouteTest to use DLQ.  Re-added topic deployment resource to test utility.

Modified: modules/jms/branches/eventbridge/impl/src/test/java/org/jboss/seam/jms/test/Util.java
===================================================================
--- modules/jms/branches/eventbridge/impl/src/test/java/org/jboss/seam/jms/test/Util.java	2010-05-20 13:05:35 UTC (rev 12763)
+++ modules/jms/branches/eventbridge/impl/src/test/java/org/jboss/seam/jms/test/Util.java	2010-05-20 23:27:41 UTC (rev 12764)
@@ -47,7 +47,7 @@
       archive.addPackage(Route.class.getPackage());
       archive.addManifestResource(new ByteArrayAsset("<beans/>".getBytes()), ArchivePaths.create("beans.xml"));
       archive.addServiceProvider(Extension.class, Seam3JmsExtension.class);
-//      archive.addManifestResource("topic_T-service.xml");
+      archive.addManifestResource("topic_T-service.xml");
       archive.addManifestResource("queue_Q-service.xml");
 
       archive.addPackage(c.getPackage());

Modified: modules/jms/branches/eventbridge/impl/src/test/java/org/jboss/seam/jms/test/bridge/route/RouteTest.java
===================================================================
--- modules/jms/branches/eventbridge/impl/src/test/java/org/jboss/seam/jms/test/bridge/route/RouteTest.java	2010-05-20 13:05:35 UTC (rev 12763)
+++ modules/jms/branches/eventbridge/impl/src/test/java/org/jboss/seam/jms/test/bridge/route/RouteTest.java	2010-05-20 23:27:41 UTC (rev 12764)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * 
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ * 
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
 package org.jboss.seam.jms.test.bridge.route;
 
 import javax.enterprise.event.Event;
@@ -6,7 +27,7 @@
 import javax.jms.JMSException;
 import javax.jms.Message;
 import javax.jms.ObjectMessage;
-import javax.jms.TopicSubscriber;
+import javax.jms.QueueReceiver;
 
 import org.jboss.arquillian.api.Deployment;
 import org.jboss.arquillian.junit.Arquillian;
@@ -23,28 +44,11 @@
    @Deployment
    public static JavaArchive createDeployment()
    {
-      JavaArchive a = Util.createDeployment(RouteTest.class);
-      a.addPackage(RouteTest.class.getPackage());
-      
-//      JavaArchive ejbJar = ShrinkWrap.create("test.jar", JavaArchive.class)
-//         .addManifestResource(new ByteArrayAsset(new byte[0]), "beans.xml")
-//         .addPackage(Seam3JmsExtension.class.getPackage())
-//         .addPackage(JmsSession.class.getPackage())
-//         .addPackage(ConnectionProducer.class.getPackage())
-//         .addPackage(JmsAnnotatedTypeWrapper.class.getPackage())
-//         .addPackage(Route.class.getPackage())
-//         .addPackage(RouteTest.class.getPackage());
-//      
-//      EnterpriseArchive ear = ShrinkWrap.create("test.ear", EnterpriseArchive.class)
-//      .addModule(ejbJar)
-//      .addManifestResource("topic_T-service.xml")
-//      .addManifestResource("queue_Q-service.xml");
-      
-      return a;
+      return Util.createDeployment(RouteTest.class);
    }
    
    @Inject Connection c;
-   @Inject @JmsDestination(jndiName="jms/T") TopicSubscriber ts;
+   @Inject @JmsDestination(jndiName="queue/DLQ") QueueReceiver qr;
    @Inject @Bridged Event<String> event;
    @Inject Event<String> plainEvent;
    
@@ -54,7 +58,7 @@
       String expected = "test";
       c.start();
       event.fire(expected);
-      Message m = ts.receive(3000);
+      Message m = qr.receive(3000);
       Assert.assertTrue(m != null);
       Assert.assertTrue(m instanceof ObjectMessage);
       Assert.assertEquals(expected, ((ObjectMessage) m).getObject());
@@ -66,7 +70,7 @@
       String expected = "test";
       c.start();
       plainEvent.fire(expected);
-      Message m = ts.receive(3000);
+      Message m = qr.receive(3000);
       Assert.assertNull(m);
    }
 }

Modified: modules/jms/branches/eventbridge/impl/src/test/java/org/jboss/seam/jms/test/bridge/route/RoutingConfig.java
===================================================================
--- modules/jms/branches/eventbridge/impl/src/test/java/org/jboss/seam/jms/test/bridge/route/RoutingConfig.java	2010-05-20 13:05:35 UTC (rev 12763)
+++ modules/jms/branches/eventbridge/impl/src/test/java/org/jboss/seam/jms/test/bridge/route/RoutingConfig.java	2010-05-20 23:27:41 UTC (rev 12764)
@@ -25,7 +25,7 @@
 
 import javax.enterprise.util.AnnotationLiteral;
 import javax.inject.Inject;
-import javax.jms.Topic;
+import javax.jms.Queue;
 
 import org.jboss.seam.jms.annotations.JmsDestination;
 import org.jboss.seam.jms.bridge.EventBridge;
@@ -36,7 +36,7 @@
 {
    @Inject EventBridge bridge;
 
-   @Inject @JmsDestination(jndiName = "jms/T") Topic t;
+   @Inject @JmsDestination(jndiName = "queue/DLQ") Queue q;
    
    private static final AnnotationLiteral<Bridged> BRIDGED = new AnnotationLiteral<Bridged>()
    {
@@ -46,6 +46,6 @@
    @EventRouting
    public Route getRoute()
    {
-      return bridge.createRoute(EGRESS, String.class).addQualifiers(BRIDGED).connectTo(Topic.class, t);
+      return bridge.createRoute(EGRESS, String.class).addQualifiers(BRIDGED).connectTo(Queue.class, q);
    }
 }



More information about the seam-commits mailing list