|
|||||||||
| 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.TransportHandlerSynchronousUnitTest
public class TransportHandlerSynchronousUnitTest
This class contains unit tests for synchronous request/reply interactions with the transport handlers that are deployed with the MessagePipeline(s) in deployabletestpackage1/transporthandler-config:
<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.
Notes on test assetions for JMS message correlation and SOAP ws-addressing.
For JMS transport, the tests check that the 'messageID' and 'correlationID'
properties of the EAIMessage returned from the ClientGateway are not null.
Functionally, this test is superfluous because the JMS connector matches
the JMSCorrelationID of the reply against the JMSMessageID of the of the
request message. Testing that the EAIMessage properties are not null verfies
that the JMSMessageID and JMSCorrelationID are propagated back to the
ClientGateway.
For SOAP transport, the 'messageID' and 'correlationID' properties of the
EAIMessage returned from the ClientGateway are not checked because ws-addressing
SOAPHeader entries are not in the SOAP response and therefore the 'messageID'
and 'correlationID' properties of the EAIMessage returned from the ClientGateway
are not populated. In fact, the client and server side addressing handlers,
JAXRPCClientAddressingHandler and JAXRPCServerAddressingHandler do not have
handleResponse() methods that could add ws-addressing entries to the
SOAP response.
| Field Summary |
|---|
| Fields inherited from class org.osesb.utilities.junit.OSESBTestCase |
|---|
configFile, log, reader, testDataDirectory, testProperties, thisClassName |
| Constructor Summary | |
|---|---|
TransportHandlerSynchronousUnitTest(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 |
testMessagePipeline_1()
Unit test of transport handlers deployed with the MessagePipeline configured by deployabletestpackage1/transporthandler-config/message-pipeline-1-test-config.xml, which configures a MessagePipeline as follows: 1. |
void |
testMessagePipeline_2()
Unit test of transport handlers deployed with the MessagePipeline configured by deployabletestpackage1/transporthandler-config/message-pipeline-2-test-config.xml, which configures a MessagePipeline as follows: A XMLNodeExtractorPipelineStage named SumCDElementPricesPipelineStage extracts all <cd>
elements from a 'cdcatalog' XML message and sets the MessagePipeline result as XML that contains
a root element named 'totalPrice' with a value that is the sum of all <price> elements. |
void |
testMessagePipeline_3()
Unit test of transport handlers deployed with the MessagePipeline configured by deployabletestpackage1/transporthandler-config/message-pipeline-3-test-config.xml, which configures a MessagePipeline as follows: DoubleSumCDElementPricesPipelineStage is a FlowControlPipelineStage that configures two branches, each with a single SumCDElementPricesPipelineStage, which extracts all <cd> elements from a 'cdcatalog' XML message and sets the
MessagePipeline result as XML that contains a root element named 'totalPrice'
with a value that is the sum of all <price> elements. |
void |
testMessagePipeline_4()
Unit test of 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. |
void |
testMessagePipeline_5()
Unit test of transport handlers deployed with the MessagePipeline configured by deployabletestpackage1/transporthandler-config/message-pipeline-5-test-config.xml, which configures a MessagePipeline as follows: The test MessagePipeline is configured with a single PipelineStage, FCEchoMessageWithRandomPipelineStageExceptionPipelineStage, which is a is a FlowControlPipelineStage that configures two EchoMessageWithRandomPipelineStageExceptionPipelineStage branches that are run in parallel. |
void |
testMessagePipeline_6()
Unit test of transport handlers deployed with the MessagePipelineconfigured by deployabletestpackage1/transporthandler-config/message-pipeline-6-test-config.xml, which configures a MessagePipeline as follows: A TestBrokerAcknowledgementMessagePipelineStage is configured to test the correct receipt of a BrokerAcknowledgementMessage from a transport handler. |
void |
testMessagePipeline_7()
Unit test of transport handlers deployed with the MessagePipeline configured by deployabletestpackage1/transporthandler-config/message-pipeline-7-test-config.xml, which configures a MessagePipeline as follows: 1. |
| 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 TransportHandlerSynchronousUnitTest(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 testMessagePipeline_1()
throws java.lang.Exception
java.lang.Exception
public void testMessagePipeline_2()
throws java.lang.Exception
<cd>
elements from a 'cdcatalog' XML message and sets the MessagePipeline result as XML that contains
a root element named 'totalPrice' with a value that is the sum of all <price> elements.
java.lang.Exception
public void testMessagePipeline_3()
throws java.lang.Exception
<cd> elements from a 'cdcatalog' XML message and sets the
MessagePipeline result as XML that contains a root element named 'totalPrice'
with a value that is the sum of all <price> elements.
DoubleSumCDElementPricesPipelineStage is configured to run the branches in parallel
and then set the MessagePipeline result as XML that contains a root element named
'totalPrice' with a value that is the sum of the results returned by each
branch. So, the 'totalPrice' returned should be double the sum for the <price>
elements in the original 'cdcatalog' message.
java.lang.Exception
public void testMessagePipeline_4()
throws java.lang.Exception
java.lang.Exception
public void testMessagePipeline_5()
throws java.lang.Exception
java.lang.Exception
public void testMessagePipeline_6()
throws java.lang.Exception
java.lang.Exception
public void testMessagePipeline_7()
throws java.lang.Exception
<testFiles xmlns:xmime="http://www.w3.org/2005/05/xmlmime">
<testFile>
<fileName>Apas-Track2.mp3</fileName>
<mimeType xmime:contentType="audio/mpeg" />
</testFile>
<testFile>
<fileName>Dry Ice Video.wmv</fileName>
<mimeType xmime:contentType="video/x-ms-wmv" />
</testFile>
</testFiles>
EchoMessageWithAttachmentCompression# runStage() expects the number of attachments
to equal the number of <testFile> elements.
runStage() compresses the attachments, changes the value of the <mimeType>
element to 'application/zip'. runStage() sets the MessagePipeline result message to a
EAIXMLMessageWithAttachments with the modified XML and compressed attachments.
java.lang.Exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||