Created
February 19, 2010 03:01
-
-
Save jganoff/308364 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SimpleEventForwardTest.java: | |
... | |
@Deployment | |
public static JavaArchive createTestDeployment() | |
{ | |
JavaArchive archive = Archives.create("test.jar", JavaArchive.class); | |
archive.addPackages(false, Seam3JmsExtension.class.getPackage(), SimpleEventForwardTest.class.getPackage(), Destination.class.getPackage()); | |
archive.addManifestResource(new ByteArrayAsset("<beans/>".getBytes()), ArchivePaths.create("beans.xml")); | |
archive.addServiceProvider(Extension.class, Seam3JmsExtension.class); | |
archive.addServiceProvider(EventPropagator.class, JmsEventPropagator.class); | |
// Include JBoss Messaging topic | |
archive.addManifestResource("topic_T-service.xml"); | |
return archive; | |
} | |
@Inject Connection c; | |
@Inject Session s; | |
@Inject @Destination(jndiName = "topic/T") Topic t; | |
@Inject Seam3JmsExtension jmsExt; | |
@Inject Event<String> event; | |
@Test(timeout=5000) | |
public void forwardEvent() throws Exception | |
{ | |
String expected = "test"; | |
jmsExt.register(String.class, t); | |
MessageConsumer mc = s.createConsumer(t); | |
c.start(); | |
event.fire(expected); | |
Message m = mc.receive(); | |
assertNotNull(m); | |
assertTrue(m instanceof ObjectMessage); | |
assertEquals(expected, ((ObjectMessage) m).getObject()); | |
} | |
------------------------------------------------------------------------------- | |
Test set: org.jboss.seam.jms.test.bridge.SimpleEventForwardTest | |
------------------------------------------------------------------------------- | |
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.024 sec |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment