|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
org.osesb.utilities.junit.OSESBTestCase
org.osesb.transporthandlers.test.deployabletestpackage1.TransportHandlerAsynchronousUnitTest
public class TransportHandlerAsynchronousUnitTest
This class contains unit tests for asynchronous interactions with the transport handlers that are deployed with the MessagePipeline(s) in deployabletestpackage1/transporthandler-config.
The purpose of this test package is to test asynchronous interaction. For SOAP transport, this means testing the ws-addressing capabilities of the SOAPXMLMessageTransportHandler. The JAXRPCDynamicClient(s) used for the test are configured with JAXRPCWSAddressingConfiguration(s) that specify<wsa:ReplyTo> and <wsa:FaultTo>
entries. The JAXRPCDynamicClient(s) invoke
SOAPXMLMessageTransportHandler#receiveAsynchronousMessage(). The
configured org.osesb.connectors.jaxrpc.addressing.JAXRPCServerAddressingHandler
processes the ws-addressing entries in the SOAPHeader of the incoming
message, which causes replies and faults to be sent to the specified
EndpointReferences.
For the test, the <wsa:ReplyTo> and <wsa:FaultTo>
EndpointReferences specify a JMS-backed web service, which puts the
incoming message content to the configured queue or topic. The JMS-backed
web service is in the org.osesb.test.soapjmsreceiverservice
package of the test-webservices module. The service sets the correlation
ID of the JMS message put to the JMS destination to the <wsa:RelatesTo>
SOAPHeader entry of the incoming SOAPMessage.
For JMS transport the test situation is conceptually the same, except that
a JMS client is used to send messages to a JMSXMLMessageTransportHandler
and instead of using ws-addressing facilities the <replyToQueue>
or <replyToTopic> elements of the JMSClientConfiguration are used
to specify the JMS Destination for the replies.
The transport handlers under test are configured to send asynchronous
replies that utlimately are put to the same JMS Topic, which is one
of the framework's base test destinations, 'topic1'. So, JMS messages
sent to the JMS transport handler, JMSXMLMessageTransportHandlerMDB,
will have their JMS ReplyTo Destination set to 'topic1'. Messages
sent to the SOAP transport handler, SOAPXMLMessageTransportHandlerBean,
will have a ws-addressing configuration with <ReplyTo> and
<FaultTo> EndpointReferences that point to the 'SOAPJMSReceiverService',
which is deployed from the org.osesb.test.soapjmsreceiverservice
package of the test-webservices module. For the test, the
'SOAPJMSReceiverService' is configured to put incoming messages onto
'topic1'.
After sending a test message, the tests start a JMS Receiver on 'topic 1'
with JMSCorrelationID filter property set to the message ID of the test
message that was sent. The test verifies that the message is the expected
reply or an expected BrokerErrorMessage with an 'exceptionClassification'
field set to PipelineStageException.testException.
The test uses cdcatalog.xml as the test message and sets the localPart
of the messageType to 'cdOrder_4', which means that, in osESB,
the messages are routed to the MessagePipeline configured by
deployabletestpackage1/transporthandler-config/message-pipeline-4-test-config.xml.
The tests use a pool of ClientGateway(s) configured by
keyed-pooled-clientgateway-test-config.xml, where each poolKey configures a
client-side MessagePipeline that sends test messages to a different
transport handler as follows:
<wsa:ReplyTo> and
<wsa:FaultTo> EndpointReferences set in the outgoing SOAPMessage.<messagetype-to-messagepipeline-map>
configuration element of a MessageRouterConfiguration to map message types
to MessagePipelines.
There are two ways that the message type for an incoming message
is determined:
<xmlMessagetypeHelperConfiguration> content model element of the
MessageRouterConfiguration.
| Field Summary |
|---|
| Fields inherited from class org.osesb.utilities.junit.OSESBTestCase |
|---|
configFile, log, reader, testDataDirectory, testProperties, thisClassName |
| Constructor Summary | |
|---|---|
TransportHandlerAsynchronousUnitTest(java.lang.String name)
Construct a new instance. |
|
| Method Summary | |
|---|---|
static void |
main(java.lang.String[] args)
The main method runs all the tests in the text ui |
void |
setUp()
This method is called before a test is executed. |
static junit.framework.Test |
suite()
The suite method runs all the tests |
void |
tearDown()
This method is called after a test is executed. |
void |
testAsynchronousInteractionUsingMessagePipeline_4()
Unit test of asynchronous interaction with transport handlers deployed with the MessagePipeline configured by deployabletestpackage1/transporthandler-config/message-pipeline-4-test-config.xml, which configures a MessagePipeline as follows: The test MessagePipeline is configured with a single PipelineStage, EchoMessageWithRandomPipelineStageExceptionPipelineStage, with a runStage() method that generates a random number. |
| Methods inherited from class org.osesb.utilities.junit.OSESBTestCase |
|---|
getBooleanTestProperty, getIntTestProperty, getLongTestProperty, getTestResourcesAsStreams, getTestResourcesAsText, getTestResourcesFiles, loadTestProperties, readTestFilesAsStreams |
| Methods inherited from class junit.framework.TestCase |
|---|
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString |
| Methods inherited from class junit.framework.Assert |
|---|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public TransportHandlerAsynchronousUnitTest(java.lang.String name)
| Method Detail |
|---|
public static junit.framework.Test suite()
public void setUp()
throws java.lang.Exception
setUp in class OSESBTestCasejava.lang.Exception
public void tearDown()
throws java.lang.Exception
tearDown in class OSESBTestCasejava.lang.Exceptionpublic static void main(java.lang.String[] args)
public void testAsynchronousInteractionUsingMessagePipeline_4()
throws java.lang.Exception
<wsa:ReplyTo> and <wsa:FaultTo>
entries. The JAXRPCDynamicClient(s) invoke
SOAPXMLMessageTransportHandler#receiveAsynchronousMessage(). The
configured org.osesb.connectors.jaxrpc.addressing.JAXRPCServerAddressingHandler
processes the ws-addressing entries in the SOAPHeader of the incoming
message, which causes replies and faults to be sent to the specified
EndpointReferences.
For the test, the <wsa:ReplyTo> and <wsa:FaultTo>
EndpointReferences specify a JMS-backed web service, which puts the
incoming message content to the configured queue or topic. The JMS-backed
web service is in the org.osesb.test.soapjmsreceiverservice
package of the test-webservices module. The service sets the correlation
ID of the JMS message put to the JMS destination to the <wsa:RelatesTo>
SOAPHeader entry of the incoming SOAPMessage.
For JMS transport the test situation is conceptually the same, except that
a JMS client is used to send messages to a JMSXMLMessageTransportHandler
and instead of using ws-addressing facilities the <replyToQueue>
or <replyToTopic> elements of the JMSClientConfiguration are used
to specify the JMS Destination for the replies.
The transport handlers under test are configured to send asynchronous
replies that utlimately are put to the same JMS Topic, which is one
of the framework's base test destinations, 'topic1'. So, JMS messages
sent to the JMS transport handler, JMSXMLMessageTransportHandlerMDB,
will have their JMS ReplyTo Destination set to 'topic1'. Messages
sent to the SOAP transport handler, SOAPXMLMessageTransportHandlerBean,
will have a ws-addressing configuration with <ReplyTo> and
<FaultTo> EndpointReferences that point to the 'SOAPJMSReceiverService',
which is deployed from the org.osesb.test.soapjmsreceiverservice
package of the test-webservices module. For the test, the
'SOAPJMSReceiverService' is configured to put incoming messages onto
'topic1'.
java.lang.Exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||