It is also possible to conduct end-to-end integration tests by binding a JUnit component reference to a transport. The previous example could be modified to invoke following tests invokes the HelloWorldService over JMS (the JMS profile will need to be installed as detailed in the next sectionplugin runtime):
Code Block |
---|
|
<composite name="TestComposite" targetNamespace="urn:fabric3.org" ...>
<component name="HelloWorldTest">
<f3:junit class="...HelloWorldITest"/>
<reference name="helloWorld" target="HelloWorldComponent">
<binding.jms>
<destination jndiName="Queue"/>
</binding.jms>
</reference>
</component>
<include name="HelloWorldComposite/>
</composite>
|
@RunWith(Fabric3Runner.class)
public class HelloWorldTest {
@Reference
@JMS(@JMSConfiguration(destination="HelloQueue"))
protected HelloWorldService service;
@Test
public void testJMSInvoke() {
service.hello("hello");
}
} |