org.osesb.messagepipeline.test.builtinstagesunittest
Class MessagePipelineTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.osesb.utilities.junit.OSESBTestCase
              extended by org.osesb.utilities.junit.OSESBDBUnitTestCase
                  extended by org.osesb.messagepipeline.test.builtinstagesunittest.MessagePipelineTest
All Implemented Interfaces:
junit.framework.Test

public class MessagePipelineTest
extends OSESBDBUnitTestCase

A MessagePipelineTest, which is driven by the configuration file specified by the 'testConfiguration' property in Test.properties. For example, MessagePipelineTest-db2-config.xml configures the test to use DB2 and MessagePipelineTest-oracle-config.xml configures the test to use Oracle.

The configured MessagePipeline processes the XML messages as follows:

1. A XMLElementPropagatorPipelineStage extracts and propagates elements for downstream processing.

2. A XMLValidationPipelineStage validates the propagated XML against cdentry.xsd

3. A JMSClientPipelineStage sends the cd element to a Queue

4. A XSLTPipelineStage transforms a cd element to one that contains only and <price> elements using cdentry.xslt <p/> 5. A custom PipelineStage inserts a messageID as a UUID in the root element of a cd element. <p/> 6. A descendant of XMLNodeExtractorPipelineStage extracts the messageID attribute and the <title> and <price> elements and places their values in a MessagePipelineContext variable named stageName.sqlStatementName.sqlParameters as an Object[]. stageName is the name of the subsequent DatabaseUpdatePipelineStage and sqlStatementName is the name of the SQLStatement in the DatabaseUpdatePipelineStage. The sqlParameters are used by the DatabaseUpdatePipelineStage as input to the parameterized update of the 'CDELEMENTS' table in the JDBCTEST tables. <p/> 7 A DatabaseUpdatePipelineStage inserts a row in a table named 'CDELEMENTS' with the values of the <title> and <price> elements using messageID as a key. Table 'CDELEMENTS' must exist in the JDBCTEST tables. The values of messageID, title, and price were set by XMLNodeExtractorPipelineStage in an Object[] variable in the MessagePipelineContext. <p/> 8. A ValidationBeanPipelineStage is used to validate that no cd price exceeds 24.99. <p/> This is a message pipeline test where the runPipeline() method is invoked with cdcatalog-succeed.xml and cdcatalog-fail.xml. <p/> testMessagePipelineSuccess runs the MessagePipeline with cdcatalog-succeed.xml. The test data in cdcatalog-succeed.xml is configured for success. <p/> testMessagePipelineFailure runs the MessagePipeline with cdcatalog-succeed.xml. The test data in cdcatalog-fail.xml is configured for failure in the XMLValidationBeanPipelineStage. For this test case, database inserts for the DatabasePipelineStage and JMS Messages for the JMSClientPipelineStage should be rolled back. <p/> testMessagePipelineSuccess and testMessagePipelineFailure run three test cases for the PipleineStageConfiguration property 'transactionScope': <p/> <ul> <li>All PipelineStages with a transactionScope of TRANSACTIONNONE.</li> <li>All PipelineStages with a transactionScope of STAGESCOPED.</li> <li>All PipelineStages with a transactionScope of PIPELINESCOPED.</li> </ul> <p/> <p/> testMessagePipelineSuccess and testMessagePipelineFailure run three test cases for the PipleineStageConfiguration property 'processAllMessaqes': <p/> <ul> <li>true: propagated messages are processed independently.</li> <li>false: propagated messages are processed as a single unit of work.</li> </ul> <p/> Test conditions: <p/> 1. Set the 'testConfiguration' property in Test.properties to the configuration for the test. 2. The JDBCTEST tables must exist as configured in the JDBCConfiguration of the DatabaseUpdatePipelineStage, which is databaseinsert-cdelement-pipelinestageconfig.xml, or in the JDBCConfiguration that is configured for all PipelineStages in message-pipeline-test-config.xml. 3. The JMS Destination must exist as configured in the JMSClientConfiguration of the JMSClientPipelineStage, which is jmssend-cdelement-pipelinestageconfig.xml. 4. The JMS Destination should be cleared of any Messages and there must be no MDB(s) deployed that are listening on the JMS Destination that is configured for the test. <P> <P> <HR> <P> <!-- =========== FIELD SUMMARY =========== --> <A NAME="field_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Field Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected  <A HREF="../../../../../org/osesb/connectors/jms/JMSQueueListener.html" title="class in org.osesb.connectors.jms">JMSQueueListener</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/osesb/messagepipeline/test/builtinstagesunittest/MessagePipelineTest.html#jmsQueueListener">jmsQueueListener</A></B></CODE> <BR>           setUp() starts a org.osesb.connectors.jms.JMSQueueListener to receive messages sent by the JMSClientPipelineStage that is part of the test PipelineConfiguration.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected  <A HREF="../../../../../org/osesb/messagepipeline/MessagePipeline.html" title="class in org.osesb.messagepipeline">MessagePipeline</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/osesb/messagepipeline/test/builtinstagesunittest/MessagePipelineTest.html#messagePipeline">messagePipeline</A></B></CODE> <BR>           The MessagePipeline for the test -- see Test.properties and setUp().</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected  <A HREF="../../../../../org/osesb/configuration/SQLStatementListConfiguration.html" title="class in org.osesb.configuration">SQLStatementListConfiguration</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/osesb/messagepipeline/test/builtinstagesunittest/MessagePipelineTest.html#sqlStatementListConfiguration">sqlStatementListConfiguration</A></B></CODE> <BR>           SQLStatementListConfiguration, for the SQLStatement(s) that are used for test assertions.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected  <A HREF="../../../../../org/osesb/configuration/XMLConfiguration.html" title="class in org.osesb.configuration">XMLConfiguration</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/osesb/messagepipeline/test/builtinstagesunittest/MessagePipelineTest.html#testConfiguration">testConfiguration</A></B></CODE> <BR>           The XMLConfiguration for the test.</TD> </TR> </TABLE>  <A NAME="fields_inherited_from_class_org.osesb.utilities.junit.OSESBDBUnitTestCase"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Fields inherited from class org.osesb.utilities.junit.<A HREF="../../../../../org/osesb/utilities/junit/OSESBDBUnitTestCase.html" title="class in org.osesb.utilities.junit">OSESBDBUnitTestCase</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../../../org/osesb/utilities/junit/OSESBDBUnitTestCase.html#dbunitDataSet">dbunitDataSet</A>, <A HREF="../../../../../org/osesb/utilities/junit/OSESBDBUnitTestCase.html#dbunitJDBCConnection">dbunitJDBCConnection</A></CODE></TD> </TR> </TABLE>  <A NAME="fields_inherited_from_class_org.osesb.utilities.junit.OSESBTestCase"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Fields inherited from class org.osesb.utilities.junit.<A HREF="../../../../../org/osesb/utilities/junit/OSESBTestCase.html" title="class in org.osesb.utilities.junit">OSESBTestCase</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../../../org/osesb/utilities/junit/OSESBTestCase.html#configFile">configFile</A>, <A HREF="../../../../../org/osesb/utilities/junit/OSESBTestCase.html#log">log</A>, <A HREF="../../../../../org/osesb/utilities/junit/OSESBTestCase.html#reader">reader</A>, <A HREF="../../../../../org/osesb/utilities/junit/OSESBTestCase.html#testDataDirectory">testDataDirectory</A>, <A HREF="../../../../../org/osesb/utilities/junit/OSESBTestCase.html#testProperties">testProperties</A>, <A HREF="../../../../../org/osesb/utilities/junit/OSESBTestCase.html#thisClassName">thisClassName</A></CODE></TD> </TR> </TABLE>   <!-- ======== CONSTRUCTOR SUMMARY ======== --> <A NAME="constructor_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Constructor Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../../org/osesb/messagepipeline/test/builtinstagesunittest/MessagePipelineTest.html#MessagePipelineTest(java.lang.String)">MessagePipelineTest</A></B>(java.lang.String name)</CODE> <BR>           Construct a new instance.</TD> </TR> </TABLE>   <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/osesb/messagepipeline/test/builtinstagesunittest/MessagePipelineTest.html#main(java.lang.String[])">main</A></B>(java.lang.String[] args)</CODE> <BR>           The main method runs all the tests in the text ui</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/osesb/messagepipeline/test/builtinstagesunittest/MessagePipelineTest.html#setUp()">setUp</A></B>()</CODE> <BR>           This method is called before a test is executed.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static junit.framework.Test</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/osesb/messagepipeline/test/builtinstagesunittest/MessagePipelineTest.html#suite()">suite</A></B>()</CODE> <BR>           The suite method runs all the tests</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/osesb/messagepipeline/test/builtinstagesunittest/MessagePipelineTest.html#tearDown()">tearDown</A></B>()</CODE> <BR>           This method is called after a test is executed.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/osesb/messagepipeline/test/builtinstagesunittest/MessagePipelineTest.html#testMessagePipelineFailure()">testMessagePipelineFailure</A></B>()</CODE> <BR>           Test MessagePipeline failure, which uses cdcatalog-fail.xml as the input message to the pipeline.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/osesb/messagepipeline/test/builtinstagesunittest/MessagePipelineTest.html#testMessagePipelineSuccess()">testMessagePipelineSuccess</A></B>()</CODE> <BR>           Test MessagePipeline success, which uses cdcatalog-succeed.xml as the input message to the pipeline.</TD> </TR> </TABLE>  <A NAME="methods_inherited_from_class_org.osesb.utilities.junit.OSESBDBUnitTestCase"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class org.osesb.utilities.junit.<A HREF="../../../../../org/osesb/utilities/junit/OSESBDBUnitTestCase.html" title="class in org.osesb.utilities.junit">OSESBDBUnitTestCase</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../../../org/osesb/utilities/junit/OSESBDBUnitTestCase.html#displayStartupMessage()">displayStartupMessage</A>, <A HREF="../../../../../org/osesb/utilities/junit/OSESBDBUnitTestCase.html#loadDBUnitDatabaseConnection(java.sql.Connection, java.lang.String, java.lang.String)">loadDBUnitDatabaseConnection</A></CODE></TD> </TR> </TABLE>  <A NAME="methods_inherited_from_class_org.osesb.utilities.junit.OSESBTestCase"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class org.osesb.utilities.junit.<A HREF="../../../../../org/osesb/utilities/junit/OSESBTestCase.html" title="class in org.osesb.utilities.junit">OSESBTestCase</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../../../org/osesb/utilities/junit/OSESBTestCase.html#getBooleanTestProperty(java.lang.String, boolean)">getBooleanTestProperty</A>, <A HREF="../../../../../org/osesb/utilities/junit/OSESBTestCase.html#getIntTestProperty(java.lang.String, int)">getIntTestProperty</A>, <A HREF="../../../../../org/osesb/utilities/junit/OSESBTestCase.html#getLongTestProperty(java.lang.String, long)">getLongTestProperty</A>, <A HREF="../../../../../org/osesb/utilities/junit/OSESBTestCase.html#getTestResourcesAsStreams(java.lang.String[])">getTestResourcesAsStreams</A>, <A HREF="../../../../../org/osesb/utilities/junit/OSESBTestCase.html#getTestResourcesAsText(java.lang.String[])">getTestResourcesAsText</A>, <A HREF="../../../../../org/osesb/utilities/junit/OSESBTestCase.html#getTestResourcesFiles(java.lang.String[])">getTestResourcesFiles</A>, <A HREF="../../../../../org/osesb/utilities/junit/OSESBTestCase.html#loadTestProperties(java.lang.Class)">loadTestProperties</A>, <A HREF="../../../../../org/osesb/utilities/junit/OSESBTestCase.html#readTestFilesAsStreams(java.lang.String[])">readTestFilesAsStreams</A></CODE></TD> </TR> </TABLE>  <A NAME="methods_inherited_from_class_junit.framework.TestCase"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class junit.framework.TestCase</B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE>countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString</CODE></TD> </TR> </TABLE>  <A NAME="methods_inherited_from_class_junit.framework.Assert"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class junit.framework.Assert</B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE>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</CODE></TD> </TR> </TABLE>  <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</CODE></TD> </TR> </TABLE>   <P> <!-- ============ FIELD DETAIL =========== --> <A NAME="field_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Field Detail</B></FONT></TH> </TR> </TABLE> <A NAME="testConfiguration"><!-- --></A><H3> testConfiguration</H3> <PRE> protected <A HREF="../../../../../org/osesb/configuration/XMLConfiguration.html" title="class in org.osesb.configuration">XMLConfiguration</A> <B>testConfiguration</B></PRE> <DL> <DD>The XMLConfiguration for the test. see setUp(). <P> <DL> </DL> </DL> <HR> <A NAME="messagePipeline"><!-- --></A><H3> messagePipeline</H3> <PRE> protected <A HREF="../../../../../org/osesb/messagepipeline/MessagePipeline.html" title="class in org.osesb.messagepipeline">MessagePipeline</A> <B>messagePipeline</B></PRE> <DL> <DD>The MessagePipeline for the test -- see Test.properties and setUp(). <P> <DL> </DL> </DL> <HR> <A NAME="jmsQueueListener"><!-- --></A><H3> jmsQueueListener</H3> <PRE> protected <A HREF="../../../../../org/osesb/connectors/jms/JMSQueueListener.html" title="class in org.osesb.connectors.jms">JMSQueueListener</A> <B>jmsQueueListener</B></PRE> <DL> <DD>setUp() starts a org.osesb.connectors.jms.JMSQueueListener to receive messages sent by the JMSClientPipelineStage that is part of the test PipelineConfiguration. <P> <DL> </DL> </DL> <HR> <A NAME="sqlStatementListConfiguration"><!-- --></A><H3> sqlStatementListConfiguration</H3> <PRE> protected <A HREF="../../../../../org/osesb/configuration/SQLStatementListConfiguration.html" title="class in org.osesb.configuration">SQLStatementListConfiguration</A> <B>sqlStatementListConfiguration</B></PRE> <DL> <DD>SQLStatementListConfiguration, for the SQLStatement(s) that are used for test assertions. see setUp(). <P> <DL> </DL> </DL> <!-- ========= CONSTRUCTOR DETAIL ======== --> <A NAME="constructor_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Constructor Detail</B></FONT></TH> </TR> </TABLE> <A NAME="MessagePipelineTest(java.lang.String)"><!-- --></A><H3> MessagePipelineTest</H3> <PRE> public <B>MessagePipelineTest</B>(java.lang.String name)</PRE> <DL> <DD>Construct a new instance. <p/> OSESBTestCase (ancestor) constructor does the following: <p/> <ol> <li>Instantiates a logging implementation.</li> <li>Instantiates an instance of ClassLoaderFileReader for reading test files from the ClassPath (not the file system).</li> <li>Loads Test.properties into ResourceBundle testProperties.</li> <li>Sets the testDataDirectory property using the testDataDirectory entry from Test.properties.</li> </ol> <P> </DL> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TH> </TR> </TABLE> <A NAME="suite()"><!-- --></A><H3> suite</H3> <PRE> public static junit.framework.Test <B>suite</B>()</PRE> <DL> <DD>The suite method runs all the tests <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="setUp()"><!-- --></A><H3> setUp</H3> <PRE> public void <B>setUp</B>() throws java.lang.Exception</PRE> <DL> <DD>This method is called before a test is executed. <P> <DD><DL> <DT><B>Overrides:</B><DD><CODE><A HREF="../../../../../org/osesb/utilities/junit/OSESBTestCase.html#setUp()">setUp</A></CODE> in class <CODE><A HREF="../../../../../org/osesb/utilities/junit/OSESBTestCase.html" title="class in org.osesb.utilities.junit">OSESBTestCase</A></CODE></DL> </DD> <DD><DL> <DT><B>Throws:</B> <DD><CODE>java.lang.Exception</CODE></DL> </DD> </DL> <HR> <A NAME="tearDown()"><!-- --></A><H3> tearDown</H3> <PRE> public void <B>tearDown</B>() throws java.lang.Exception</PRE> <DL> <DD>This method is called after a test is executed. <P> <DD><DL> <DT><B>Overrides:</B><DD><CODE><A HREF="../../../../../org/osesb/utilities/junit/OSESBDBUnitTestCase.html#tearDown()">tearDown</A></CODE> in class <CODE><A HREF="../../../../../org/osesb/utilities/junit/OSESBDBUnitTestCase.html" title="class in org.osesb.utilities.junit">OSESBDBUnitTestCase</A></CODE></DL> </DD> <DD><DL> <DT><B>Throws:</B> <DD><CODE>java.lang.Exception</CODE></DL> </DD> </DL> <HR> <A NAME="main(java.lang.String[])"><!-- --></A><H3> main</H3> <PRE> public static void <B>main</B>(java.lang.String[] args)</PRE> <DL> <DD>The main method runs all the tests in the text ui <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="testMessagePipelineSuccess()"><!-- --></A><H3> testMessagePipelineSuccess</H3> <PRE> public void <B>testMessagePipelineSuccess</B>() throws java.lang.Exception</PRE> <DL> <DD>Test MessagePipeline success, which uses cdcatalog-succeed.xml as the input message to the pipeline. The test file, cdcatalog-succeed.xml, should pass all tests. <p/> The test includes three settings for the 'transactionScope' PipelineStageConfiguration property: <p/> <ul> <li>All PipelineStages with a transactionScope of TRANSACTIONNONE. PipelineStage(s) are untransacted and commit() and rollback() are not invoked. For built-in stages that include Database and JMS operations, the operations are conducted without a transaction. For Database operations this means that the JDBC AutoCommit property will be set to true. For JMS operations this means that JMS Sessions are created as untransacted sessions.</li> <li>All PipelineStages with a transactionScope of STAGESCOPED. PipelineStage transaction(s) are managed locally without affecting any other stages in the MessagePipeline. commit() is invoked by the MessagePipeline if runStage() completes successfully. rollback() is invoked by the MessagePipeline if runStage() throws a PipelineStageException. For built-in stages that include Database and JMS operations, the operations are conducted within a transaction. For Database operations this means that the JDBC AutoCommit property will be set to false and the PipelineStage commit() and rollback() methods will invoke the commit() and rollback() methods, respectively, on the JDBC connection. For JMS operations this means that the JMS Sessions must be created as transacted sessions and the PipelineStage commit() and rollback() methods will invoke the commit() and rollback() methods, respectively, on the JMS session. See the setTransactedSession() method of the org.osesb.configuration.JMSClientConfiguration.</li> <li>All PipelineStages with a transactionScope of PIPELINESCOPED. When pipeline processing ends normally, without throwing a PipelineStageException, the MessagePipeline will invoke the PipelineStage commit() methods on PipelineStages with transactionScope == PipelineStageConfiguration.PIPELINESCOPED beginning with the first PipelineStage. If a PipelineStage's runStage() method throws a PipelineStageException, then pipeline processing terminates with that stage and subsequent stages are not run. In this case the MessagePipeline will invoke the PipelineStage rollback() methods, in reverse order, on PipelineStages with transactionScope == PipelineStageConfiguration.PIPELINESCOPED beginning with the PipelineStage that threw the Exception. For built-in stages that include Database and JMS operations, the operations are conducted within a transaction. For Database operations this means that the JDBC AutoCommit property will be set to false and the PipelineStage commit() and rollback() methods will invoke the commit() and rollback() methods, respectively, on the JDBC connection. For JMS operations this means that the JMS Sessions must be created as transacted sessions and the PipelineStage commit() and rollback() methods will invoke the commit() and rollback() methods, respectively, on the JMS session. See the setTransactedSession() method of the org.osesb.configuration.JMSClientConfiguration.</li> </ul> <p/> The test includes two settings for the 'processAllMessaqes' PipelineStageConfiguration property: <p/> <ul> <li>true: propagated messages are processed independently. Transactions for all stages with PIPELINESCOPED transactionScope, which are after the propagating PipelineStage are committed for each message. If a PipelineStageException is thrown while processing a propagated message, the exception is logged but not thrown back to the propagating stage. Therefore all propagated messages will be processed.</li> <li>false: propagated messages are processed as a single unit of work. Transactions for all stages with PIPELINESCOPED transactionScope, which are after the propagating PipelineStage are committed after all messages are propagated. If a PipelineStageException is thrown while processing a propagated message, the exception is thrown back to the propagating stage and MessagePipeline processing terminates at the propagating stage.</li> </ul> <p/> Therefore, there are 3 * 2 = 6, permutations of the test. <P> <DD><DL> <DT><B>Throws:</B> <DD><CODE>java.lang.Exception</CODE></DL> </DD> </DL> <HR> <A NAME="testMessagePipelineFailure()"><!-- --></A><H3> testMessagePipelineFailure</H3> <PRE> public void <B>testMessagePipelineFailure</B>() throws java.lang.Exception</PRE> <DL> <DD>Test MessagePipeline failure, which uses cdcatalog-fail.xml as the input message to the pipeline. The test file, cdcatalog-fail.xml, includes a 'cd' entry that triggers failure by a ValidationBean. The XMLValidationBeanPipelineStage is configured using validate-cdelementprice-pipelinestageconfig.xml and is the last PipelineStage to run. The ValidationBean asserts that no 'cd' element price exceeds 24.99. <p/> The test includes three settings for the 'transactionScope' PipelineStageConfiguration property: <p/> <ul> <li>All PipelineStages with a transactionScope of TRANSACTIONNONE. PipelineStage(s) are untransacted and commit() and rollback() are not invoked. For built-in stages that include Database and JMS operations, the operations are conducted without a transaction. For Database operations this means that the JDBC AutoCommit property will be set to true. For JMS operations this means that JMS Sessions are created as untransacted sessions.</li> <li>All PipelineStages with a transactionScope of STAGESCOPED. PipelineStage transaction(s) are managed locally without affecting any other stages in the MessagePipeline. commit() is invoked by the MessagePipeline if runStage() completes successfully. rollback() is invoked by the MessagePipeline if runStage() throws a PipelineStageException. For built-in stages that include Database and JMS operations, the operations are conducted within a transaction. For Database operations this means that the JDBC AutoCommit property will be set to false and the PipelineStage commit() and rollback() methods will invoke the commit() and rollback() methods, respectively, on the JDBC connection. For JMS operations this means that the JMS Sessions must be created as transacted sessions and the PipelineStage commit() and rollback() methods will invoke the commit() and rollback() methods, respectively, on the JMS session. See the setTransactedSession() method of the org.osesb.configuration.JMSClientConfiguration.</li> <li>All PipelineStages with a transactionScope of PIPELINESCOPED. When pipeline processing ends normally, without throwing a PipelineStageException, the MessagePipeline will invoke the PipelineStage commit() methods on PipelineStages with transactionScope == PipelineStageConfiguration.PIPELINESCOPED beginning with the first PipelineStage. If a PipelineStage's runStage() method throws a PipelineStageException, then pipeline processing terminates with that stage and subsequent stages are not run. In this case the MessagePipeline will invoke the PipelineStage rollback() methods, in reverse order, on PipelineStages with transactionScope == PipelineStageConfiguration.PIPELINESCOPED beginning with the PipelineStage that threw the Exception. For built-in stages that include Database and JMS operations, the operations are conducted within a transaction. For Database operations this means that the JDBC AutoCommit property will be set to false and the PipelineStage commit() and rollback() methods will invoke the commit() and rollback() methods, respectively, on the JDBC connection. For JMS operations this means that the JMS Sessions must be created as transacted sessions and the PipelineStage commit() and rollback() methods will invoke the commit() and rollback() methods, respectively, on the JMS session. See the setTransactedSession() method of the org.osesb.configuration.JMSClientConfiguration.</li> </ul> <p/> The test includes two settings for the 'processAllMessaqes' PipelineStageConfiguration property: <p/> <ul> <li>true: propagated messages are processed independently. Transactions for all stages with PIPELINESCOPED transactionScope, which are after the propagating PipelineStage are committed for each message. If a PipelineStageException is thrown while processing a propagated message, the exception is logged but not thrown back to the propagating stage. Therefore all propagated messages will be processed.</li> <li>false: propagated messages are processed as a single unit of work. Transactions for all stages with PIPELINESCOPED transactionScope, which are after the propagating PipelineStage are committed after all messages are propagated. If a PipelineStageException is thrown while processing a propagated message, the exception is thrown back to the propagating stage and MessagePipeline processing terminates at the propagating stage.</li> </ul> <p/> Therefore, there are 3 * 2 = 6, permutations of the test. <P> <DD><DL> <DT><B>Throws:</B> <DD><CODE>java.lang.Exception</CODE></DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev">  <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../../../../org/osesb/messagepipeline/test/builtinstagesunittest/InsertMessageIDPipelineStage.html" title="class in org.osesb.messagepipeline.test.builtinstagesunittest"><B>PREV CLASS</B></A>   <A HREF="../../../../../org/osesb/messagepipeline/test/builtinstagesunittest/ValidationBean_ValidateCDElementPrice.html" title="class in org.osesb.messagepipeline.test.builtinstagesunittest"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/osesb/messagepipeline/test/builtinstagesunittest/MessagePipelineTest.html" target="_top"><B>FRAMES</B></A>    <A HREF="MessagePipelineTest.html" target="_top"><B>NO FRAMES</B></A>    <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> </BODY> </HTML>