|
|||||||||
| 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.msgrouting.test.deployabletestpackage1.MessagePipelineStageUnitTests
public class MessagePipelineStageUnitTests
This class contains unit tests for the MessagePipelines in the org.osesb.msgrouting.test.deployabletestpackage1 package.
The unit tests are intended to verify operation of the MessagePipelines before deployment with a transport handler.
| Field Summary |
|---|
| Fields inherited from class org.osesb.utilities.junit.OSESBTestCase |
|---|
configFile, log, reader, testDataDirectory, testProperties, thisClassName |
| Constructor Summary | |
|---|---|
MessagePipelineStageUnitTests(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 for the MessagePipeline configured by message-pipeline-1-test-config.xml, which configures a MessagePipeline as follows: 1. |
void |
testMessagePipeline_2()
Unit test for the MessagePipeline configured by 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 for the MessagePipeline configured by 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 for the MessagePipeline configured by 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 for the MessagePipeline configured by 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 for the MessagePipeline configured by message-pipeline-6-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 MessagePipelineStageUnitTests(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
<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>
EchoMessageWithAttachmentCompressionPipelineStage#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 | ||||||||