[jboss-svn-commits] JBL Code SVN: r16945 - in labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2: product/docs and 96 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Fri Nov 30 10:43:58 EST 2007
Author: kevin.conner at jboss.com
Date: 2007-11-30 10:43:56 -0500 (Fri, 30 Nov 2007)
New Revision: 16945
Added:
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/actions/AggregationDetails.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/actions/PropertySetter.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/actions/TestMessageStore.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/actions/TestMessageStoreSink.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/AggregationDetailsUnitTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/JBESB_1201_UnitTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/JBESB_1204_1331_UnitTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/Nested_Splits_UnitTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/TestCourier.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/action-configs-01.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/action-configs-02.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/testutils/NullAction.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/aggregator/src/org/jboss/soa/esb/samples/quickstart/aggregator/AggregatedMessageAssembler.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/jms_topic/src/org/jboss/soa/esb/samples/quickstart/jmstopic/SendJMSMessage.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer1/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer1/test/SendJMSMessage.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer2/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer2/test/SendJMSMessage.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CancelProcessInstanceFacade.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/Command.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CommandExecutor.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/DeployProcessDefinitionFacade.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/FacadeUtil.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/MessageFacade.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/MessageHelper.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/NewProcessInstanceFacade.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/SignalFacade.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/VariableMapping.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/cmd/
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/cmd/VariableMappingUnitTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/resources/server/
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/resources/server/META-INF/
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/resources/server/META-INF/jboss-service.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/AbstractQuickstartTestCase.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestration1Test.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestration2Test.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestration3Test.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BusinessRulesServiceTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/DeadLetterTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/ExceptionsFaultsTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldFileNotifierTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/JMSTopicTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/LoadGeneratorTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/MessageFilterTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/MessageStoreTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/ScheduledServicesTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SpringAOPTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SpringHelloWorldTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SpringJPetStoreTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebServiceConsumer1Test.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebServiceConsumer2Test.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebServiceProducerTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/server/QuickstartMessageStore.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/server/QuickstartMessageStoreImpl.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/server/QuickstartMessageStoreImplMBean.java
Removed:
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/util/AbstractCommandVehicle.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/JBESB_1201_UnitTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/JBESB_1204_1331_UnitTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/Nested_Splits_UnitTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/TestCourier.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/action-configs-01.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/action-configs-02.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/util/AbstractCommandVehicleUnitTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/CommandExecutorFactory.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/MessageFacadeFactory.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actions/CommandInterpreter.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actions/impl/
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CancelProcessInstanceFacade.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/Command.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CommandExecutor.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/DeployProcessDefinitionFacade.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/FacadeUtil.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/MessageFacade.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/MessageHelper.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/NewProcessInstanceFacade.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/SignalFacade.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/VariableMapping.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/util/
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actions/CommandInterpreterUnitTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actions/impl/
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/cmd/VariableMappingUnitTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/JMXTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/resources/server/META-INF/
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/resources/server/META-INF/jboss-service.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestrationTest.java
Modified:
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/docs/AdministrationGuide.odt
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/docs/ProgrammersGuide.odt
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/esb-config.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/install/standalone/jbossesb-server-base.zip
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/couriers/SqlTableCourier.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/AttachmentImpl.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPool.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/actions/Aggregator.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/actions/StaticWiretap.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/actions/StoreMessageToFile.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/client/MessageMulticaster.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployer.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionProcessorMethodInfo.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/message/Body.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/message/mapping/ObjectMapper.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/XMLMessageUnitTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/aggregator/aggregation_service/jbossesb.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration1/jboss-esb-unfiltered.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration1/readme.txt
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration1/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration1/esb_actions/ProcessInfo.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration1/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration1/process_actions/MyBPMActionHandler.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration1/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration1/test/SendTestMessage.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration2/jboss-esb.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration3/build.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration3/jboss-esb.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration3/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration3/esb_actions/SimpleJMSNotifier.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration3/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration3/test/SendJMSMessage.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration4/
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/business_rules_service/jboss-esb.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/samples/quickstart/businessrules/test/SendJMSMessage.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/conf/base-build.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/custom_action/jboss-esb.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/deadletter/jboss-esb.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/MyFailingAsyncAction.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/MyFailingSyncAction.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/test/SendJMSMessage.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/exceptions_faults/build.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/exceptions_faults/jboss-esb.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/fun_cbr/jboss-esb.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/fun_cbr/src/org/jboss/soa/esb/samples/quickstart/funcbr/test/SendJMSMessage.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/groovy_gateway/jboss-esb.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld/jboss-esb.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/SendEsbMessage.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_action/jboss-esb.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_action/src/org/jboss/soa/esb/samples/quickstart/helloworldaction/test/SendJMSMessage.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_file_action/jboss-esb-unfiltered.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_file_notifier/build.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_file_notifier/jboss-esb-unfiltered.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/jms_topic/build.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/jms_topic/jboss-esb.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/load_generator/jboss-esb.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/load_generator/scripts/JmsLoadAgent.groovy
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/messagefilter/jboss-esb.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/messagefilter/src/org/jboss/soa/esb/samples/quickstart/messagefilter/test/SendJMSMessage.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/messagestore/jboss-esb.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/scheduled_services/jboss-esb.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/scheduled_services/src/org/jboss/soa/esb/samples/quickstart/scheduler/MyScheduledActionMsgComposer.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/scheduled_services/src/org/jboss/soa/esb/samples/quickstart/scheduler/test/SendEsbMessage.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/scripting_groovy/jboss-esb.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/simple_cbr/jboss-esb.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/simple_cbr/src/org/jboss/soa/esb/samples/quickstart/simplecbr/test/SendJMSMessage.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/spring_aop/jboss-esb.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/spring_aop/src/org/jboss/soa/esb/samples/quickstart/spring_aop/MySpringEnabledAction.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/spring_aop/src/org/jboss/soa/esb/samples/quickstart/spring_aop/test/SendJMSMessage.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/spring_helloworld/jboss-esb.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/spring_helloworld/src/org/jboss/soa/esb/samples/quickstart/spring_helloworld/test/SendJMSMessage.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/spring_jpetstore/jboss-esb.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/spring_jpetstore/src/org/jboss/soa/esb/samples/quickstart/spring_jpetstore/test/SendJMSMessage.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/transform_CSV2XML/jboss-esb.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/transform_EDI2XML_Groovy_XSLT/jboss-esb.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/transform_XML2POJO/jboss-esb.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/transform_XML2POJO2/jboss-esb.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/transform_XML2XML_date_manipulation/jboss-esb.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/transform_XML2XML_simple/jboss-esb.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer1/build.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer1/jboss-esb.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer1/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer1/test/SendEsbMessage.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer2/build.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer2/jboss-esb.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer2/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer2/test/SendEsbMessage.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_mtom/jboss-esb.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_mtom/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/MTOMEndpointBean.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_producer/jboss-esb.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_producer/src/org/jboss/soa/esb/samples/quickstart/webserviceproducer/test/SendMessage.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/wiretap/jboss-esb.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/Constants.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actionhandlers/EsbActionHandler.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actions/BpmProcessor.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actionhandlers/EsbActionHandlerUnitTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actions/BpmProcessorUnitTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actions/JbpmTestUtil.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actions/testSingleCommands.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/client/DataCollector.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/client/Invoker.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/client/OperationsCollector.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/build.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/build.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/DynamicRouterTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/FunCBRTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldActionTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldDBRegistrationTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldFileActionTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldSQLActionTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/Helpers.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/RecipientlistTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/ScriptingGroovyTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SimpleCBRTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/StaticRouterTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformCSV2XMLTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformDateManipulationTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformEDI2XMLGroovyXSLTTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformXML2PojoTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformXMLSimpleTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebserviceAdapterTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebserviceBPELTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WiretapTest.java
Log:
Merged IR3
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/docs/AdministrationGuide.odt
===================================================================
(Binary files differ)
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/docs/ProgrammersGuide.odt
===================================================================
(Binary files differ)
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/esb-config.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/esb-config.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/esb-config.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -8,7 +8,6 @@
<property name="esb.ftp.location" location="${esb.config.location}/ftp"/>
<property name="esb.ftp.server.location" location="${esb.ftp.location}/build"/>
<property name="esb.ftp.server.name" value="ftp-server.sar"/>
- <property name="build.location" location="./build" /> <!-- The "build" dir in product or qa, depending on which is running. -->
<property name="agent.jvmarg" value=""/>
<property name="org.jboss.esb.server.config" value="default"/>
@@ -45,15 +44,16 @@
<macrodef name="start-server">
<attribute name="serverHome"/>
<attribute name="serverConfig"/>
+ <element name="serverElements" implicit="yes" optional="true"/>
<sequential>
<echo message="Starting local ESB server"/>
<java classname="org.jboss.Main" fork="true" spawn="true"
dir="@{serverHome}/bin">
<classpath refid="server.classpath"/>
<jvmarg line="${agent.jvmarg}"/>
- <sysproperty key="build.dir" value="${build.location}" />
<arg value="-c"/>
<arg value="@{serverConfig}"/>
+ <serverElements/>
</java>
</sequential>
</macrodef>
@@ -177,8 +177,12 @@
<copy todir="${esb.deploy-dir}/${esb.ftp.server.name}/res/conf"
file="${esb.config.location}/ftpd.properties" overwrite="true"/>
</target>
+
+ <!-- initialise the classpath for the server -->
+ <target name="esb.init-classpath">
+ </target>
- <target name="esb.init" depends="esb.init-app-server, esb.init-esb-server, esb.init-ftp-server"
+ <target name="esb.init" depends="esb.init-app-server, esb.init-esb-server, esb.init-ftp-server, esb.init-classpath"
description="target for initialising properties">
<path id="server.classpath">
<pathelement location="${java.home}/lib/tools.jar"/>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/install/standalone/jbossesb-server-base.zip
===================================================================
(Binary files differ)
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/couriers/SqlTableCourier.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/couriers/SqlTableCourier.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/couriers/SqlTableCourier.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -22,18 +22,6 @@
package org.jboss.internal.soa.esb.couriers;
-import java.io.Serializable;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.UUID;
-
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.sql.DataSource;
-
import org.apache.log4j.Logger;
import org.jboss.soa.esb.addressing.Call;
import org.jboss.soa.esb.addressing.MalformedEPRException;
@@ -48,547 +36,474 @@
import org.jboss.soa.esb.util.Util;
import org.xml.sax.SAXParseException;
-public class SqlTableCourier implements PickUpOnlyCourier, DeliverOnlyCourier
-{
- /**
- * disable default constructor
- */
- private SqlTableCourier()
- {
- }
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.sql.DataSource;
+import java.io.Serializable;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.UUID;
- /**
- * package protected constructor - Objects of Courier should only be
- * instantiated by the Factory
- *
- * @param epr
- */
- SqlTableCourier(JDBCEpr epr) throws CourierException
- {
- this(epr, false);
- }
+public class SqlTableCourier implements PickUpOnlyCourier, DeliverOnlyCourier {
+ /**
+ * disable default constructor
+ */
+ private SqlTableCourier() {
+ }
- /**
- * package protected constructor - Objects of Courier should only be
- * instantiated by the Factory
- *
- * @param epr
- */
- SqlTableCourier(JDBCEpr epr, boolean isReceiver) throws CourierException
- {
- _isReceiver = isReceiver;
- _epr = epr;
- _sleepForRetries = 3000; // TODO magic number - configurable?
- try
- {
- _postDelete = Boolean.TRUE.equals(Boolean.valueOf(epr
- .getPostDelete()));
- _errorDelete = Boolean.TRUE.equals(Boolean.valueOf(epr
- .getErrorDelete()));
- }
- catch (URISyntaxException e)
- {
- throw new CourierException(e);
- }
+ /**
+ * package protected constructor - Objects of Courier should only be
+ * instantiated by the Factory
+ *
+ * @param epr
+ */
+ SqlTableCourier(JDBCEpr epr) throws CourierException {
+ this(epr, false);
+ }
- } // ________________________________
+ /**
+ * package protected constructor - Objects of Courier should only be
+ * instantiated by the Factory
+ *
+ * @param epr
+ */
+ SqlTableCourier(JDBCEpr epr, boolean isReceiver) throws CourierException {
+ _isReceiver = isReceiver;
+ _epr = epr;
+ _sleepForRetries = 3000; // TODO magic number - configurable?
+ try {
+ _postDelete = Boolean.TRUE.equals(Boolean.valueOf(epr
+ .getPostDelete()));
+ _errorDelete = Boolean.TRUE.equals(Boolean.valueOf(epr
+ .getErrorDelete()));
+ }
+ catch (URISyntaxException e) {
+ throw new CourierException(e);
+ }
- public void cleanup()
- {
- if (null != _conn)
- {
- try
- {
- _conn.release();
- }
- catch (Exception e)
- {
- _logger.info("Unable to release connection");
+ } // ________________________________
+
+ public void cleanup() {
+ if (null != _conn) {
+ try {
+ _conn.release();
+ }
+ catch (Exception e) {
+ _logger.info("Unable to release connection");
_logger.debug("Unable to release connection", e);
- }
- }
+ }
+ }
- } // ________________________________
+ } // ________________________________
- /**
- * package the ESB message in a java.io.Serializable, and write it
- *
- * @param message
- * Message - the message to deliverAsync
- * @return boolean - the result of the delivery
- * @throws CourierException -
- * if problems were encountered
- */
- public boolean deliver(Message message) throws CourierException
- {
- if (_isReceiver)
- throw new CourierException("This is a read-only Courier");
+ /**
+ * package the ESB message in a java.io.Serializable, and write it
+ *
+ * @param message Message - the message to deliverAsync
+ * @return boolean - the result of the delivery
+ * @throws CourierException -
+ * if problems were encountered
+ */
+ public boolean deliver(Message message) throws CourierException {
+ if (_isReceiver)
+ throw new CourierException("This is a read-only Courier");
- if (null == message)
- return false;
+ if (null == message)
+ return false;
- String msgId = null;
- Call call = message.getHeader().getCall();
- if (null==call)
- message.getHeader().setCall(call=new Call());
- try
- {
- if (null==call.getMessageID())
- call.setMessageID(new URI(UUID.randomUUID().toString()));
- msgId = call.getMessageID().toString();
- }
- catch (URISyntaxException e)
- {
- throw new CourierException("Problems with message header ",e);
- }
+ String msgId = null;
+ Call call = message.getHeader().getCall();
+ if (null == call)
+ message.getHeader().setCall(call = new Call());
+ try {
+ if (null == call.getMessageID())
+ call.setMessageID(new URI(UUID.randomUUID().toString()));
+ msgId = call.getMessageID().toString();
+ }
+ catch (URISyntaxException e) {
+ throw new CourierException("Problems with message header ", e);
+ }
- if (null == _conn)
- {
- try
- {
- _conn = getConn();
- }
- catch (Exception e)
- {
- throw new CourierException(e);
- }
- }
+ if (null == _conn) {
+ try {
+ _conn = getConn();
+ }
+ catch (Exception e) {
+ throw new CourierException(e);
+ }
+ }
- while (_conn != null)
- {
- try
- {
- int iCol = 1;
- PreparedStatement PS = insertStatement();
- PS.setString(iCol++, msgId);
- PS.setObject(iCol++, Util.serialize(message));
- PS.setString(iCol++, State.Pending.getColumnValue());
- PS.setLong(iCol++, System.currentTimeMillis());
+ while (_conn != null) {
+ try {
+ int iCol = 1;
+ PreparedStatement PS = insertStatement();
+ PS.setString(iCol++, msgId);
+ PS.setObject(iCol++, Util.serialize(message));
+ PS.setString(iCol++, State.Pending.getColumnValue());
+ PS.setLong(iCol++, System.currentTimeMillis());
- _conn.execUpdWait(PS, 3);
- _conn.commit();
- return true;
- }
- catch (SQLException e)
- {
- if (null != _conn)
- {
- try
- {
- _conn.rollback();
- }
- catch (Exception roll)
- {
- _logger.debug(roll);
- }
- }
-
- _logger.debug("SQL exception during deliver", e);
- throw new CourierException(e);
- }
- catch (Exception e)
- {
- jdbcConnectRetry(e);
- }
- }
- return false;
- } // ________________________________
+ _conn.execUpdWait(PS, 3);
+ _conn.commit();
+ return true;
+ }
+ catch (SQLException e) {
+ if (null != _conn) {
+ try {
+ _conn.rollback();
+ }
+ catch (Exception roll) {
+ _logger.debug(roll);
+ }
+ }
- public Message pickup(long millis) throws CourierException, CourierTimeoutException
- {
- Message result = null;
- long limit = System.currentTimeMillis()
- + ((millis < 100) ? 100 : millis);
- do
- {
- try
- {
+ _logger.debug("SQL exception during deliver", e);
+ throw new CourierException(e);
+ }
+ catch (Exception e) {
+ jdbcConnectRetry(e);
+ }
+ }
+ return false;
+ } // ________________________________
+
+ public Message pickup(long millis) throws CourierException, CourierTimeoutException {
+ Message result = null;
+ long limit = System.currentTimeMillis()
+ + ((millis < 100) ? 100 : millis);
+ do {
+ try {
ResultSet RS = getRowList();
- while (null != RS && RS.next())
- {
- String messageId = RS.getString(1);
- if (null == (result = tryToPickup(messageId)))
- continue;
-
- /*
- * If this is fault message, then throw an exception with the contents. With the
- * exception of user-defined exceptions, faults will have nothing in the body, properties etc.
- */
-
- if (Type.isFaultMessage(result))
- Factory.createExceptionFromFault(result);
-
- return result;
- }
+ while (null != RS && RS.next()) {
+ String messageId = RS.getString(1);
+ if (null == (result = tryToPickup(messageId)))
+ continue;
+
+ /*
+ * If this is fault message, then throw an exception with the contents. With the
+ * exception of user-defined exceptions, faults will have nothing in the body, properties etc.
+ */
+
+ if (Type.isFaultMessage(result))
+ Factory.createExceptionFromFault(result);
+
+ return result;
+ }
}
- catch (SQLException e)
- {
- _logger.debug("SQL Exception during pickup", e);
- return null;
- }
- finally
- {
- // Added to make sure we release transactions from all paths
- if (_conn != null)
- {
- try
- {
- _conn.rollback() ;
- }
- catch (final SQLException sqle) {} //ignore
- }
- }
- try
- {
- long lSleep = limit - System.currentTimeMillis();
- if (_pollLatency < lSleep)
- lSleep = _pollLatency;
- if (lSleep > 0)
- Thread.sleep(lSleep);
- }
- catch (InterruptedException e)
- {
- return null;
- }
- } while (System.currentTimeMillis() <= limit);
- return null;
- } // ________________________________
+ catch (SQLException e) {
+ _logger.debug("SQL Exception during pickup", e);
+ return null;
+ }
+ finally {
+ // Added to make sure we release transactions from all paths
+ if (_conn != null) {
+ try {
+ _conn.rollback();
+ }
+ catch (final SQLException sqle) {
+ } //ignore
+ }
+ }
+ try {
+ long lSleep = limit - System.currentTimeMillis();
+ if (_pollLatency < lSleep)
+ lSleep = _pollLatency;
+ if (lSleep > 0)
+ Thread.sleep(lSleep);
+ }
+ catch (InterruptedException e) {
+ return null;
+ }
+ } while (System.currentTimeMillis() <= limit);
+ return null;
+ } // ________________________________
- private Message tryToPickup(String messageId) throws CourierException,
- SQLException
- {
- int iParm = 1;
+ private Message tryToPickup(String messageId) throws CourierException,
+ SQLException {
+ int iParm = 1;
- select4UpdateStatement().setString(iParm++, messageId);
- select4UpdateStatement().setString(iParm++,
- State.Pending.getColumnValue());
+ select4UpdateStatement().setString(iParm++, messageId);
+ select4UpdateStatement().setString(iParm++,
+ State.Pending.getColumnValue());
- while (_conn != null)
- {
- try
- {
- ResultSet RS = _conn.execQueryWait(select4UpdateStatement(), 3);
- while (RS.next())
- {
- Exception eBad = null;
- try
- {
- Message result = Util.deserialize((Serializable) RS
- .getObject(1));
- if (_postDelete)
- deleteMsg(messageId);
- else
- changeStatus(messageId, State.Done);
- return result;
- }
- catch (ClassCastException e)
- {
- eBad = e;
- }
- catch (SAXParseException e)
- {
- eBad = e;
- }
- catch (Exception e)
- {
- throw new CourierException(e);
- }
- if (null != eBad)
- {
- if (_errorDelete)
- deleteMsg(messageId);
- else
- changeStatus(messageId, State.Error);
- continue;
- }
- }
- return null;
- }
- catch (SQLException e)
- {
- throw new CourierException(e);
- }
- catch (Exception e)
- {
- jdbcConnectRetry(e);
- }
- }
- return null;
- } // ________________________________
+ while (_conn != null) {
+ try {
+ ResultSet RS = _conn.execQueryWait(select4UpdateStatement(), 3);
+ while (RS.next()) {
+ Exception eBad = null;
+ try {
+ Message result = Util.deserialize((Serializable) RS
+ .getObject(1));
+ if (_postDelete)
+ deleteMsg(messageId);
+ else
+ changeStatus(messageId, State.Done);
+ return result;
+ }
+ catch (ClassCastException e) {
+ eBad = e;
+ }
+ catch (SAXParseException e) {
+ eBad = e;
+ }
+ catch (Exception e) {
+ throw new CourierException(e);
+ }
+ if (null != eBad) {
+ if (_errorDelete)
+ deleteMsg(messageId);
+ else
+ changeStatus(messageId, State.Error);
+ continue;
+ }
+ }
+ return null;
+ }
+ catch (SQLException e) {
+ throw new CourierException(e);
+ }
+ catch (Exception e) {
+ jdbcConnectRetry(e);
+ }
+ }
+ return null;
+ } // ________________________________
- private void deleteMsg(String messageId) throws SQLException
- {
- int iParm = 1;
- deleteStatement().setString(iParm++, messageId);
- _conn.execUpdWait(deleteStatement(), 3);
- _conn.commit();
+ private void deleteMsg(String messageId) throws SQLException {
+ int iParm = 1;
+ deleteStatement().setString(iParm++, messageId);
+ _conn.execUpdWait(deleteStatement(), 3);
+ _conn.commit();
- }
+ }
- private void changeStatus(String messageId, State to) throws SQLException
- {
- int iParm = 1;
- updateStatusStatement().setString(iParm++, to.getColumnValue());
- updateStatusStatement().setString(iParm++, messageId);
- _conn.execUpdWait(updateStatusStatement(), 3);
- _conn.commit();
+ private void changeStatus(String messageId, State to) throws SQLException {
+ int iParm = 1;
+ updateStatusStatement().setString(iParm++, to.getColumnValue());
+ updateStatusStatement().setString(iParm++, messageId);
+ _conn.execUpdWait(updateStatusStatement(), 3);
+ _conn.commit();
- }
+ }
- private ResultSet getRowList() throws CourierException
- {
- if (null == _conn)
- {
- try
- {
- _conn = getConn();
- }
- catch (Exception e)
- {
- throw new CourierException(e);
- }
- }
- while (_conn != null)
- {
- try
- {
- return _conn.execQueryWait(listStatement(), 3);
- }
- catch (Exception e)
- {
- jdbcConnectRetry(e);
- }
- }
- return null;
+ private ResultSet getRowList() throws CourierException {
+ if (null == _conn) {
+ try {
+ _conn = getConn();
+ }
+ catch (Exception e) {
+ throw new CourierException(e);
+ }
+ }
+ while (_conn != null) {
+ try {
+ return _conn.execQueryWait(listStatement(), 3);
+ }
+ catch (Exception e) {
+ jdbcConnectRetry(e);
+ }
+ }
+ return null;
- } // _______________________________
+ } // _______________________________
- private void jdbcConnectRetry(Exception exc)
- {
- _logger.debug("DB problem, will try to reconnect", exc);
- if (null != _conn)
- _conn.release();
- _conn = null;
+ private void jdbcConnectRetry(Exception exc) {
+ _logger.debug("DB problem, will try to reconnect", exc);
+ if (null != _conn)
+ _conn.release();
+ _conn = null;
- _prepDelete = _prepGetList = _prepInsert = _prepSel4Upd = _prepUpdateStatus = null;
- for (int i1 = 0; i1 < 3; i1++)
- {
- try
- {
- _conn = getConn();
- }
- catch (Exception e)
- {
- try
- {
- Thread.sleep(_sleepForRetries);
- }
- catch (InterruptedException eInt)
- {
- return;
- }
- }
- }
- } // ________________________________
+ _prepDelete = _prepGetList = _prepInsert = _prepSel4Upd = _prepUpdateStatus = null;
+ for (int i1 = 0; i1 < 3; i1++) {
+ try {
+ _conn = getConn();
+ }
+ catch (Exception e) {
+ try {
+ Thread.sleep(_sleepForRetries);
+ }
+ catch (InterruptedException eInt) {
+ return;
+ }
+ }
+ }
+ } // ________________________________
- private JdbcCleanConn getConn() throws SQLException, MalformedEPRException
- {
- if (null == _conn)
- {
- try
- {
- DataSource DS = null;
- if (_epr.getDatasource() == null) {
- DS = new SimpleDataSource(_epr.getDriver(),
- _epr.getURL(), _epr.getUserName(), _epr.getPassword());
- } else {
- InitialContext initContext;
- try {
- initContext = new InitialContext();
- DS = (DataSource) initContext.lookup(_epr.getDatasource());
- } catch (NamingException e) {
- _logger.error("", e);
- }
- }
- _conn = new JdbcCleanConn(DS);
- }
- catch (URISyntaxException ex)
- {
- throw new MalformedEPRException(ex);
- }
- }
- return _conn;
- } // ________________________________
+ private JdbcCleanConn getConn() throws SQLException, MalformedEPRException {
+ if (null == _conn) {
+ try {
+ DataSource DS = null;
+ if (_epr.getDatasource() == null) {
+ DS = new SimpleDataSource(_epr.getDriver(),
+ _epr.getURL(), _epr.getUserName(), _epr.getPassword());
+ } else {
+ InitialContext initContext;
+ try {
+ initContext = new InitialContext();
+ DS = (DataSource) initContext.lookup(_epr.getDatasource());
+ } catch (NamingException e) {
+ _logger.error("", e);
+ }
+ }
+ _conn = new JdbcCleanConn(DS);
+ }
+ catch (URISyntaxException ex) {
+ throw new MalformedEPRException(ex);
+ }
+ }
+ return _conn;
+ } // ________________________________
- protected PreparedStatement listStatement()
- {
- if (null == _prepGetList)
+ protected PreparedStatement listStatement() {
+ if (null == _prepGetList)
- try
- {
- String[] columns =
- { _epr.getMessageIdColumn(), _epr.getTimestampColumn() };
+ try {
+ String[] columns =
+ {_epr.getMessageIdColumn(), _epr.getTimestampColumn()};
- StringBuilder sb = new StringBuilder("select");
- int i1 = 0;
- for (String col : columns)
- sb.append((i1++ < 1) ? " " : ",").append(col);
- sb.append(" from ").append(_epr.getTableName());
- sb.append(" where ").append(_epr.getStatusColumn())
- .append("='").append(State.Pending.getColumnValue())
- .append("'").append(" order by 2");
- _prepGetList = getConn().prepareStatement(sb.toString());
- }
- catch (Exception e)
- {
- _logger.debug("Unable to prepare SQL statement", e);
- return null;
- }
- return _prepGetList;
- } // ________________________________
+ StringBuilder sb = new StringBuilder("select");
+ int i1 = 0;
+ for (String col : columns)
+ sb.append((i1++ < 1) ? " " : ",").append(col);
+ sb.append(" from ").append(_epr.getTableName());
+ sb.append(" where ").append(_epr.getStatusColumn())
+ .append("='").append(State.Pending.getColumnValue())
+ .append("'").append(" order by 2");
+ _prepGetList = getConn().prepareStatement(sb.toString());
+ }
+ catch (Exception e) {
+ _logger.debug("Unable to prepare SQL statement", e);
+ return null;
+ }
+ return _prepGetList;
+ } // ________________________________
- protected PreparedStatement select4UpdateStatement()
- {
- if (_prepSel4Upd == null)
- {
- try
- {
- /*
- * TODO make this dynamic using a factory pattern.
- */
+ protected PreparedStatement select4UpdateStatement() {
+ if (_prepSel4Upd == null) {
+ try {
+ /*
+ * TODO make this dynamic using a factory pattern.
+ */
- StringBuilder sb = null;
+ StringBuilder sb = null;
- if (!_epr.getURL().contains("hsqldb"))
- {
- sb = new StringBuilder("select ").append(
- _epr.getDataColumn()).append(" from ").append(
- _epr.getTableName()).append(" where ").append(
- _epr.getMessageIdColumn()).append("=?").append(
- " and ").append(_epr.getStatusColumn())
- .append("=?").append(" for update");
- }
- else
- {
- /*
- * HSQL does not support FOR UPDATE! All tables appear to
- * be inherently updatable!
- */
-
- sb = new StringBuilder("select ").append(
- _epr.getDataColumn()).append(" from ").append(
- _epr.getTableName()).append(" where ").append(
- _epr.getMessageIdColumn()).append("=?").append(
- " and ").append(_epr.getStatusColumn())
- .append("=?");
- }
+ if (!_epr.getURL().contains("hsqldb")) {
+ sb = new StringBuilder("select ").append(
+ _epr.getDataColumn()).append(" from ").append(
+ _epr.getTableName()).append(" where ").append(
+ _epr.getMessageIdColumn()).append("=?").append(
+ " and ").append(_epr.getStatusColumn())
+ .append("=?").append(" for update");
+ } else {
+ /*
+ * HSQL does not support FOR UPDATE! All tables appear to
+ * be inherently updatable!
+ */
- _prepSel4Upd = getConn().prepareStatement(sb.toString());
- }
- catch (Exception e)
- {
- _logger.debug(e);
- return null;
- }
- }
+ sb = new StringBuilder("select ").append(
+ _epr.getDataColumn()).append(" from ").append(
+ _epr.getTableName()).append(" where ").append(
+ _epr.getMessageIdColumn()).append("=?").append(
+ " and ").append(_epr.getStatusColumn())
+ .append("=?");
+ }
- return _prepSel4Upd;
- } // ________________________________
+ _prepSel4Upd = getConn().prepareStatement(sb.toString());
+ }
+ catch (Exception e) {
+ _logger.debug(e);
+ return null;
+ }
+ }
- protected PreparedStatement updateStatusStatement()
- {
- if (null == _prepUpdateStatus)
- try
- {
- StringBuilder sb = new StringBuilder("update ").append(
- _epr.getTableName()).append(" set ").append(
- _epr.getStatusColumn()).append("= ?").append(" where ")
- .append(_epr.getMessageIdColumn()).append("=?");
- _prepUpdateStatus = getConn().prepareStatement(sb.toString());
- }
- catch (Exception e)
- {
- _logger.debug(e);
- return null;
- }
- return _prepUpdateStatus;
- } // ________________________________
+ return _prepSel4Upd;
+ } // ________________________________
- protected PreparedStatement insertStatement()
- {
- if (null == _prepInsert)
- try
- {
- String[] columns =
- { _epr.getMessageIdColumn(), _epr.getDataColumn(),
- _epr.getStatusColumn(), _epr.getTimestampColumn() };
+ protected PreparedStatement updateStatusStatement() {
+ if (null == _prepUpdateStatus)
+ try {
+ StringBuilder sb = new StringBuilder("update ").append(
+ _epr.getTableName()).append(" set ").append(
+ _epr.getStatusColumn()).append("= ?").append(" where ")
+ .append(_epr.getMessageIdColumn()).append("=?");
+ _prepUpdateStatus = getConn().prepareStatement(sb.toString());
+ }
+ catch (Exception e) {
+ _logger.debug(e);
+ return null;
+ }
+ return _prepUpdateStatus;
+ } // ________________________________
- StringBuilder sb = new StringBuilder("insert into ").append(
- _epr.getTableName()).append("(");
- int i1 = 0;
- for (String col : columns)
- sb.append((i1++ < 1) ? " " : ",").append(col);
- sb.append(") values (?,?,?,?)");
- _prepInsert = getConn().prepareStatement(sb.toString());
- }
- catch (Exception e)
- {
- _logger.debug(e);
- return null;
- }
- return _prepInsert;
- } // ________________________________
+ protected PreparedStatement insertStatement() {
+ if (null == _prepInsert)
+ try {
+ String[] columns =
+ {_epr.getMessageIdColumn(), _epr.getDataColumn(),
+ _epr.getStatusColumn(), _epr.getTimestampColumn()};
- protected PreparedStatement deleteStatement()
- {
- if (null == _prepDelete)
- try
- {
- StringBuilder sb = new StringBuilder("delete from ").append(
- _epr.getTableName()).append(" where ").append(
- _epr.getMessageIdColumn()).append(" =?");
- _prepDelete = getConn().prepareStatement(sb.toString());
- }
- catch (Exception e)
- {
- _logger.debug(e);
- return null;
- }
- return _prepDelete;
- } // ________________________________
+ StringBuilder sb = new StringBuilder("insert into ").append(
+ _epr.getTableName()).append("(");
+ int i1 = 0;
+ for (String col : columns)
+ sb.append((i1++ < 1) ? " " : ",").append(col);
+ sb.append(") values (?,?,?,?)");
+ _prepInsert = getConn().prepareStatement(sb.toString());
+ }
+ catch (Exception e) {
+ _logger.debug(e);
+ return null;
+ }
+ return _prepInsert;
+ } // ________________________________
- protected enum State
- {
- Pending, WorkInProgress, Done, Error;
- String getColumnValue()
- {
- return toString().substring(0, 1);
- }
- }
+ protected PreparedStatement deleteStatement() {
+ if (null == _prepDelete)
+ try {
+ StringBuilder sb = new StringBuilder("delete from ").append(
+ _epr.getTableName()).append(" where ").append(
+ _epr.getMessageIdColumn()).append(" =?");
+ _prepDelete = getConn().prepareStatement(sb.toString());
+ }
+ catch (Exception e) {
+ _logger.debug(e);
+ return null;
+ }
+ return _prepDelete;
+ } // ________________________________
- public void setPollLatency(Long millis)
- {
- if (millis <= 200)
- _logger.warn("Poll latency must be >= 200 milliseconds - Keeping old value of "+_pollLatency);
- else
- _pollLatency = millis;
- } // ________________________________
-
- protected long _pollLatency = 200;
- protected long _sleepForRetries = 3000; // milliseconds
+ protected enum State {
+ Pending, WorkInProgress, Done, Error;
- protected boolean _postDelete, _errorDelete;
- protected boolean _isReceiver;
+ String getColumnValue() {
+ return toString().substring(0, 1);
+ }
+ }
- protected JDBCEpr _epr;
+ public void setPollLatency(Long millis) {
+ if (millis <= 200)
+ _logger.warn("Poll latency must be >= 200 milliseconds - Keeping old value of " + _pollLatency);
+ else
+ _pollLatency = millis;
+ } // ________________________________
- protected JdbcCleanConn _conn;
+ protected long _pollLatency = 200;
+ protected long _sleepForRetries = 3000; // milliseconds
- protected PreparedStatement _prepGetList;
- protected PreparedStatement _prepSel4Upd;
- protected PreparedStatement _prepUpdateStatus;
- protected PreparedStatement _prepInsert;
- protected PreparedStatement _prepDelete;
+ protected boolean _postDelete, _errorDelete;
+ protected boolean _isReceiver;
- protected static Logger _logger = Logger.getLogger(SqlTableCourier.class);
+ protected JDBCEpr _epr;
+
+ protected JdbcCleanConn _conn;
+
+ protected PreparedStatement _prepGetList;
+ protected PreparedStatement _prepSel4Upd;
+ protected PreparedStatement _prepUpdateStatus;
+ protected PreparedStatement _prepInsert;
+ protected PreparedStatement _prepDelete;
+
+ protected static Logger _logger = Logger.getLogger(SqlTableCourier.class);
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/AttachmentImpl.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/AttachmentImpl.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/AttachmentImpl.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -60,12 +60,11 @@
public Object put(String name, Object value)
{
- if (value instanceof Serializable)
- return _table.put(name, (Serializable) value);
- throw new IllegalArgumentException("value must be Serializable");
- }
+ assertValidAttachment(value);
+ return _table.put(name, (Serializable) value);
+ }
- public Object remove(String name)
+ public Object remove(String name)
{
return _table.remove(name);
}
@@ -88,26 +87,21 @@
public Object replaceItemAt(int index, Object value)
throws IndexOutOfBoundsException
{
- if (value instanceof Serializable)
- return _list.set(index, (Serializable) value);
- throw new IllegalArgumentException("value must be Serializable");
+ assertValidAttachment(value);
+ return _list.set(index, (Serializable) value);
}
public void addItem(Object value)
{
- if (value instanceof Serializable)
- _list.add((Serializable) value);
- else
- throw new IllegalArgumentException("value must be Serializable");
+ assertValidAttachment(value);
+ _list.add((Serializable) value);
}
public void addItemAt(int index, Object value)
throws IndexOutOfBoundsException
{
- if (value instanceof Serializable)
- _list.add(index, (Serializable) value);
- else
- throw new IllegalArgumentException("value must be Serializable");
+ assertValidAttachment(value);
+ _list.add(index, (Serializable) value);
}
public int getNamedCount()
@@ -294,6 +288,14 @@
return true;
}
+ private void assertValidAttachment(Object attachment) {
+ if(attachment == null) {
+ throw new IllegalArgumentException("Cannot set null object as a message attachment. Attachment objects must be non-null and Serializable.");
+ } else if(!(attachment instanceof Serializable)) {
+ throw new IllegalArgumentException("Cannot set an Object of type '" + attachment.getClass().getName() + "' as a message attachment. Attachment objects must be Serializable.");
+ }
+ }
+
ArrayList<Serializable> _list = new ArrayList<Serializable>();
Hashtable<String, Serializable> _table = new Hashtable<String, Serializable>();
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPool.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPool.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPool.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -175,13 +175,12 @@
*/
public synchronized Session getSession(final int acknowledgeMode) throws NamingException, JMSException, ConnectionException
{
- Session session = null;
- int waitInSeconds = 0;
- while (session == null) {
+ final long end = System.currentTimeMillis() + (SLEEP_TIME * 1000) ;
+ boolean emitExpiry = logger.isDebugEnabled() ;
+ for(;;) {
ArrayList<Session> freeSessions = freeSessionsMap.get( acknowledgeMode );
ArrayList<Session> inUseSessions = inUseSessionsMap.get(acknowledgeMode);
-
if (freeSessions.size() > 0)
{
if (logger.isDebugEnabled()) {
@@ -189,28 +188,34 @@
+ ", maxsize=" + MAX_SESSIONS
+ ", number of pools=" + JmsConnectionPoolContainer.getNumberOfPools());
}
- session = freeSessions.remove(freeSessions.size()-1);
+ final Session session = freeSessions.remove(freeSessions.size()-1);
inUseSessions.add(session);
+ return session ;
+ } else if (inUseSessions.size()<MAX_SESSIONS) {
+ addAnotherSession(poolKey,acknowledgeMode);
+ continue ;
} else {
- if (waitInSeconds++ > SLEEP_TIME) {
-// We'll give up after not be able to get a session for SLEEP_TIME seconds.
+ if (emitExpiry)
+ {
+ logger.debug("The connection pool was exhausted, waiting for a session to be released.") ;
+ emitExpiry = false ;
+ }
+ final long now = System.currentTimeMillis() ;
+ final long delay = (end - now) ;
+ if (delay <= 0)
+ {
throw new ConnectionException("Could not obtain a JMS connection from the pool after "+SLEEP_TIME+"s.");
}
- //Add a connection if we can
- if (inUseSessions.size()<MAX_SESSIONS) {
- addAnotherSession(poolKey,acknowledgeMode);
- } else {
- try {
- //wait one second and try again.
- logger.info("The connection pool was exhausted. Waiting 1 second before trying again..");
- wait(1000); // TODO magic number!
- } catch (Exception e) {
- e.printStackTrace();
+ else
+ {
+ try
+ {
+ wait(delay) ;
}
+ catch (final InterruptedException ie) {} // ignore
}
}
}
- return session;
}
/**
* This method can be called whenever a Queue Session is needed from the pool.
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/actions/AggregationDetails.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/rosetta/src/org/jboss/soa/esb/actions/AggregationDetails.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/actions/AggregationDetails.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/actions/AggregationDetails.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,157 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.actions;
+
+import org.jboss.internal.soa.esb.assertion.AssertArgument;
+import org.jboss.soa.esb.listeners.message.MessageDeliverException;
+
+/**
+ * Aggregation Details.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class AggregationDetails {
+
+ private String seriesUuid;
+ private int messageNumber = -1;
+ private int seriesSize = -1;
+ private long seriesTimestamp = -1;
+ private String splitId;
+
+ public AggregationDetails(String seriesUuid, int messageNumber, int seriesSize, long seriesTimestamp) {
+ AssertArgument.isNotNullAndNotEmpty(seriesUuid, "seriesUuid");
+ if(messageNumber < 1) {
+ throw new IllegalArgumentException("Invalid AggregatorDetails. messageNumber < 1");
+ }
+ if(seriesSize < messageNumber) {
+ throw new IllegalArgumentException("Invalid AggregatorDetails. seriesSize < messageNumber");
+ }
+ if(seriesTimestamp < 1) {
+ throw new IllegalArgumentException("Invalid AggregatorDetails. timestamp < 1");
+ }
+
+ this.seriesUuid = seriesUuid;
+ this.messageNumber = messageNumber;
+ this.seriesSize = seriesSize;
+ this.seriesTimestamp = seriesTimestamp;
+ }
+
+ public AggregationDetails(String aggregatorTag) {
+ AssertArgument.isNotNullAndNotEmpty(aggregatorTag, "aggregatorTag");
+ String[] tokens = aggregatorTag.split(":");
+
+ if(tokens.length < 4) {
+ throw new IllegalArgumentException("Invalid Aggregator Tag. Must have 4 tokens (colon separated).");
+ }
+
+ this.seriesUuid = tokens[0];
+ if(this.seriesUuid == null || this.seriesUuid.trim().equals("")) {
+ throw new IllegalArgumentException("Invalid Aggregator Tag: seriesUuid is blank.");
+ }
+ try {
+ this.messageNumber = Integer.parseInt(tokens[1]);
+ if(messageNumber < 1) {
+ throw new IllegalArgumentException("Invalid Aggregator Tag. messageNumber < 1");
+ }
+ this.seriesSize = Integer.parseInt(tokens[2]);
+ if(seriesSize < messageNumber) {
+ throw new IllegalArgumentException("Invalid Aggregator Tag. seriesSize < messageNumber");
+ }
+ this.seriesTimestamp = Long.parseLong(tokens[3]);
+ if(seriesTimestamp < 1) {
+ throw new IllegalArgumentException("Invalid Aggregator Tag. timestamp < 1");
+ }
+ if(tokens.length == 5) {
+ splitId = tokens[4];
+ }
+ } catch(NumberFormatException e) {
+ if(this.messageNumber == -1) {
+ throw new IllegalArgumentException("Invalid Aggregator Tag. 'messageNumber' must be an int.");
+ } else if(this.seriesSize == -1) {
+ throw new IllegalArgumentException("Invalid Aggregator Tag. 'seriesSize' must be an int.");
+ } else if(this.seriesTimestamp == -1) {
+ throw new IllegalArgumentException("Invalid Aggregator Tag. 'timestamp' must be an long.");
+ }
+ }
+ }
+
+ public String getSeriesUuid() {
+ return seriesUuid;
+ }
+
+ public int getSeriesSize() {
+ return seriesSize;
+ }
+
+ public int getMessageNumber() {
+ return messageNumber;
+ }
+
+ public long getSeriesTimestamp() {
+ return seriesTimestamp;
+ }
+
+ public String getSplitId() {
+ return splitId;
+ }
+
+ public void setSplitId(String splitId) {
+ this.splitId = splitId;
+ }
+
+ public boolean equals(Object obj) {
+ if (!(obj instanceof AggregationDetails)) {
+ // also covers null
+ return false;
+ } else if (obj == this) {
+ return true;
+ } else {
+ return toString().equals(obj.toString());
+ }
+ }
+
+ public int hashCode() {
+ return toString().hashCode();
+ }
+
+ public String toString() {
+ assertDetailsSet();
+ if(splitId == null) {
+ return seriesUuid + ":" + messageNumber + ":" + seriesSize + ":" + seriesTimestamp;
+ } else {
+ return seriesUuid + ":" + messageNumber + ":" + seriesSize + ":" + seriesTimestamp + ":" + splitId;
+ }
+ }
+
+ private void assertDetailsSet() {
+ if(seriesUuid == null || seriesUuid.trim().equals("")) {
+ throw new IllegalStateException("AggregationDetails not set: 'seriesUuid' is null or empty.");
+ }
+ if(messageNumber == -1) {
+ throw new IllegalStateException("AggregationDetails not set: 'messageNumber' is not set.");
+ }
+ if(seriesSize == -1) {
+ throw new IllegalStateException("AggregationDetails not set: 'seriesSize' is not set.");
+ }
+ if(seriesTimestamp == -1) {
+ throw new IllegalStateException("AggregationDetails not set: 'timestamp' is not set.");
+ }
+ }
+}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/actions/Aggregator.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/actions/Aggregator.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/actions/Aggregator.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -27,32 +27,28 @@
*/
package org.jboss.soa.esb.actions;
-import java.text.DateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.locks.Condition;
-import java.util.concurrent.locks.Lock;
-import java.util.concurrent.locks.ReentrantLock;
-
import org.apache.log4j.Logger;
import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.Service;
-import org.jboss.soa.esb.addressing.EPR;
import org.jboss.soa.esb.client.ServiceInvoker;
-import org.jboss.soa.esb.couriers.Courier;
-import org.jboss.soa.esb.couriers.CourierFactory;
-import org.jboss.soa.esb.couriers.CourierUtil;
+import static org.jboss.soa.esb.client.ServiceInvoker.DEAD_LETTER_SERVICE_NAME;
+import static org.jboss.soa.esb.client.ServiceInvoker.INTERNAL_SERVICE_CATEGORY;
import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.ListenerTagNames;
import org.jboss.soa.esb.listeners.message.MessageDeliverException;
import org.jboss.soa.esb.message.Message;
import org.jboss.soa.esb.message.format.MessageFactory;
-import org.jboss.soa.esb.services.registry.Registry;
import org.jboss.soa.esb.services.registry.RegistryException;
-import org.jboss.soa.esb.services.registry.RegistryFactory;
+import org.jboss.soa.esb.util.Util;
+import javax.xml.parsers.ParserConfigurationException;
+import java.io.IOException;
+import java.text.DateFormat;
+import java.util.*;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.locks.Condition;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
+
/**
* Simple Aggregator. The aggregator relies on 'aggregatorTags'. To puzzle the individual
* back together. The aggregatorTag is set in the MessageRouter.deliverAsync() method. The aggregator
@@ -73,26 +69,24 @@
public final static String AGGEGRATOR_TAG = "aggregatorTag";
public final static String SPLITTER_TIME_STAMP = "splitterTimeStamp";
- private ConcurrentHashMap<String,ConcurrentHashMap< String, Message > > _aggregatedMessageMap
- = new ConcurrentHashMap< String, ConcurrentHashMap< String, Message > >();
+ private Map<String, Map< Integer, Message > > aggregatedMessageMap
+ = new ConcurrentHashMap< String, Map< Integer, Message > >();
private TimeoutChecker _timeoutChecker=null;
- private ArrayList<String> _notified = new ArrayList<String>();
protected ConfigTree config;
private Logger logger = Logger.getLogger(Aggregator.class);
private Long timeoutInMillies=null;
- private String serviceName;
- private String serviceCategoryName;
- private Registry registry;
-
- private Aggregator(){}
+ private Set<String> receivedSplits = new HashSet<String>();
+ private String splitId;
+ private Aggregator(){}
+
public Aggregator(ConfigTree config) throws ConfigurationException, RegistryException
- {
-
+ {
this.config = config;
- checkMyParms();
- registry = RegistryFactory.getRegistry();
+ timeoutInMillies = Long.valueOf(config.getRequiredAttribute("timeoutInMillies"));
+ logger.debug("Aggregator config: timeoutInMillies=" + timeoutInMillies);
+ splitId = config.getAttribute("splitId");
}
/**
@@ -110,13 +104,17 @@
_timeoutChecker.start();
}
- /**
- * Destroy the action instance.
- * <p/>
- * This method is called prior to the release of the action instance. All
- * resources associated with this action instance should be released as the
- * instance will no longer be used.
- */
+ public Map<String, Map<Integer, Message>> getAggregatedMessageMap() {
+ return aggregatedMessageMap;
+ }
+
+ /**
+ * Destroy the action instance.
+ * <p/>
+ * This method is called prior to the release of the action instance. All
+ * resources associated with this action instance should be released as the
+ * instance will no longer be used.
+ */
public void destroy()
throws ActionLifecycleException
{
@@ -137,82 +135,135 @@
@SuppressWarnings("unchecked")
public Message process(Message message) throws ActionProcessingException
{
- ArrayList<String> aggregatorTags = (ArrayList<String>) message.getProperties().getProperty(Aggregator.AGGEGRATOR_TAG);
-
- if (aggregatorTags!=null && aggregatorTags.size()>0) {
- String aggregatorTag = (String) aggregatorTags.get(aggregatorTags.size()-1);
- //Removing the last tags and setting them as "the one in current use"
- if (aggregatorTags.size()>1) {
- aggregatorTags.remove(aggregatorTags.size()-1);
- message.getProperties().setProperty(Aggregator.AGGEGRATOR_TAG, aggregatorTags);
- } else {
- message.getProperties().remove(Aggregator.AGGEGRATOR_TAG);
- }
- String[] tag = aggregatorTag.split(":");
- String uuId = tag[0];
- String messageNumber = tag[1];
- int totalNumberOfMessages = Integer.valueOf(tag[2]).intValue();
- Long splitterTimeStamp = Long.valueOf(tag[3]);
- message.getProperties().setProperty(SPLITTER_TIME_STAMP, splitterTimeStamp);
+ List<String> aggregatorTags = getAggregatorTags(message);
- if (isTimedOut(message)) {
- if (_aggregatedMessageMap.containsKey(uuId)) {
- ConcurrentHashMap<String, Message> messageMap = _aggregatedMessageMap.get(uuId);
+ if (aggregatorTags != null && aggregatorTags.size() > 0) {
+ String aggregatorTag = aggregatorTags.get(aggregatorTags.size()-1);
+ AggregationDetails aggrDetails = new AggregationDetails(aggregatorTag);
+
+ assertAggregationDetailsOK(aggrDetails);
+
+ // Set the timestamp on the message... used by the TimeoutChecker...
+ message.getProperties().setProperty(SPLITTER_TIME_STAMP, aggrDetails.getSeriesTimestamp());
+
+ Map<Integer, Message> messageMap = aggregatedMessageMap.get(aggrDetails.getSeriesUuid());
+ if (isTimedOut(aggrDetails.getSeriesTimestamp())) {
+ if (messageMap != null) {
//add the message in if we don't already have it
- if (!messageMap.containsKey(uuId)) {
- messageMap.put(messageNumber, message);
+ if (!messageMap.containsKey(aggrDetails.getMessageNumber())) {
+ messageMap.put(aggrDetails.getMessageNumber(), message);
}
//Just going to send out what we have this far, which will remove this key
//so subsequent messages with this uuId will be ignored
- message = createAggregateMessage(uuId, _aggregatedMessageMap.get(uuId));
+ message = createAggregateMessage(aggrDetails.getSeriesUuid(), messageMap);
} else {
logger.debug("Ignoring this message since we are already timedout on this message.");
//ignoring this message
message = null;
}
} else {
- ConcurrentHashMap<String, Message> messageMap=null;
//Get the messageMap with this uuId, or create it if not found
- if (_aggregatedMessageMap.containsKey(uuId)) {
- messageMap = _aggregatedMessageMap.get(uuId);
- } else {
- messageMap = new ConcurrentHashMap<String, Message>();
+ if (messageMap == null) {
+ messageMap = new ConcurrentHashMap<Integer, Message>();
+ aggregatedMessageMap.put(aggrDetails.getSeriesUuid(), messageMap);
}
- if (messageMap.containsKey(messageNumber)) {
+ if (messageMap.containsKey(aggrDetails.getMessageNumber())) {
logger.warn("Received duplicate message, ignoring it but this should not happen.");
} else {
- messageMap.put(messageNumber, message);
- _aggregatedMessageMap.put(uuId, messageMap);
- }
- if (messageMap.size()==totalNumberOfMessages) {
- message = createAggregateMessage(uuId, messageMap);
+ messageMap.put(aggrDetails.getMessageNumber(), message);
+ }
+ if (messageMap.size() == aggrDetails.getSeriesSize()) {
+ message = createAggregateMessage(aggrDetails.getSeriesUuid(), messageMap);
} else {
message = null;
}
}
} else {
- throw new ActionProcessingException("Could not find an aggregator tag, so this message can not be aggregated.");
+ // Just aggregate the single message...
+ message = createAggregateMessage(message);
}
- return message;
+
+ return message;
}
- /**
- * Obtains the timeoutInMillies to a number
- *
- * @throws ConfigurationException
- */
- private void checkMyParms() throws ConfigurationException
- {
- timeoutInMillies = Long.valueOf(config.getAttribute("timeoutInMillies"));
- logger.debug("Aggregator config: timeoutInMillies=" + timeoutInMillies);
- serviceName = config.getAttribute(ListenerTagNames.SERVICE_NAME_TAG);
- serviceCategoryName = config.getAttribute(ListenerTagNames.SERVICE_CATEGORY_NAME_TAG);
+
+ private void assertAggregationDetailsOK(AggregationDetails aggrDetails) throws ActionProcessingException {
+ if(splitId != null) {
+ if(!splitId.equals(aggrDetails.getSplitId())) {
+ throw new ActionProcessingException("Invalid aggregation config on aggregator '" + config.getAttribute("action") + "' . " +
+ "This aggregator is configured " +
+ "to only aggregate message with an aggregation 'spliId' of '" + splitId + "'. " +
+ "The splitId on the received message is '" + aggrDetails.getSplitId() + "'. " +
+ "A nested aggregation point may be missing, or may have been bypassed.");
+ }
+ } else {
+ // log a warning if this aggregator starts receiving messages with
+ // different splitIds. This would suggest an error in the nested split configuration.
+ if(!receivedSplits.contains(aggrDetails.getSplitId())) {
+ receivedSplits.add(aggrDetails.getSplitId());
+ }
+
+ if(receivedSplits.size() > 1) {
+ logger.warn("Aggregator action '" + config.getAttribute("action") + "' has received " +
+ "split messages from more multiple 'splitId' sources: " + receivedSplits + "\n" +
+ "You may need to configure an intermediate/nested aggregator at " +
+ "some point in the message flow.");
+ }
+
+ }
}
+ public static List<String> getAggregatorTags(Message message) {
+ return (List<String>) message.getProperties().getProperty(Aggregator.AGGEGRATOR_TAG);
+ }
+
+ public static void setAggregatorTags(Message message, List<String> tags) {
+ if(tags != null) {
+ message.getProperties().setProperty(Aggregator.AGGEGRATOR_TAG, tags);
+ } else {
+ message.getProperties().remove(Aggregator.AGGEGRATOR_TAG);
+ }
+ }
+
+ public static AggregationDetails getAggregatorDetails(Message message, int tagIndex) throws ActionProcessingException {
+ List<String> tags = getAggregatorTags(message);
+
+ if(tags == null || tags.isEmpty()) {
+ return null;
+ } else {
+ return new AggregationDetails(tags.get(tagIndex));
+ }
+ }
+
public static void decorate(Message message) {
}
/**
+ * Aggregates a single message into an aggregated message.
+ * <p/>
+ * This method is called for messages that are recived without aggregation tags.
+ *
+ * @param message
+ * @return the aggregated message
+ */
+ @SuppressWarnings("unchecked")
+ public Message createAggregateMessage(Message message) throws ActionProcessingException {
+ // Create an aggregated message
+ Message aggregatedMessage = MessageFactory.getInstance().getMessage();
+
+ setAggregatorTags(message, null);
+ try {
+ aggregatedMessage.getAttachment().addItem(Util.serialize(message));
+ } catch (ParserConfigurationException e) {
+ throw new ActionProcessingException("Message attachment serialization failure", e);
+ } catch (IOException e) {
+ throw new ActionProcessingException("Message attachment serialization failure", e);
+ }
+
+ return aggregatedMessage;
+ }
+
+ /**
* Aggregates the messages into 1 new message with an attachment for each message.
*
* @param uuId
@@ -220,45 +271,65 @@
* @return the aggregated message
*/
@SuppressWarnings("unchecked")
- private Message createAggregateMessage(String uuId, ConcurrentHashMap<String, Message> messageMap)
- {
- //Create an aggregated message
+ public Message createAggregateMessage(String uuId, Map<Integer, Message> messageMap) throws ActionProcessingException {
+ // Create an aggregated message
Message aggregatedMessage = MessageFactory.getInstance().getMessage();
- boolean isFirstTime=true;
- for (Message message : messageMap.values()) {
- //Push additional AggregatorTags onto the new message, so we can aggregate in case of nested splits.
- //Only need to get it from the first message, should be the same for the others.
- if (isFirstTime) {
- ArrayList<String> aggregatorTags = (ArrayList<String>) message.getProperties().getProperty(Aggregator.AGGEGRATOR_TAG);
- if (aggregatorTags!=null && aggregatorTags.size()>0) {
- aggregatedMessage.getProperties().setProperty(Aggregator.AGGEGRATOR_TAG, aggregatorTags);
- }
- isFirstTime=false;
+
+ //Push additional AggregatorTags onto the new message, so we can aggregate in case of nested splits.
+ //Only need to get it from the first message, should be the same for the others.
+ List<String> aggregatedMessageTags = copyAggregationTags(messageMap);
+ setAggregatorTags(aggregatedMessage, aggregatedMessageTags);
+
+ for (Message attachmentMessage : messageMap.values()) {
+ //Add the individual messages as attachments
+ try {
+ // Clear the aggregation tags from the attachment message. Any future aggregation
+ // on the payload of these messages should be done within the context of the
+ // outer/aggregated message and it's tags.
+ setAggregatorTags(attachmentMessage, null);
+ aggregatedMessage.getAttachment().addItem(Util.serialize(attachmentMessage));
+ } catch (ParserConfigurationException e) {
+ throw new ActionProcessingException("Message attachment serialization failure", e);
+ } catch (IOException e) {
+ throw new ActionProcessingException("Message attachment serialization failure", e);
}
- //Add the individual messages as attachments
- aggregatedMessage.getAttachment().addItem(message);
}
- _aggregatedMessageMap.remove(uuId);
+ aggregatedMessageMap.remove(uuId);
//TODO remove messageMap from permanent storage, or do that per message in the loop above using value of the aggregatorTag
//remove from the notificationMap if it is in there.
- _notified.remove(uuId);
return aggregatedMessage;
}
+
+ private List<String> copyAggregationTags(Map<Integer, Message> messageMap) {
+ // Get the tags from the first message...
+ List<String> nestedAggregationTags = getAggregatorTags(messageMap.values().iterator().next());
+
+ if(nestedAggregationTags != null && nestedAggregationTags.size() > 1) {
+ // clone the tags, just incase they get zapped from the source list...
+ List<String> aggregatedMessageTags = new ArrayList<String>();
+
+ aggregatedMessageTags.addAll(nestedAggregationTags);
+ // remove the last one because that's related to the nested aggregation...
+ aggregatedMessageTags.remove(aggregatedMessageTags.size() - 1);
+
+ return aggregatedMessageTags;
+ }
+
+ return null;
+ }
+
/**
* If the aggregation process is complete then return true. This depends on the configuration.
*
- * @param totalNumberOfMessages
- * @param splitterTimeStamp
- * @param messageMap
- * @return
+ * @param splitterTimeStamp The splitter timestamp.
+ * @return True if the message is timed out, otherwise false.
*/
- private boolean isTimedOut(Message message)
+ private boolean isTimedOut(long splitterTimeStamp)
{
- long splitterTimeStamp = (Long) message.getProperties().getProperty(SPLITTER_TIME_STAMP);
if (timeoutInMillies!=null) {
long now = new Date().getTime();
- long expiration = splitterTimeStamp + Long.valueOf(timeoutInMillies);
+ long expiration = splitterTimeStamp + timeoutInMillies;
if (logger.isDebugEnabled()) {
DateFormat dateFormat = DateFormat.getTimeInstance();
logger.debug("Current time=" + dateFormat.format(new Date(now))
@@ -274,7 +345,8 @@
return false;
}
/**
- * Checks for message that are timed out. If we find that one we notify ourselves about it by resending the message.
+ * Checks for message that are timed out. If we find that one, drop it in the DLQ and delete
+ * it from the map.
*
* @author kstam
*
@@ -282,39 +354,43 @@
class TimeoutChecker extends Thread {
private final Lock terminateLock = new ReentrantLock() ;
private final Condition terminateCondition = terminateLock.newCondition() ;
- private boolean terminated ;
-
+ private boolean terminated ;
+ ServiceInvoker dlQueueInvoker;
+
@SuppressWarnings("unchecked")
public void run() {
+ try {
+ dlQueueInvoker = new ServiceInvoker(INTERNAL_SERVICE_CATEGORY, DEAD_LETTER_SERVICE_NAME);
+ } catch (MessageDeliverException e) {
+ logger.error("Unable to initialise Dead Letter Channel Service Invoker for Aggregation timeout checker. Not using Dead Letter Channel.", e);
+ }
+
boolean running = true ;
while(running) {
- Service theService = new Service(serviceCategoryName, serviceName);
- ServiceInvoker theServiceInvoker = null;
-
//no need to check if no timeout is set
if (timeoutInMillies!=null) {
- for (ConcurrentHashMap< String, Message > messageMap : _aggregatedMessageMap.values()) {
+ for (Map<Integer, Message > messageMap : aggregatedMessageMap.values()) {
//Check the first message, they all have the same time stamp
Message message = messageMap.values().iterator().next();
- if (isTimedOut(message)) {
+ long timeStamp = (Long) message.getProperties().getProperty(SPLITTER_TIME_STAMP);
+
+ if (isTimedOut(timeStamp)) {
//We found a timed-out message. Let's go notify ourselves about by resending a message,
//it if we haven't done so already
- ArrayList<String> aggregatorTag = (ArrayList<String>) message.getProperties().getProperty(Aggregator.AGGEGRATOR_TAG);
- String uuId = aggregatorTag.get(0);
- if (!_notified.contains(uuId)) {
- _notified.add(uuId);
- logger.debug("Found timeout message.");
+ List<String> aggregatorTag = getAggregatorTags(message);
+ if(aggregatorTag != null && !aggregatorTag.isEmpty()) {
+ AggregationDetails aggrDetails = new AggregationDetails(aggregatorTag.get(aggregatorTag.size() - 1));
+
try {
- if (theServiceInvoker == null)
- theServiceInvoker = new ServiceInvoker(theService);
-
- theServiceInvoker.deliverAsync(message);
- } catch (Exception e) {
- logger.error(e.getMessage(), e);
- //If we can't notify then drop this data
- logger.debug("Deleting data for message series with uuId=" + uuId);
- _notified.remove(uuId);
- _aggregatedMessageMap.remove(uuId);
+ logger.info("Deleting message aggregation series: " + aggrDetails.getSeriesUuid());
+ if(dlQueueInvoker != null) {
+ Message aggregateMessage = createAggregateMessage(aggrDetails.getSeriesUuid(), messageMap);
+ dlQueueInvoker.deliverAsync(aggregateMessage);
+ }
+ } catch(Throwable e) {
+ logger.error("Error delivering timed out aggregation message to Dead Letter Service.", e);
+ } finally {
+ aggregatedMessageMap.remove(aggrDetails.getSeriesUuid());
}
}
}
@@ -332,7 +408,7 @@
}
}
}
-
+
public void terminate() {
terminateLock.lock() ;
try
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/actions/PropertySetter.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/rosetta/src/org/jboss/soa/esb/actions/PropertySetter.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/actions/PropertySetter.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/actions/PropertySetter.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,83 @@
+package org.jboss.soa.esb.actions;
+
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.apache.log4j.Logger;
+
+/**
+ * <p/>
+ * This action adds all of its attributes to the message as properties. It was created to
+ * help pass in the name of the filename to use for StoreMessageToFile for continuous integration
+ * of quickstarts, but it has a more generalized purpose in that it allows anyone to set
+ * message properties quickly in the jboss-esb.xml.
+ * <p/>
+ * An "Action Processor" performs a processing action on a message payload and returns the processing
+ * result.
+ * <p/>
+ * Here is an example of how to use this within your jboss-esb.xml :
+ * <p/>
+ * <code>
+ * <action name="AddProperty"
+ * class="org.jboss.soa.esb.actions.PropertySetter"><br/>
+ * <property name="jbesbfilename" value="BPMOrchestration1Test.log"/><br/>
+ * </action><br/>
+ * </code>
+ * <p/>
+ * This will insert a property "jbesbfilename" into the message with a value of
+ * "BPMOrchestration1Test.log". There are no checks here on property names, so be careful
+ * when setting properties for JMS that you only set ones with valid names.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">tcunning at redhat.com</a>
+ * @since Version 4.2.1
+ *
+ */
+public class PropertySetter extends AbstractActionLifecycle {
+
+ protected ConfigTree _config;
+ private Logger logger = Logger.getLogger(PropertySetter.class);
+
+ /**
+ * Adds attributes to the message as properties
+ * @param message message
+ * @return message
+ * @throws Exception
+ */
+ public Message process(Message message) throws Exception {
+ try {
+ for (String key : _config.getAttributeNames()) {
+ String value = _config.getAttribute(key);
+ message.getProperties().setProperty(key, value);
+ }
+ } catch (Exception e) {
+ logger.error("", e);
+ throw e;
+ }
+
+ return message;
+ }
+
+ public PropertySetter(ConfigTree config) { _config = config; }
+
+}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/actions/StaticWiretap.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/actions/StaticWiretap.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/actions/StaticWiretap.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -31,6 +31,7 @@
import org.apache.log4j.Logger;
import org.jboss.soa.esb.ConfigurationException;
import org.jboss.soa.esb.Service;
+import org.jboss.soa.esb.client.MessageMulticaster;
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.listeners.ListenerTagNames;
import org.jboss.soa.esb.listeners.message.MessageDeliverException;
@@ -68,6 +69,8 @@
*/
public void initialise() throws ActionLifecycleException
{
+ messageMulticaster = new MessageMulticaster(_config.getAttribute("action", "%unset%"));
+
ConfigTree[] destList = _config.getChildren(ROUTE_TO_TAG);
if (null == destList || destList.length < 1)
{
@@ -92,7 +95,7 @@
protected ConfigTree _config;
- protected org.jboss.soa.esb.client.MessageMulticaster messageMulticaster = new org.jboss.soa.esb.client.MessageMulticaster();
+ protected MessageMulticaster messageMulticaster;
protected static Logger _logger = Logger.getLogger(StaticWiretap.class);
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/actions/StoreMessageToFile.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/actions/StoreMessageToFile.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/actions/StoreMessageToFile.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -31,7 +31,6 @@
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.listeners.message.ActionProcessingPipeline;
import org.jboss.soa.esb.listeners.message.MessageDeliverException;
-import org.jboss.soa.esb.message.Body;
import org.jboss.soa.esb.message.Message;
import org.jboss.soa.esb.message.MessagePayloadProxy;
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/actions/TestMessageStore.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/rosetta/src/org/jboss/soa/esb/actions/TestMessageStore.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/actions/TestMessageStore.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/actions/TestMessageStore.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,193 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006
+ */
+package org.jboss.soa.esb.actions;
+
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.message.ActionProcessingPipeline;
+import org.jboss.soa.esb.listeners.message.MessageDeliverException;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.MessagePayloadProxy;
+
+/**
+ * Simple action that passes the message to a logging mechanism.
+ * This action is primarily used for testing the quickstarts.
+ *
+ * @author Kevin Conner
+ */
+public class TestMessageStore extends AbstractActionPipelineProcessor
+{
+ /**
+ * The message content location.
+ */
+ public static final String LOCATION = "location" ;
+ /**
+ * The log success flag.
+ */
+ public static final String LOG_SUCCESS = "logSuccess" ;
+ /**
+ * The log exception flag.
+ */
+ public static final String LOG_EXCEPTION = "logException" ;
+
+ /**
+ * The global test message store sink.
+ */
+ private static TestMessageStoreSink testMessageStoreSink ;
+
+ /**
+ * The message payload proxy.
+ */
+ private final MessagePayloadProxy payloadProxy ;
+ /**
+ * Should we log the success notification?
+ */
+ private final boolean logSuccess ;
+ /**
+ * Should we log the exception notification?
+ */
+ private final boolean logException ;
+
+ /**
+ * Create the action with the specified configuration.
+ *
+ * @param config The action configuration.
+ */
+ public TestMessageStore(final ConfigTree config)
+ {
+ String location = config.getAttribute(LOCATION) ;
+ if(location != null)
+ {
+ config.setAttribute(MessagePayloadProxy.GET_PAYLOAD_LOCATION, location) ;
+ }
+ payloadProxy = new MessagePayloadProxy(config) ;
+ payloadProxy.setNullGetPayloadHandling(MessagePayloadProxy.NullPayloadHandling.LOG) ;
+ logSuccess = config.getBooleanAttribute(LOG_SUCCESS, false) ;
+ logException = config.getBooleanAttribute(LOG_EXCEPTION, false) ;
+ }
+
+ /**
+ * Process the message.
+ *
+ * @param message The current message.
+ * @throws ActionProcessingPipeline for errors in processing.
+ */
+ public Message process(final Message message)
+ throws ActionProcessingException
+ {
+ logContents(getContents(message)) ;
+ return message ;
+ }
+
+ /**
+ * Process the exception notification.
+ * @param message The associated message.
+ * @param th The throwable causing the exception.
+ */
+ public void processException(final Message message, final Throwable th)
+ {
+ if (logException)
+ {
+ try
+ {
+ logContents(th.getLocalizedMessage() + ':' + getContents(message)) ;
+ }
+ catch (final ActionProcessingException ape)
+ {
+ logContents(ape.getLocalizedMessage()) ;
+ }
+ }
+ }
+
+ /**
+ * Process the success notification.
+ * @param message The associated message.
+ */
+ public void processSuccess(final Message message)
+ {
+ if (logSuccess)
+ {
+ try
+ {
+ logContents("Success:" + getContents(message)) ;
+ }
+ catch (final ActionProcessingException ape)
+ {
+ logContents(ape.getLocalizedMessage()) ;
+ }
+ }
+ }
+
+ /**
+ * Get the message contents.
+ * @param message The message.
+ * @return the message contents as a string or null if no contents.
+ * @throws ActionProcessingException for errors in processing.
+ */
+ private String getContents(final Message message)
+ throws ActionProcessingException
+ {
+ final Object contents;
+
+ try
+ {
+ contents = payloadProxy.getPayload(message) ;
+ }
+ catch (final MessageDeliverException mde)
+ {
+ throw new ActionProcessingException(mde) ;
+ }
+
+ if (contents != null)
+ {
+ final String messageVal ;
+ if (contents instanceof byte[])
+ {
+ messageVal = new String((byte[])contents) ;
+ }
+ else
+ {
+ messageVal = contents.toString() ;
+ }
+ return messageVal ;
+ }
+ return null ;
+ }
+
+ /**
+ * Set the message store sink.
+ * @param testMessageStoreSink The test message store sink.
+ */
+ public static synchronized void setMessageStoreSink(final TestMessageStoreSink testMessageStoreSink)
+ {
+ TestMessageStore.testMessageStoreSink = testMessageStoreSink ;
+ }
+
+ /**
+ * Log the contents to the message store sink.
+ * @param message The current message.
+ */
+ private static synchronized void logContents(final String message)
+ {
+ if (testMessageStoreSink != null)
+ {
+ testMessageStoreSink.logMessage(message) ;
+ }
+ }
+}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/actions/TestMessageStoreSink.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/rosetta/src/org/jboss/soa/esb/actions/TestMessageStoreSink.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/actions/TestMessageStoreSink.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/actions/TestMessageStoreSink.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,129 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006
+ */
+package org.jboss.soa.esb.actions;
+
+import java.util.ArrayList;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.locks.Condition;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
+
+/**
+ * Simple action that passes the message to a logging mechanism.
+ * This action is primarily used for testing the quickstarts.
+ *
+ * @author Kevin Conner
+ */
+public class TestMessageStoreSink
+{
+ /**
+ * The list of messages.
+ */
+ private final ArrayList<String> list = new ArrayList<String>() ;
+ /**
+ * The lock for the sink.
+ */
+ private final Lock lock = new ReentrantLock() ;
+ /**
+ * The condition for notifying messages.
+ */
+ private final Condition waitCondition = lock.newCondition() ;
+
+ /**
+ * Wait for the specified number of messages to appear in the sink.
+ * @param numberOfMessages The number of messages.
+ * @param maxDelay The maximum delay for waiting.
+ */
+ public String[] waitForMessages(final int numberOfMessages, final long maxDelay)
+ {
+ final long startTime = System.currentTimeMillis() ;
+ final long endTime = startTime + maxDelay ;
+ lock.lock() ;
+ try
+ {
+ while (list.size() != numberOfMessages)
+ {
+ final long now = System.currentTimeMillis() ;
+ final long waitPeriod = endTime - now ;
+ if (waitPeriod > 0)
+ {
+ try
+ {
+ waitCondition.await(waitPeriod, TimeUnit.MILLISECONDS) ;
+ }
+ catch (final InterruptedException ie) {} // ignore
+ }
+ else
+ {
+ break ;
+ }
+ }
+ final String[] results = list.toArray(new String[0]) ;
+ list.clear() ;
+ final int numResults = results.length ;
+ System.out.println("TestMessageStoreSink: Returning " + numResults + " message" + (numResults == 1 ? "" : "s")) ;
+ for(int count = 0 ; count < numResults ; count++)
+ {
+ System.out.println("TestMessageStoreSink: Returning message[" + count + "]: " + results[count]) ;
+ }
+ return results ;
+ }
+ finally
+ {
+ lock.unlock() ;
+ }
+ }
+
+ /**
+ * Log the message in the sink.
+ * @param message The current message.
+ */
+ public void logMessage(final String message)
+ {
+ lock.lock() ;
+ try
+ {
+ list.add(message) ;
+ System.out.println("TestMessageStoreSink: Adding message: " + message) ;
+ waitCondition.signal() ;
+ }
+ finally
+ {
+ lock.unlock() ;
+ }
+ }
+
+ /**
+ * Clear the messages in the sink.
+ */
+ public void clearMessages()
+ {
+ lock.lock() ;
+ try
+ {
+ list.clear() ;
+ System.out.println("TestMessageStoreSink: Clearing messages") ;
+ }
+ finally
+ {
+ lock.unlock() ;
+ }
+ }
+}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/client/MessageMulticaster.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/client/MessageMulticaster.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/client/MessageMulticaster.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -19,13 +19,14 @@
*/
package org.jboss.soa.esb.client;
-import org.jboss.soa.esb.message.Message;
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.assertion.AssertArgument;
import org.jboss.soa.esb.Service;
+import org.jboss.soa.esb.actions.AggregationDetails;
import org.jboss.soa.esb.actions.Aggregator;
import org.jboss.soa.esb.listeners.message.MessageDeliverException;
+import org.jboss.soa.esb.message.Message;
import org.jboss.soa.esb.services.registry.RegistryException;
-import org.jboss.internal.soa.esb.assertion.AssertArgument;
-import org.apache.log4j.Logger;
import java.util.*;
@@ -48,8 +49,24 @@
private static Logger logger = Logger.getLogger(MessageMulticaster.class);
private Map<Service, ServiceInvoker> invokers = new LinkedHashMap<Service, ServiceInvoker>();
+ private String splitId;
/**
+ * Public default constructor.
+ */
+ public MessageMulticaster() {
+ }
+
+ /**
+ * Public default constructor.
+ * @param splitId Split ID for this multicaster.
+ */
+ public MessageMulticaster(String splitId) {
+ AssertArgument.isNotNullAndNotEmpty(splitId, "splitId");
+ this.splitId = splitId;
+ }
+
+ /**
* Add a message recipient Service.
* @param service Recipient service for receipt of messages from this miltcaster instance.
* @throws RegistryException Failed to lookup Service endpoint.
@@ -102,26 +119,23 @@
* @throws MessageDeliverException Failed to deliver message to endpoint.
*/
public void sendToSubset(Message message, List<Service> recipients) throws RegistryException, MessageDeliverException {
- if (recipients.isEmpty())
- logger.warn("MessageMulticaster.sendToSubset: empty recipients list!");
- else
- {
- String uuId = UUID.randomUUID().toString();
- ArrayList<String> aggregatorTags = new ArrayList<String>();
+ if (recipients.isEmpty()) {
+ logger.warn("MessageMulticaster.sendToSubset: empty recipients list!");
+ } else{
+ String seriesUUID = UUID.randomUUID().toString();
+ long seriesTimestamp = System.currentTimeMillis();
int recipientCount = recipients.size();
- long timestamp = System.currentTimeMillis();
-
+
for(int i = 0; i < recipientCount; i++) {
Service recipient = recipients.get(i);
ServiceInvoker invoker = getInvoker(recipient);
- String tag = uuId + ":" + (i + 1) + ":" + recipientCount + ":" + timestamp;
-
- aggregatorTags.add(tag);
- message.getProperties().setProperty(Aggregator.AGGEGRATOR_TAG, aggregatorTags);
- if (logger.isDebugEnabled()) {
- logger.debug(Aggregator. AGGEGRATOR_TAG + "=" + tag);
+
+ if(recipientCount > 1) {
+ // Only add aggregation info if we're splitting the message i.e. sending it to
+ // more than 1 recipient...
+ addAggregationDetails(message, seriesUUID, recipientCount, seriesTimestamp, i + 1);
}
-
+
if(invoker == null) {
logger.error("Service '" + recipient + "' is not in recipient list. Delivering message to Dead Letter Channel.");
ServiceInvoker.deliverToDeadLetterService(message);
@@ -134,10 +148,33 @@
}
}
}
- }
+ }
}
- private org.jboss.soa.esb.client.ServiceInvoker getInvoker(Service recipient) throws RegistryException, MessageDeliverException {
+ private void addAggregationDetails(Message message, String uuId, int recipientCount, long seriesTimestamp, int messageIndex) {
+ AggregationDetails aggrDetails = new AggregationDetails(uuId, messageIndex, recipientCount, seriesTimestamp);
+ ArrayList<String> aggregatorTags = (ArrayList<String>) message.getProperties().getProperty(Aggregator.AGGEGRATOR_TAG);
+
+ // This is useful during aggregation - as a way of id'ing where the split occurred.
+ aggrDetails.setSplitId(splitId);
+
+ if(aggregatorTags == null) {
+ aggregatorTags = new ArrayList<String>();
+ message.getProperties().setProperty(Aggregator.AGGEGRATOR_TAG, aggregatorTags);
+ }
+
+ if(messageIndex > 1) {
+ // remove the tag string for the last recipient...
+ aggregatorTags.remove(aggregatorTags.size() - 1);
+ }
+ aggregatorTags.add(aggrDetails.toString());
+
+ if (logger.isDebugEnabled()) {
+ logger.debug(Aggregator. AGGEGRATOR_TAG + "=" + aggrDetails);
+ }
+ }
+
+ private ServiceInvoker getInvoker(Service recipient) throws RegistryException, MessageDeliverException {
ServiceInvoker invoker = invokers.get(recipient);
// We lazilly create the invokers...
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployer.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployer.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployer.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -25,8 +25,10 @@
import java.io.InputStream;
import java.io.StringReader;
import java.net.URL;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
+import java.util.Map;
import java.util.Properties;
import java.util.Set;
@@ -51,6 +53,7 @@
import org.jboss.soa.esb.util.ClassUtil;
import org.jboss.soa.esb.util.XPathNamespaceContext;
import org.jboss.system.ServiceControllerMBean;
+import org.jboss.web.AbstractWebContainer;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
@@ -202,7 +205,7 @@
{
try
{
- Element jboss = xfl.getDocument(in, "META-INF/esb-deployment.xml").getDocumentElement();
+ Element jboss = xfl.getDocument(in, "META-INF/deployment.xml").getDocumentElement();
// Check for a ejb level class loading config
Element loader = MetaData.getOptionalChild(jboss, "loader-repository");
if (loader != null)
@@ -236,6 +239,7 @@
{
log.info("create esb service, " + di.shortName);
URL document = getDocumentUrl(di);
+
if (document == null)
{
throw new DeploymentException("Unable to find document url of META-INF/jboss-esb.xml in: "
@@ -262,7 +266,48 @@
deps.add(depOn);
}
}
-
+ Iterator esbDepends = MetaData.getChildrenByTagName(jboss, "esb-depends");
+ if ((esbDepends != null) && esbDepends.hasNext())
+ {
+ final Map<String, DeploymentInfo> subDeploymentLocationMap ;
+ if (di.subDeployments.size() > 0)
+ {
+ subDeploymentLocationMap = new HashMap<String, DeploymentInfo>() ;
+ final Set<DeploymentInfo> subDeployments = (Set<DeploymentInfo>)di.subDeployments ;
+ for(DeploymentInfo subDI : subDeployments)
+ {
+ final String urlPath = subDI.url.getPath() ;
+ final String deployablePath = (urlPath.endsWith("/") ? urlPath.substring(0, urlPath.length()-1) : urlPath) ;
+ final int lastSeparator = deployablePath.lastIndexOf('/') ;
+ final String deployable = (lastSeparator >= 0 ? deployablePath.substring(lastSeparator+1) : deployablePath) ;
+ if (subDeploymentLocationMap.put(deployable, subDI) != null)
+ {
+ throw new DeploymentException("Duplicate subDeployment name: " + deployable) ;
+ }
+ }
+ }
+ else
+ {
+ throw new DeploymentException("No subdeployments to match esb-depends") ;
+ }
+
+ do
+ {
+ Element depend = (Element)esbDepends.next();
+ final String deployable = MetaData.getElementContent(depend) ;
+ final DeploymentInfo subDI = subDeploymentLocationMap.get(deployable) ;
+ if ((subDI != null) && subDI.context.containsKey(AbstractWebContainer.WEB_MODULE))
+ {
+ final ObjectName jmxName = (ObjectName) subDI.context.get(AbstractWebContainer.WEB_MODULE) ;
+ deps.add(jmxName) ;
+ }
+ else
+ {
+ throw new DeploymentException("Could not locate WAR subdeployment matching: " + deployable) ;
+ }
+ }
+ while (esbDepends.hasNext()) ;
+ }
}
finally
{
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionProcessorMethodInfo.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionProcessorMethodInfo.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionProcessorMethodInfo.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -124,7 +124,18 @@
{
throw (ActionProcessingException)th ;
}
- throw new ActionProcessingException("Unexpected invocation target exception from processor", th) ;
+ else if (th instanceof RuntimeException)
+ {
+ throw (RuntimeException)th ;
+ }
+ else if (th instanceof Error)
+ {
+ throw (Error)th ;
+ }
+ else
+ {
+ throw new ActionProcessingException("Unexpected invocation target exception from processor", th) ;
+ }
}
}
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/message/Body.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/message/Body.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/message/Body.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -135,14 +135,14 @@
*
* @param content
* the message bytes
- * @deprecated As of 4.2 this has been replaced by add(BytesBody.BYTES_LOCATION, content)
+ * @deprecated As of 4.2 you can use add(BytesBody.BYTES_LOCATION, content)
*/
public void setContents(byte[] content);
/**
* @return the byte content of the body.
- * @deprecated As of 4.2 this has been replaced by get(BytesBody.BYTES_LOCATION)
+ * @deprecated As of 4.2 you can use get(BytesBody.BYTES_LOCATION)
*/
public byte[] getContents();
@@ -153,14 +153,14 @@
*
* @param content
* the message bytes
- * @deprecated As of 4.2 this has been replaced by add(BytesBody.BYTES_LOCATION, content)
+ * @deprecated As of 4.2 you can use add(BytesBody.BYTES_LOCATION, content)
*/
public void setByteArray(byte[] content);
/**
* @return the byte content of the body.
- * @deprecated As of 4.2 this has been replaced by get(BytesBody.BYTES_LOCATION)
+ * @deprecated As of 4.2 you can use get(BytesBody.BYTES_LOCATION)
*/
public byte[] getByteArray();
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/message/mapping/ObjectMapper.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/message/mapping/ObjectMapper.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/message/mapping/ObjectMapper.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -251,6 +251,7 @@
if (path.length==3) {
object = MVEL.getProperty(path[2], object);
}
+ logger.debug("expression=" + expression + " value=" + object);
return object;
}
/**
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/util/AbstractCommandVehicle.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/util/AbstractCommandVehicle.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/util/AbstractCommandVehicle.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -1,139 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.soa.esb.util;
-
-import java.io.Serializable;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-/**
- * Auxiliary class that deals with implementation details of event messages handled by ESB aware applications.
- * <p/>The '_command' enumeration is inteded to contain all accepted command codes, and should be provided
- * by all classes that extend AbstractCommandMessage
- * <br/>Values that this class is able to render are (arbitrarily) stored in a Map<String,Object>
- * contained in the message body as a named Object with key getCommandValuesTag()
- * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
- *
- */
-public abstract class AbstractCommandVehicle implements Serializable
-{
- /**
- * Provide a name for the named object to look for in the ESB Message body.
- * @return String : intended to be used as the key in Message.getBody().get(arg)
- */
- public abstract String getCommandValuesTag();
-
- /**
- * The key for the command operation code in the command values map
- * @return String : intended to be used as the key in _values.get(arg)
- */
- public abstract String getCommandOpcodeKey();
-
- /**
- * Valid operator for this command vehicle, from String value
- * @param value - the String value of the operator
- * @return the Enum value that represents arg0
- */
- public abstract Enum operatorFromString(String value);
-
- private Logger _logger = Logger.getLogger(AbstractCommandVehicle.class);
-
- protected Map<String,Object>_values = new HashMap<String,Object>();
-
- protected Enum _operator;
- public Enum getOperator() { return _operator; }
- protected void setOperator(Enum operator) { _operator = operator; }
-
- protected AbstractCommandVehicle(Enum command)
- {
- _operator = command;
- }
-
- /**
- * Populate this event's associated values contained in the ESB message
- * <br/>Values that this class is able to render are expected to be in a Map<String,Object>
- * contained in the message body as a named Object (key=getCommandValuesTag())
- * @param message : Message - the vehicle of this command
- */
- @SuppressWarnings("unchecked")
- protected AbstractCommandVehicle(Message message)
- {
- Object obj = message.getBody().get(getCommandValuesTag());
- if (! (obj instanceof Map))
- throw new IllegalArgumentException("Message command values must be stored as a Map<String,Object>");
- _values.putAll((Map)obj);
- _operator = operatorFromString((String)_values.get(getCommandOpcodeKey()));
- _values.remove(getCommandValuesTag());
- } //________________________________
-
- /**
- * Instantiate a new message, and put values where they belong
- * @return Message - a fresh Message, with the command values in the appropriate spot
- */
- public Message toCommandMessage()
- {
- Message message = MessageFactory.getInstance().getMessage();
- URI uri = null;
- try { uri = new URI(UUID.randomUUID().toString()); }
- catch (URISyntaxException e)
- {
- _logger.fatal("Problem with UUID.randomUUID() - This should not happen");
- return null;
- }
- message.getHeader().getCall().setMessageID(uri);
-
- _values.put(getCommandOpcodeKey(), _operator.toString());
- message.getBody().add(getCommandValuesTag(), _values);
-
- return message;
- } //________________________________
-
- /**
- * Clean all values from this command object
- * <br/>Operator will still remain the same as before
- * @return Map<String,Object> the old contents of _values
- */
- public Map <String,Object>cleanValues()
- {
- Map <String,Object> oldVals = _values;
- _values = new HashMap<String,Object>();
- return oldVals;
- } //________________________________
-
- protected Object setValue(String key, Object value)
- {
- if (null==key)
- throw new IllegalArgumentException("Key must not be null");
- Object oldVal = _values.get(key);
- if (null==value)
- _values.remove(key);
- else
- oldVal = _values.put(key, value);
- return oldVal;
- } //________________________________
-}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/AggregationDetailsUnitTest.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/rosetta/tests/src/org/jboss/soa/esb/actions/AggregationDetailsUnitTest.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/AggregationDetailsUnitTest.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/AggregationDetailsUnitTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.actions;
+
+import junit.framework.TestCase;
+import org.jboss.soa.esb.listeners.message.MessageDeliverException;
+
+/**
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class AggregationDetailsUnitTest extends TestCase {
+
+ public void test_multi_args() throws MessageDeliverException {
+ test_invalid_multi_args("", 1, 1, 1, "null or empty 'seriesUuid' arg in method call.");
+ test_invalid_multi_args("x", -1, 1, 1, "Invalid AggregatorDetails. messageNumber < 1");
+ test_invalid_multi_args("x", 1, -1, 1, "Invalid AggregatorDetails. seriesSize < messageNumber");
+ test_invalid_multi_args("x", 1, 1, -1, "Invalid AggregatorDetails. timestamp < 1");
+
+ // This should work...
+ new AggregationDetails("x", 1, 1, 1);
+ }
+
+ private void test_invalid_multi_args(String seriesUuid, int messageNumber, int seriesSize, long seriesTimestamp, String errorMessage) {
+ try {
+ new AggregationDetails(seriesUuid, messageNumber, seriesSize, seriesTimestamp);
+ fail("Expected IllegalArgumentException/MessageDeliverException");
+ } catch(IllegalArgumentException e) {
+ assertEquals(errorMessage, e.getMessage());
+ }
+ }
+
+ public void test_tag_arg() throws MessageDeliverException {
+ test_invalid_tag_arg("", "null or empty 'aggregatorTag' arg in method call.");
+ test_invalid_tag_arg("1:1:1", "Invalid Aggregator Tag. Must have 4 tokens (colon separated).");
+ test_invalid_tag_arg(":1:1:1", "Invalid Aggregator Tag: seriesUuid is blank.");
+ test_invalid_tag_arg("xxx:x:1:1", "Invalid Aggregator Tag. 'messageNumber' must be an int.");
+ test_invalid_tag_arg("xxx:1:x:1", "Invalid Aggregator Tag. 'seriesSize' must be an int.");
+ test_invalid_tag_arg("xxx:1:1:x", "Invalid Aggregator Tag. 'timestamp' must be an long.");
+ test_invalid_tag_arg("xxx:-1:1:1", "Invalid Aggregator Tag. messageNumber < 1");
+ test_invalid_tag_arg("xxx:1:-1:1", "Invalid Aggregator Tag. seriesSize < messageNumber");
+ test_invalid_tag_arg("xxx:1:1:-1", "Invalid Aggregator Tag. timestamp < 1");
+
+ // This should work...
+ new AggregationDetails("xxx:1:1:1");
+ }
+
+ private void test_invalid_tag_arg(String tag, String errorMessage) {
+ try {
+ new AggregationDetails(tag);
+ fail("Expected IllegalArgumentException/MessageDeliverException");
+ } catch(IllegalArgumentException e) {
+ assertEquals(errorMessage, e.getMessage());
+ }
+ }
+}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation)
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/JBESB_1201_UnitTest.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/JBESB_1201_UnitTest.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/JBESB_1201_UnitTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -1,280 +0,0 @@
-/*
- Milyn - Copyright (C) 2006
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License (version 2.1) as published by the Free Software
- Foundation.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
- See the GNU Lesser General Public License for more details:
- http://www.gnu.org/licenses/lgpl.txt
-*/
-package org.jboss.soa.esb.actions.aggregation;
-
-import junit.framework.TestCase;
-import org.jboss.internal.soa.esb.couriers.MockCourierFactory;
-import org.jboss.internal.soa.esb.services.registry.MockRegistry;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.actions.*;
-import org.jboss.soa.esb.client.ServiceInvoker;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.message.MessageDeliverException;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-import org.jboss.soa.esb.services.registry.RegistryException;
-import org.jboss.soa.esb.testutils.ESBConfigUtil;
-
-import java.util.Map;
-
-/**
- * Tests for JBESB-1201 re timeout management.
- * <p/>
- * Make sure the message aggregation info flows in the following scenario...
- * <pre>
- *
- * |----- service1 -----|
- * | |
- * splitter --| |-- aggregator
- * | |
- * |----- service2 -----|
- *
- * </pre>
- *
- * @author <a href="mailto:tom.fennelly at gmail.com">tom.fennelly at gmail.com</a>
- */
-public class JBESB_1201_UnitTest extends TestCase {
-
- private TestCourier service1Courier;
- private TestCourier service2Courier;
- private TestCourier aggregatorCourier;
- private TestCourier dlqServiceCourier;
-
- private StaticRouter splitter;
- private StaticRouter service1;
- private StaticRouter service2;
- private Aggregator aggregator;
-
- protected void setUp() throws Exception {
- MockCourierFactory.install();
- MockRegistry.install();
-
- service1Courier = new TestCourier();
- service2Courier = new TestCourier();
- aggregatorCourier = new TestCourier();
- dlqServiceCourier = new TestCourier();
-
- MockRegistry.register("test", "service1", service1Courier);
- MockRegistry.register("test", "service2", service2Courier);
- MockRegistry.register("test", "aggregator", aggregatorCourier);
- MockRegistry.register(ServiceInvoker.INTERNAL_SERVICE_CATEGORY, ServiceInvoker.DEAD_LETTER_SERVICE_NAME, dlqServiceCourier);
-
- initaliseServices();
- }
-
- private void initaliseServices() throws ConfigurationException, RegistryException, ActionLifecycleException {
- ESBConfigUtil esbConfig = new ESBConfigUtil(getClass().getResourceAsStream("action-configs-01.xml"));
- ConfigTree splitterConfig = esbConfig.getActionConfig("null-listener", "splitter1-action");
- ConfigTree service1Config = esbConfig.getActionConfig("null-listener", "service1-config");
- ConfigTree service2Config = esbConfig.getActionConfig("null-listener", "service2-config");
- ConfigTree aggregatorConfig = esbConfig.getActionConfig("null-listener", "aggregator-config");
-
- splitter = new StaticRouter(splitterConfig);
- splitter.initialise();
- service1 = new StaticRouter(service1Config);
- service1.initialise();
- service2 = new StaticRouter(service2Config);
- service2.initialise();
- aggregator = new Aggregator(aggregatorConfig);
- aggregator.initialise();
- }
-
- protected void tearDown() throws Exception {
- splitter.destroy();
- service1.destroy();
- service2.destroy();
- aggregator.destroy();
- MockRegistry.uninstall();
- MockCourierFactory.uninstall();
- }
-
- public void test_not_timed_out() throws RegistryException, ConfigurationException, ActionProcessingException, MessageDeliverException {
- Message messageIn = MessageFactory.getInstance().getMessage();
-
- // Get the aggregators message map and make sure it's empty...
- Map<String, Map<Integer, Message>> aggrMessageMap = aggregator.getAggregatedMessageMap();
- assertTrue(aggrMessageMap.isEmpty());
-
- // Manually deliver the message to the splitter service...
- splitter.process(messageIn);
- AggregationDetails service1Message = Aggregator.getAggregatorDetails(service1Courier.messages.get(0), 0);
- assertNotNull(service1Message);
-
- // Manually deliver the message in service1Courier into service1...
- service1.process(service1Courier.messages.get(0));
-
- // Manually deliver the message in service2Courier into service2...
- service2.process(service2Courier.messages.get(0));
-
- // 2 messages should arrive at the aggregatorCourier...
- assertEquals(2, aggregatorCourier.messages.size());
-
- // Aggregators message map should be empty...
- assertTrue(aggrMessageMap.isEmpty());
-
- // Pump the 1st message into the aggregater...
- aggregator.process(aggregatorCourier.messages.get(0));
- assertService1MessageDetailsOK(aggrMessageMap, service1Message);
-
- // Pump the 2nd (last) message into the aggregater...
- Message aggregateMessage = aggregator.process(aggregatorCourier.messages.get(1));
-
- assertNotNull(aggregateMessage);
- assertEquals(2, aggregateMessage.getAttachment().getUnnamedCount());
-
- // Make sure the aggregators message map is empty again...
- assertTrue(aggrMessageMap.isEmpty());
- }
-
- public void test_timed_out_non_delivered() throws RegistryException, ConfigurationException, ActionProcessingException, MessageDeliverException, InterruptedException {
- Message messageIn = MessageFactory.getInstance().getMessage();
-
- // Get the aggregators message map and make sure it's empty...
- Map<String, Map<Integer, Message>> aggrMessageMap = aggregator.getAggregatedMessageMap();
- assertTrue(aggrMessageMap.isEmpty());
-
- // Manually deliver the message to the splitter service...
- splitter.process(messageIn);
- AggregationDetails service1Message = Aggregator.getAggregatorDetails(service1Courier.messages.get(0), 0);
- assertNotNull(service1Message);
-
- // The aggregator timeout is 2000ms... sleep here for 3000ms to force all
- // messages delivered to the aggregator to be timed out - should all be
- // ignored...
- Thread.sleep(3000);
-
- // Manually deliver the message in service1Courier into service1...
- service1.process(service1Courier.messages.get(0));
-
- // Manually deliver the message in service2Courier into service2...
- service2.process(service2Courier.messages.get(0));
-
- // 2 messages should arrive at the aggregatorCourier...
- assertEquals(2, aggregatorCourier.messages.size());
-
- // Aggregators message map should be empty...
- assertTrue(aggrMessageMap.isEmpty());
-
- // Pump the 1st message into the aggregater...
- aggregator.process(aggregatorCourier.messages.get(0));
-
- // Aggregators message map should still be empty because the message should
- // have been ignored...
- assertTrue(aggrMessageMap.isEmpty());
-
- // Pump the 2nd (last) message into the aggregater...
- aggregator.process(aggregatorCourier.messages.get(1));
-
- // Aggregators message map should still be empty because the message should
- // have been ignored...
- assertTrue(aggrMessageMap.isEmpty());
- }
-
- public void test_timed_out_some_delivered() throws RegistryException, ConfigurationException, ActionProcessingException, MessageDeliverException, InterruptedException {
- Message messageIn = MessageFactory.getInstance().getMessage();
-
- // Get the aggregators message map and make sure it's empty...
- Map<String, Map<Integer, Message>> aggrMessageMap = aggregator.getAggregatedMessageMap();
- assertTrue(aggrMessageMap.isEmpty());
-
- // Manually deliver the message to the splitter service...
- splitter.process(messageIn);
- AggregationDetails service1Message = Aggregator.getAggregatorDetails(service1Courier.messages.get(0), 0);
- assertNotNull(service1Message);
-
- // Manually deliver the message in service1Courier into service1...
- service1.process(service1Courier.messages.get(0));
-
- // 1 messages should arrive at the aggregatorCourier...
- assertEquals(1, aggregatorCourier.messages.size());
-
- // Aggregators message map should be empty...
- assertTrue(aggrMessageMap.isEmpty());
-
- // Pump the 1st message into the aggregater and make sure it's
- // details are added properly to the map...
- aggregator.process(aggregatorCourier.messages.get(0));
- assertService1MessageDetailsOK(aggrMessageMap, service1Message);
-
- // The deadServiceCourier should be empty...
- assertEquals(0, dlqServiceCourier.messages.size());
-
- // The aggregator timeout is 2000ms... sleep here for 3000ms to force the 2nd
- // message delivered to the aggregator to be timed out...
- Thread.sleep(3000);
-
- // Should have timed out and "notified" on the first message...
- assertEquals(1, dlqServiceCourier.messages.size());
- // Aggregators message map should be empty again...
- assertTrue(aggrMessageMap.isEmpty());
-
- // Manually deliver the message in service2Courier into service2...
- service2.process(service2Courier.messages.get(0));
-
- // 2 messages should be at the aggregatorCourier...
- assertEquals(2, aggregatorCourier.messages.size());
-
- // Pump the 2nd message into the aggregater...
- Message aggregateMessage = aggregator.process(aggregatorCourier.messages.get(1));
- assertNull(aggregateMessage);
-
- // Aggregators message map should be empty because the message should
- // have been ignored...
- assertTrue(aggrMessageMap.isEmpty());
- }
-
- public void test_timeoutchecker() throws RegistryException, ConfigurationException, ActionProcessingException, MessageDeliverException, InterruptedException {
- Message messageIn = MessageFactory.getInstance().getMessage();
-
- // Get the aggregators message map and make sure it's empty...
- Map<String, Map<Integer, Message>> aggrMessageMap = aggregator.getAggregatedMessageMap();
- assertTrue(aggrMessageMap.isEmpty());
-
- // Manually deliver the message to the splitter service...
- splitter.process(messageIn);
- AggregationDetails service1Message = Aggregator.getAggregatorDetails(service1Courier.messages.get(0), 0);
- assertNotNull(service1Message);
-
- // Manually deliver the message in service1Courier into service1...
- service1.process(service1Courier.messages.get(0));
-
- // 1 messages should arrive at the aggregatorCourier...
- assertEquals(1, aggregatorCourier.messages.size());
-
- // Aggregators message map should be empty...
- assertTrue(aggrMessageMap.isEmpty());
-
- // Pump the message into the aggregater and make sure it's
- // details are added properly to the map...
- aggregator.process(aggregatorCourier.messages.get(0));
- assertService1MessageDetailsOK(aggrMessageMap, service1Message);
-
- // The aggregator timeout is 2000ms... sleep here for 3000ms...
- Thread.sleep(4000);
-
- // Aggregators message map should be empty because the message should
- // have timed out...
- assertTrue("Message didn't get removed from map after timeout", aggrMessageMap.isEmpty());
- }
-
- private void assertService1MessageDetailsOK(Map<String, Map<Integer, Message>> aggrMessageMap, AggregationDetails service1Message) {
- // Aggregators message map should have 1 entry for the above message...
- assertEquals(1, aggrMessageMap.size());
- Map<Integer, Message> messageSeries = aggrMessageMap.get(service1Message.getSeriesUuid());
- assertNotNull(messageSeries);
- assertTrue(messageSeries.get(service1Message.getMessageNumber()) != null);
- }
-}
\ No newline at end of file
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/JBESB_1201_UnitTest.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/JBESB_1201_UnitTest.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/JBESB_1201_UnitTest.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/JBESB_1201_UnitTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,280 @@
+/*
+ Milyn - Copyright (C) 2006
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License (version 2.1) as published by the Free Software
+ Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ See the GNU Lesser General Public License for more details:
+ http://www.gnu.org/licenses/lgpl.txt
+*/
+package org.jboss.soa.esb.actions.aggregation;
+
+import junit.framework.TestCase;
+import org.jboss.internal.soa.esb.couriers.MockCourierFactory;
+import org.jboss.internal.soa.esb.services.registry.MockRegistry;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.actions.*;
+import org.jboss.soa.esb.client.ServiceInvoker;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.message.MessageDeliverException;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.services.registry.RegistryException;
+import org.jboss.soa.esb.testutils.ESBConfigUtil;
+
+import java.util.Map;
+
+/**
+ * Tests for JBESB-1201 re timeout management.
+ * <p/>
+ * Make sure the message aggregation info flows in the following scenario...
+ * <pre>
+ *
+ * |----- service1 -----|
+ * | |
+ * splitter --| |-- aggregator
+ * | |
+ * |----- service2 -----|
+ *
+ * </pre>
+ *
+ * @author <a href="mailto:tom.fennelly at gmail.com">tom.fennelly at gmail.com</a>
+ */
+public class JBESB_1201_UnitTest extends TestCase {
+
+ private TestCourier service1Courier;
+ private TestCourier service2Courier;
+ private TestCourier aggregatorCourier;
+ private TestCourier dlqServiceCourier;
+
+ private StaticRouter splitter;
+ private StaticRouter service1;
+ private StaticRouter service2;
+ private Aggregator aggregator;
+
+ protected void setUp() throws Exception {
+ MockCourierFactory.install();
+ MockRegistry.install();
+
+ service1Courier = new TestCourier();
+ service2Courier = new TestCourier();
+ aggregatorCourier = new TestCourier();
+ dlqServiceCourier = new TestCourier();
+
+ MockRegistry.register("test", "service1", service1Courier);
+ MockRegistry.register("test", "service2", service2Courier);
+ MockRegistry.register("test", "aggregator", aggregatorCourier);
+ MockRegistry.register(ServiceInvoker.INTERNAL_SERVICE_CATEGORY, ServiceInvoker.DEAD_LETTER_SERVICE_NAME, dlqServiceCourier);
+
+ initaliseServices();
+ }
+
+ private void initaliseServices() throws ConfigurationException, RegistryException, ActionLifecycleException {
+ ESBConfigUtil esbConfig = new ESBConfigUtil(getClass().getResourceAsStream("action-configs-01.xml"));
+ ConfigTree splitterConfig = esbConfig.getActionConfig("null-listener", "splitter1-action");
+ ConfigTree service1Config = esbConfig.getActionConfig("null-listener", "service1-config");
+ ConfigTree service2Config = esbConfig.getActionConfig("null-listener", "service2-config");
+ ConfigTree aggregatorConfig = esbConfig.getActionConfig("null-listener", "aggregator-config");
+
+ splitter = new StaticRouter(splitterConfig);
+ splitter.initialise();
+ service1 = new StaticRouter(service1Config);
+ service1.initialise();
+ service2 = new StaticRouter(service2Config);
+ service2.initialise();
+ aggregator = new Aggregator(aggregatorConfig);
+ aggregator.initialise();
+ }
+
+ protected void tearDown() throws Exception {
+ splitter.destroy();
+ service1.destroy();
+ service2.destroy();
+ aggregator.destroy();
+ MockRegistry.uninstall();
+ MockCourierFactory.uninstall();
+ }
+
+ public void test_not_timed_out() throws RegistryException, ConfigurationException, ActionProcessingException, MessageDeliverException {
+ Message messageIn = MessageFactory.getInstance().getMessage();
+
+ // Get the aggregators message map and make sure it's empty...
+ Map<String, Map<Integer, Message>> aggrMessageMap = aggregator.getAggregatedMessageMap();
+ assertTrue(aggrMessageMap.isEmpty());
+
+ // Manually deliver the message to the splitter service...
+ splitter.process(messageIn);
+ AggregationDetails service1Message = Aggregator.getAggregatorDetails(service1Courier.messages.get(0), 0);
+ assertNotNull(service1Message);
+
+ // Manually deliver the message in service1Courier into service1...
+ service1.process(service1Courier.messages.get(0));
+
+ // Manually deliver the message in service2Courier into service2...
+ service2.process(service2Courier.messages.get(0));
+
+ // 2 messages should arrive at the aggregatorCourier...
+ assertEquals(2, aggregatorCourier.messages.size());
+
+ // Aggregators message map should be empty...
+ assertTrue(aggrMessageMap.isEmpty());
+
+ // Pump the 1st message into the aggregater...
+ aggregator.process(aggregatorCourier.messages.get(0));
+ assertService1MessageDetailsOK(aggrMessageMap, service1Message);
+
+ // Pump the 2nd (last) message into the aggregater...
+ Message aggregateMessage = aggregator.process(aggregatorCourier.messages.get(1));
+
+ assertNotNull(aggregateMessage);
+ assertEquals(2, aggregateMessage.getAttachment().getUnnamedCount());
+
+ // Make sure the aggregators message map is empty again...
+ assertTrue(aggrMessageMap.isEmpty());
+ }
+
+ public void test_timed_out_non_delivered() throws RegistryException, ConfigurationException, ActionProcessingException, MessageDeliverException, InterruptedException {
+ Message messageIn = MessageFactory.getInstance().getMessage();
+
+ // Get the aggregators message map and make sure it's empty...
+ Map<String, Map<Integer, Message>> aggrMessageMap = aggregator.getAggregatedMessageMap();
+ assertTrue(aggrMessageMap.isEmpty());
+
+ // Manually deliver the message to the splitter service...
+ splitter.process(messageIn);
+ AggregationDetails service1Message = Aggregator.getAggregatorDetails(service1Courier.messages.get(0), 0);
+ assertNotNull(service1Message);
+
+ // The aggregator timeout is 2000ms... sleep here for 3000ms to force all
+ // messages delivered to the aggregator to be timed out - should all be
+ // ignored...
+ Thread.sleep(3000);
+
+ // Manually deliver the message in service1Courier into service1...
+ service1.process(service1Courier.messages.get(0));
+
+ // Manually deliver the message in service2Courier into service2...
+ service2.process(service2Courier.messages.get(0));
+
+ // 2 messages should arrive at the aggregatorCourier...
+ assertEquals(2, aggregatorCourier.messages.size());
+
+ // Aggregators message map should be empty...
+ assertTrue(aggrMessageMap.isEmpty());
+
+ // Pump the 1st message into the aggregater...
+ aggregator.process(aggregatorCourier.messages.get(0));
+
+ // Aggregators message map should still be empty because the message should
+ // have been ignored...
+ assertTrue(aggrMessageMap.isEmpty());
+
+ // Pump the 2nd (last) message into the aggregater...
+ aggregator.process(aggregatorCourier.messages.get(1));
+
+ // Aggregators message map should still be empty because the message should
+ // have been ignored...
+ assertTrue(aggrMessageMap.isEmpty());
+ }
+
+ public void test_timed_out_some_delivered() throws RegistryException, ConfigurationException, ActionProcessingException, MessageDeliverException, InterruptedException {
+ Message messageIn = MessageFactory.getInstance().getMessage();
+
+ // Get the aggregators message map and make sure it's empty...
+ Map<String, Map<Integer, Message>> aggrMessageMap = aggregator.getAggregatedMessageMap();
+ assertTrue(aggrMessageMap.isEmpty());
+
+ // Manually deliver the message to the splitter service...
+ splitter.process(messageIn);
+ AggregationDetails service1Message = Aggregator.getAggregatorDetails(service1Courier.messages.get(0), 0);
+ assertNotNull(service1Message);
+
+ // Manually deliver the message in service1Courier into service1...
+ service1.process(service1Courier.messages.get(0));
+
+ // 1 messages should arrive at the aggregatorCourier...
+ assertEquals(1, aggregatorCourier.messages.size());
+
+ // Aggregators message map should be empty...
+ assertTrue(aggrMessageMap.isEmpty());
+
+ // Pump the 1st message into the aggregater and make sure it's
+ // details are added properly to the map...
+ aggregator.process(aggregatorCourier.messages.get(0));
+ assertService1MessageDetailsOK(aggrMessageMap, service1Message);
+
+ // The deadServiceCourier should be empty...
+ assertEquals(0, dlqServiceCourier.messages.size());
+
+ // The aggregator timeout is 2000ms... sleep here for 3000ms to force the 2nd
+ // message delivered to the aggregator to be timed out...
+ Thread.sleep(3000);
+
+ // Should have timed out and "notified" on the first message...
+ assertEquals(1, dlqServiceCourier.messages.size());
+ // Aggregators message map should be empty again...
+ assertTrue(aggrMessageMap.isEmpty());
+
+ // Manually deliver the message in service2Courier into service2...
+ service2.process(service2Courier.messages.get(0));
+
+ // 2 messages should be at the aggregatorCourier...
+ assertEquals(2, aggregatorCourier.messages.size());
+
+ // Pump the 2nd message into the aggregater...
+ Message aggregateMessage = aggregator.process(aggregatorCourier.messages.get(1));
+ assertNull(aggregateMessage);
+
+ // Aggregators message map should be empty because the message should
+ // have been ignored...
+ assertTrue(aggrMessageMap.isEmpty());
+ }
+
+ public void test_timeoutchecker() throws RegistryException, ConfigurationException, ActionProcessingException, MessageDeliverException, InterruptedException {
+ Message messageIn = MessageFactory.getInstance().getMessage();
+
+ // Get the aggregators message map and make sure it's empty...
+ Map<String, Map<Integer, Message>> aggrMessageMap = aggregator.getAggregatedMessageMap();
+ assertTrue(aggrMessageMap.isEmpty());
+
+ // Manually deliver the message to the splitter service...
+ splitter.process(messageIn);
+ AggregationDetails service1Message = Aggregator.getAggregatorDetails(service1Courier.messages.get(0), 0);
+ assertNotNull(service1Message);
+
+ // Manually deliver the message in service1Courier into service1...
+ service1.process(service1Courier.messages.get(0));
+
+ // 1 messages should arrive at the aggregatorCourier...
+ assertEquals(1, aggregatorCourier.messages.size());
+
+ // Aggregators message map should be empty...
+ assertTrue(aggrMessageMap.isEmpty());
+
+ // Pump the message into the aggregater and make sure it's
+ // details are added properly to the map...
+ aggregator.process(aggregatorCourier.messages.get(0));
+ assertService1MessageDetailsOK(aggrMessageMap, service1Message);
+
+ // The aggregator timeout is 2000ms... sleep here for 3000ms...
+ Thread.sleep(4000);
+
+ // Aggregators message map should be empty because the message should
+ // have timed out...
+ assertTrue("Message didn't get removed from map after timeout", aggrMessageMap.isEmpty());
+ }
+
+ private void assertService1MessageDetailsOK(Map<String, Map<Integer, Message>> aggrMessageMap, AggregationDetails service1Message) {
+ // Aggregators message map should have 1 entry for the above message...
+ assertEquals(1, aggrMessageMap.size());
+ Map<Integer, Message> messageSeries = aggrMessageMap.get(service1Message.getSeriesUuid());
+ assertNotNull(messageSeries);
+ assertTrue(messageSeries.get(service1Message.getMessageNumber()) != null);
+ }
+}
\ No newline at end of file
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/JBESB_1204_1331_UnitTest.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/JBESB_1204_1331_UnitTest.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/JBESB_1204_1331_UnitTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -1,168 +0,0 @@
-/*
- Milyn - Copyright (C) 2006
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License (version 2.1) as published by the Free Software
- Foundation.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
- See the GNU Lesser General Public License for more details:
- http://www.gnu.org/licenses/lgpl.txt
-*/
-package org.jboss.soa.esb.actions.aggregation;
-
-import junit.framework.TestCase;
-import org.jboss.internal.soa.esb.couriers.MockCourierFactory;
-import org.jboss.internal.soa.esb.services.registry.MockRegistry;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.listeners.message.MessageDeliverException;
-import org.jboss.soa.esb.actions.*;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-import org.jboss.soa.esb.services.registry.RegistryException;
-import org.jboss.soa.esb.testutils.ESBConfigUtil;
-
-import java.util.List;
-
-/**
- * Tests for JBESB-1204 and JBESB-1331 re aggrgation tag infos.
- * <p/>
- * Make sure the message aggregation info flows in the following scenario...
- * <pre>
- *
- * |----- service1 -----|
- * | |
- * splitter --| |-- aggregator
- * | |
- * |----- service2 -----|
- *
- * </pre>
- *
- * @author <a href="mailto:tom.fennelly at gmail.com">tom.fennelly at gmail.com</a>
- */
-public class JBESB_1204_1331_UnitTest extends TestCase {
-
- private TestCourier service1Courier;
- private TestCourier service2Courier;
- private TestCourier aggregatorCourier;
-
- private StaticRouter splitter;
- private StaticRouter service1;
- private StaticRouter service2;
- private Aggregator aggregator;
-
- protected void setUp() throws Exception {
- MockCourierFactory.install();
- MockRegistry.install();
-
- service1Courier = new TestCourier();
- service2Courier = new TestCourier();
- aggregatorCourier = new TestCourier();
-
- MockRegistry.register("test", "service1", service1Courier);
- MockRegistry.register("test", "service2", service2Courier);
- MockRegistry.register("test", "aggregator", aggregatorCourier);
-
- initaliseServices();
- }
-
- private void initaliseServices() throws ConfigurationException, RegistryException, ActionLifecycleException {
- ESBConfigUtil esbConfig = new ESBConfigUtil(getClass().getResourceAsStream("action-configs-01.xml"));
- ConfigTree splitterConfig = esbConfig.getActionConfig("null-listener", "splitter1-action");
- ConfigTree service1Config = esbConfig.getActionConfig("null-listener", "service1-config");
- ConfigTree service2Config = esbConfig.getActionConfig("null-listener", "service2-config");
- ConfigTree aggregatorConfig = esbConfig.getActionConfig("null-listener", "aggregator-config");
-
- splitter = new StaticRouter(splitterConfig);
- splitter.initialise();
- service1 = new StaticRouter(service1Config);
- service1.initialise();
- service2 = new StaticRouter(service2Config);
- service2.initialise();
- aggregator = new Aggregator(aggregatorConfig);
- aggregator.initialise();
- }
-
- protected void tearDown() throws Exception {
- splitter.destroy();
- service1.destroy();
- service2.destroy();
- aggregator.destroy();
- MockRegistry.uninstall();
- MockCourierFactory.uninstall();
- }
-
- public void test() throws RegistryException, ConfigurationException, ActionProcessingException, MessageDeliverException {
- Message messageIn = MessageFactory.getInstance().getMessage();
- List<String> aggrTags;
- AggregationDetails aggrDetailsS1;
- AggregationDetails aggrDetailsS2;
- AggregationDetails aggrDetailsAggrM1;
- AggregationDetails aggrDetailsAggrM2;
-
- // Manually deliver the message to the splitter service...
- splitter.process(messageIn);
-
- // There should be 2 msssages delivered.. one to service1 and one service2...
- assertEquals(1, service1Courier.messages.size());
- assertEquals(1, service2Courier.messages.size());
-
- // The 2 messages should each have 1 aggregation info string (no more)...
- aggrTags = Aggregator.getAggregatorTags(service1Courier.messages.get(0));
- assertEquals(1, aggrTags.size());
- aggrDetailsS1 = new AggregationDetails(aggrTags.get(0));
- aggrTags = Aggregator.getAggregatorTags(service2Courier.messages.get(0));
- assertEquals(1, aggrTags.size());
- aggrDetailsS2 = new AggregationDetails(aggrTags.get(0));
-
- // Manually deliver the message in service1Courier into service1...
- service1.process(service1Courier.messages.get(0));
-
- // Manually deliver the message in service2Courier into service2...
- service2.process(service2Courier.messages.get(0));
-
- // 2 messages should arrive at the aggregatorCourier...
- assertEquals(2, aggregatorCourier.messages.size());
-
- // Extract aggr details from first message...
- aggrTags = Aggregator.getAggregatorTags(aggregatorCourier.messages.get(0));
- assertEquals(1, aggrTags.size());
- aggrDetailsAggrM1 = new AggregationDetails(aggrTags.get(0));
-
- // Extract aggr details from second message...
- aggrTags = Aggregator.getAggregatorTags(aggregatorCourier.messages.get(1));
- assertEquals(1, aggrTags.size());
- aggrDetailsAggrM2 = new AggregationDetails(aggrTags.get(0));
-
- // make sure all the UUIDs match...
- assertEquals(aggrDetailsS1.getSeriesUuid(), aggrDetailsS2.getSeriesUuid());
- assertEquals(aggrDetailsS2.getSeriesUuid(), aggrDetailsAggrM1.getSeriesUuid());
- assertEquals(aggrDetailsAggrM1.getSeriesUuid(), aggrDetailsAggrM2.getSeriesUuid());
-
- // make sure all the timestamps match...
- assertEquals(aggrDetailsS1.getSeriesTimestamp(), aggrDetailsS2.getSeriesTimestamp());
- assertEquals(aggrDetailsS2.getSeriesTimestamp(), aggrDetailsAggrM1.getSeriesTimestamp());
- assertEquals(aggrDetailsAggrM1.getSeriesTimestamp(), aggrDetailsAggrM2.getSeriesTimestamp());
-
- // make sure the series size matches...
- assertEquals(aggrDetailsS1.getSeriesSize(), aggrDetailsS2.getSeriesSize());
- assertEquals(aggrDetailsS2.getSeriesSize(), aggrDetailsAggrM1.getSeriesSize());
- assertEquals(aggrDetailsAggrM1.getSeriesSize(), aggrDetailsAggrM2.getSeriesSize());
-
- // make sure the message num's don't match, and that they're 1 or 2...
- assertNotSame(aggrDetailsAggrM1.getMessageNumber(), aggrDetailsAggrM2.getMessageNumber());
- assertTrue(aggrDetailsAggrM1.getMessageNumber() == 1 || aggrDetailsAggrM1.getMessageNumber() == 2);
- assertTrue(aggrDetailsAggrM2.getMessageNumber() == 1 || aggrDetailsAggrM2.getMessageNumber() == 2);
-
- // make sure the splitId matches...
- assertEquals("splitter1-action", aggrDetailsS1.getSplitId());
- assertEquals(aggrDetailsS1.getSplitId(), aggrDetailsS2.getSplitId());
- assertEquals(aggrDetailsS2.getSplitId(), aggrDetailsAggrM1.getSplitId());
- assertEquals(aggrDetailsAggrM1.getSplitId(), aggrDetailsAggrM2.getSplitId());
- }
-}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/JBESB_1204_1331_UnitTest.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/JBESB_1204_1331_UnitTest.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/JBESB_1204_1331_UnitTest.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/JBESB_1204_1331_UnitTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,168 @@
+/*
+ Milyn - Copyright (C) 2006
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License (version 2.1) as published by the Free Software
+ Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ See the GNU Lesser General Public License for more details:
+ http://www.gnu.org/licenses/lgpl.txt
+*/
+package org.jboss.soa.esb.actions.aggregation;
+
+import junit.framework.TestCase;
+import org.jboss.internal.soa.esb.couriers.MockCourierFactory;
+import org.jboss.internal.soa.esb.services.registry.MockRegistry;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.listeners.message.MessageDeliverException;
+import org.jboss.soa.esb.actions.*;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.services.registry.RegistryException;
+import org.jboss.soa.esb.testutils.ESBConfigUtil;
+
+import java.util.List;
+
+/**
+ * Tests for JBESB-1204 and JBESB-1331 re aggrgation tag infos.
+ * <p/>
+ * Make sure the message aggregation info flows in the following scenario...
+ * <pre>
+ *
+ * |----- service1 -----|
+ * | |
+ * splitter --| |-- aggregator
+ * | |
+ * |----- service2 -----|
+ *
+ * </pre>
+ *
+ * @author <a href="mailto:tom.fennelly at gmail.com">tom.fennelly at gmail.com</a>
+ */
+public class JBESB_1204_1331_UnitTest extends TestCase {
+
+ private TestCourier service1Courier;
+ private TestCourier service2Courier;
+ private TestCourier aggregatorCourier;
+
+ private StaticRouter splitter;
+ private StaticRouter service1;
+ private StaticRouter service2;
+ private Aggregator aggregator;
+
+ protected void setUp() throws Exception {
+ MockCourierFactory.install();
+ MockRegistry.install();
+
+ service1Courier = new TestCourier();
+ service2Courier = new TestCourier();
+ aggregatorCourier = new TestCourier();
+
+ MockRegistry.register("test", "service1", service1Courier);
+ MockRegistry.register("test", "service2", service2Courier);
+ MockRegistry.register("test", "aggregator", aggregatorCourier);
+
+ initaliseServices();
+ }
+
+ private void initaliseServices() throws ConfigurationException, RegistryException, ActionLifecycleException {
+ ESBConfigUtil esbConfig = new ESBConfigUtil(getClass().getResourceAsStream("action-configs-01.xml"));
+ ConfigTree splitterConfig = esbConfig.getActionConfig("null-listener", "splitter1-action");
+ ConfigTree service1Config = esbConfig.getActionConfig("null-listener", "service1-config");
+ ConfigTree service2Config = esbConfig.getActionConfig("null-listener", "service2-config");
+ ConfigTree aggregatorConfig = esbConfig.getActionConfig("null-listener", "aggregator-config");
+
+ splitter = new StaticRouter(splitterConfig);
+ splitter.initialise();
+ service1 = new StaticRouter(service1Config);
+ service1.initialise();
+ service2 = new StaticRouter(service2Config);
+ service2.initialise();
+ aggregator = new Aggregator(aggregatorConfig);
+ aggregator.initialise();
+ }
+
+ protected void tearDown() throws Exception {
+ splitter.destroy();
+ service1.destroy();
+ service2.destroy();
+ aggregator.destroy();
+ MockRegistry.uninstall();
+ MockCourierFactory.uninstall();
+ }
+
+ public void test() throws RegistryException, ConfigurationException, ActionProcessingException, MessageDeliverException {
+ Message messageIn = MessageFactory.getInstance().getMessage();
+ List<String> aggrTags;
+ AggregationDetails aggrDetailsS1;
+ AggregationDetails aggrDetailsS2;
+ AggregationDetails aggrDetailsAggrM1;
+ AggregationDetails aggrDetailsAggrM2;
+
+ // Manually deliver the message to the splitter service...
+ splitter.process(messageIn);
+
+ // There should be 2 msssages delivered.. one to service1 and one service2...
+ assertEquals(1, service1Courier.messages.size());
+ assertEquals(1, service2Courier.messages.size());
+
+ // The 2 messages should each have 1 aggregation info string (no more)...
+ aggrTags = Aggregator.getAggregatorTags(service1Courier.messages.get(0));
+ assertEquals(1, aggrTags.size());
+ aggrDetailsS1 = new AggregationDetails(aggrTags.get(0));
+ aggrTags = Aggregator.getAggregatorTags(service2Courier.messages.get(0));
+ assertEquals(1, aggrTags.size());
+ aggrDetailsS2 = new AggregationDetails(aggrTags.get(0));
+
+ // Manually deliver the message in service1Courier into service1...
+ service1.process(service1Courier.messages.get(0));
+
+ // Manually deliver the message in service2Courier into service2...
+ service2.process(service2Courier.messages.get(0));
+
+ // 2 messages should arrive at the aggregatorCourier...
+ assertEquals(2, aggregatorCourier.messages.size());
+
+ // Extract aggr details from first message...
+ aggrTags = Aggregator.getAggregatorTags(aggregatorCourier.messages.get(0));
+ assertEquals(1, aggrTags.size());
+ aggrDetailsAggrM1 = new AggregationDetails(aggrTags.get(0));
+
+ // Extract aggr details from second message...
+ aggrTags = Aggregator.getAggregatorTags(aggregatorCourier.messages.get(1));
+ assertEquals(1, aggrTags.size());
+ aggrDetailsAggrM2 = new AggregationDetails(aggrTags.get(0));
+
+ // make sure all the UUIDs match...
+ assertEquals(aggrDetailsS1.getSeriesUuid(), aggrDetailsS2.getSeriesUuid());
+ assertEquals(aggrDetailsS2.getSeriesUuid(), aggrDetailsAggrM1.getSeriesUuid());
+ assertEquals(aggrDetailsAggrM1.getSeriesUuid(), aggrDetailsAggrM2.getSeriesUuid());
+
+ // make sure all the timestamps match...
+ assertEquals(aggrDetailsS1.getSeriesTimestamp(), aggrDetailsS2.getSeriesTimestamp());
+ assertEquals(aggrDetailsS2.getSeriesTimestamp(), aggrDetailsAggrM1.getSeriesTimestamp());
+ assertEquals(aggrDetailsAggrM1.getSeriesTimestamp(), aggrDetailsAggrM2.getSeriesTimestamp());
+
+ // make sure the series size matches...
+ assertEquals(aggrDetailsS1.getSeriesSize(), aggrDetailsS2.getSeriesSize());
+ assertEquals(aggrDetailsS2.getSeriesSize(), aggrDetailsAggrM1.getSeriesSize());
+ assertEquals(aggrDetailsAggrM1.getSeriesSize(), aggrDetailsAggrM2.getSeriesSize());
+
+ // make sure the message num's don't match, and that they're 1 or 2...
+ assertNotSame(aggrDetailsAggrM1.getMessageNumber(), aggrDetailsAggrM2.getMessageNumber());
+ assertTrue(aggrDetailsAggrM1.getMessageNumber() == 1 || aggrDetailsAggrM1.getMessageNumber() == 2);
+ assertTrue(aggrDetailsAggrM2.getMessageNumber() == 1 || aggrDetailsAggrM2.getMessageNumber() == 2);
+
+ // make sure the splitId matches...
+ assertEquals("splitter1-action", aggrDetailsS1.getSplitId());
+ assertEquals(aggrDetailsS1.getSplitId(), aggrDetailsS2.getSplitId());
+ assertEquals(aggrDetailsS2.getSplitId(), aggrDetailsAggrM1.getSplitId());
+ assertEquals(aggrDetailsAggrM1.getSplitId(), aggrDetailsAggrM2.getSplitId());
+ }
+}
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/Nested_Splits_UnitTest.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/Nested_Splits_UnitTest.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/Nested_Splits_UnitTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -1,237 +0,0 @@
-/*
- Milyn - Copyright (C) 2006
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License (version 2.1) as published by the Free Software
- Foundation.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
- See the GNU Lesser General Public License for more details:
- http://www.gnu.org/licenses/lgpl.txt
-*/
-package org.jboss.soa.esb.actions.aggregation;
-
-import junit.framework.TestCase;
-import org.jboss.internal.soa.esb.couriers.MockCourierFactory;
-import org.jboss.internal.soa.esb.services.registry.MockRegistry;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.actions.*;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.message.MessageDeliverException;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-import org.jboss.soa.esb.services.registry.RegistryException;
-import org.jboss.soa.esb.testutils.ESBConfigUtil;
-import org.jboss.soa.esb.util.Util;
-import org.xml.sax.SAXException;
-
-import javax.xml.parsers.ParserConfigurationException;
-import java.io.IOException;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Tests for JBESB-1204 and JBESB-1331.
- * <p/>
- * Make sure the message aggregation info flows in the following scenario...
- * <pre>
- *
- * |------------------ service1 ----------------|
- * | |
- * splitter1 --| |-- aggregator2 --
- * | |--service2--| |
- * |-- splitter2 --| |--aggregator1--|
- * |--service3--|
- *
- * </pre>
- *
- * @author <a href="mailto:tom.fennelly at gmail.com">tom.fennelly at gmail.com</a>
- */
-public class Nested_Splits_UnitTest extends TestCase {
-
- private TestCourier splitter2Courier; // no need for a courier for splitter1
- private TestCourier service1Courier;
- private TestCourier service2Courier;
- private TestCourier service3Courier;
- private TestCourier aggregator1Courier;
- private TestCourier aggregator2Courier;
-
- private StaticRouter splitter1;
- private StaticRouter splitter2;
- private StaticRouter service1;
- private StaticRouter service2;
- private StaticRouter service3;
- private Aggregator aggregator1;
- private Aggregator aggregator2;
- private Aggregator aggregator3;
-
- protected void setUp() throws Exception {
- MockCourierFactory.install();
- MockRegistry.install();
-
- splitter2Courier = new TestCourier();
- service1Courier = new TestCourier();
- service2Courier = new TestCourier();
- service3Courier = new TestCourier();
- aggregator1Courier = new TestCourier();
- aggregator2Courier = new TestCourier();
-
- MockRegistry.register("test", "splitter2", splitter2Courier);
- MockRegistry.register("test", "service1", service1Courier);
- MockRegistry.register("test", "service2", service2Courier);
- MockRegistry.register("test", "service3", service3Courier);
- MockRegistry.register("test", "aggregator1", aggregator1Courier);
- MockRegistry.register("test", "aggregator2", aggregator2Courier);
-
- initaliseServices();
- }
-
- private void initaliseServices() throws ConfigurationException, RegistryException, ActionLifecycleException {
- ESBConfigUtil esbConfig = new ESBConfigUtil(getClass().getResourceAsStream("action-configs-02.xml"));
- ConfigTree splitter1Config = esbConfig.getActionConfig("null-listener", "splitter1-action");
- ConfigTree splitter2Config = esbConfig.getActionConfig("null-listener", "splitter2-action");
- ConfigTree service1Config = esbConfig.getActionConfig("null-listener", "service1-config");
- ConfigTree service2Config = esbConfig.getActionConfig("null-listener", "service2-config");
- ConfigTree service3Config = esbConfig.getActionConfig("null-listener", "service3-config");
- ConfigTree aggregator1Config = esbConfig.getActionConfig("null-listener", "aggregator1-config");
- ConfigTree aggregator2Config = esbConfig.getActionConfig("null-listener", "aggregator2-config");
- ConfigTree aggregator3Config = esbConfig.getActionConfig("null-listener", "aggregator3-config");
-
- splitter1 = new StaticRouter(splitter1Config);
- splitter1.initialise();
- splitter2 = new StaticRouter(splitter2Config);
- splitter2.initialise();
- service1 = new StaticRouter(service1Config);
- service1.initialise();
- service2 = new StaticRouter(service2Config);
- service2.initialise();
- service3 = new StaticRouter(service3Config);
- service3.initialise();
- aggregator1 = new Aggregator(aggregator1Config);
- aggregator1.initialise();
- aggregator2 = new Aggregator(aggregator2Config);
- aggregator2.initialise();
- aggregator3 = new Aggregator(aggregator3Config);
- aggregator3.initialise();
- }
-
- protected void tearDown() throws Exception {
- splitter1.destroy();
- service1.destroy();
- service2.destroy();
- aggregator1.destroy();
- MockRegistry.uninstall();
- MockCourierFactory.uninstall();
- }
-
- /**
- * |------------------ service1 ----------------|
- * | |
- * splitter1 --| |-- aggregator2 --
- * | |--service2--| |
- * |-- splitter2 --| |--aggregator1--|
- * |--service3--|
- */
- public void test_nested_split() throws RegistryException, ConfigurationException, ActionProcessingException, MessageDeliverException, IOException, SAXException, ParserConfigurationException {
- Message messageIn = MessageFactory.getInstance().getMessage();
-
- // Manually deliver the message to the splitter1 service...
- splitter1.process(messageIn);
- AggregationDetails service1Message = Aggregator.getAggregatorDetails(service1Courier.messages.get(0), 0);
- assertNotNull(service1Message);
-
- // Manually deliver the message in service1Courier into service1...
- service1.process(service1Courier.messages.get(0));
-
- // Manually deliver the message in splitter2Courier into splitter2...
- splitter2.process(splitter2Courier.messages.get(0));
- AggregationDetails service2Message = Aggregator.getAggregatorDetails(service2Courier.messages.get(0), 0);
- assertNotNull(service2Message);
-
- // Manually deliver the message in aggregator2Courier into aggregator2 (this is the message from service1)...
- aggregator2.process(aggregator2Courier.messages.get(0));
-
- // Manually deliver the message in service2Courier into service2...
- service2.process(service2Courier.messages.get(0));
-
- // Manually deliver the message in service3Courier into service3...
- service3.process(service3Courier.messages.get(0));
-
- // aggregator1Courier should have 2 messages in it... one from service2
- // and one from service3...
- assertEquals(2, aggregator1Courier.messages.size());
-
- // Should be 2 aggrTags before aggregation...
- List<String> aggrTags = Aggregator.getAggregatorTags(aggregator1Courier.messages.get(1));
- assertEquals(2, aggrTags.size());
-
- // Manually deliver the 2 messages to aggregator1...
- aggregator1.process(aggregator1Courier.messages.get(0));
- Message aggregator1Message = aggregator1.process(aggregator1Courier.messages.get(1));
- assertNoAggregationTags(aggregator1Courier.messages.get(0));
- assertNoAggregationTags(aggregator1Courier.messages.get(1));
- aggrTags = Aggregator.getAggregatorTags(aggregator1Message);
- assertEquals(1, aggrTags.size());
- AggregationDetails aggregator1MessageAggrDetails = Aggregator.getAggregatorDetails(aggregator1Message, 0);
- assertEquals(service1Message.getSeriesUuid(), aggregator1MessageAggrDetails.getSeriesUuid());
-
- // Manually deliver the aggregator1Message to aggregator2...
- Message aggregator2Message = aggregator2.process(aggregator1Message);
- assertNoAggregationTags(aggregator1Message);
- assertEquals(2, aggregator2Message.getAttachment().getUnnamedCount());
- Message message1 = Util.deserialize((Serializable) aggregator2Message.getAttachment().itemAt(0));
- assertNoAggregationTags(message1);
- Message message2 = Util.deserialize((Serializable) aggregator2Message.getAttachment().itemAt(1));
- assertNoAggregationTags(message2);
- }
-
- public void test_splitIds() throws ActionProcessingException {
- // Should be allowed to pump messages with diff splitIds into aggregator2
- // because there's no splitId set on it...
- test_splitIds(aggregator2, "splitId-1", "splitId-2");
-
- // Should get an error if I try the same with aggregator 3, coz it has
- // a "splitId" set on it...
- try {
- test_splitIds(aggregator3, "splitId-x", "splitId-y");
- fail("Expected ActionProcessingException");
- } catch (ActionProcessingException e) {
- assertEquals("Invalid aggregation config on aggregator 'aggregator3-config' . This aggregator is configured to only aggregate message with an aggregation 'spliId' of 'splitId1'. The splitId on the received message is 'splitId-x'. A nested aggregation point may be missing, or may have been bypassed.", e.getMessage());
- }
-
- // The following should work because the splitIds match the split ID on
- // aggregator3's config (see action-configs-02.xml).
- test_splitIds(aggregator3, "splitId1", "splitId1");
-
- }
-
- private void test_splitIds(Aggregator aggregator, String splitId1, String splitId2) throws ActionProcessingException {
- Message messageIn = MessageFactory.getInstance().getMessage();
- AggregationDetails aggrDetails;
- List<String> aggrTags = new ArrayList<String>();
-
- aggrDetails = new AggregationDetails("xx", 1, 2, 123123);
- aggrDetails.setSplitId(splitId1);
- aggrTags.add(aggrDetails.toString());
- Aggregator.setAggregatorTags(messageIn, aggrTags);
- aggregator.process(messageIn);
-
- aggrDetails = new AggregationDetails("cc", 1, 2, 123123);
- aggrDetails.setSplitId(splitId1);
- aggrTags.add(aggrDetails.toString());
- Aggregator.setAggregatorTags(messageIn, aggrTags);
- aggregator.process(messageIn);
-
- }
-
- private void assertNoAggregationTags(Message aggregator1Message) {
- List<String> aggrTags;
- aggrTags = Aggregator.getAggregatorTags(aggregator1Message);
- assertNull(aggrTags);
- }
-}
\ No newline at end of file
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/Nested_Splits_UnitTest.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/Nested_Splits_UnitTest.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/Nested_Splits_UnitTest.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/Nested_Splits_UnitTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,237 @@
+/*
+ Milyn - Copyright (C) 2006
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License (version 2.1) as published by the Free Software
+ Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ See the GNU Lesser General Public License for more details:
+ http://www.gnu.org/licenses/lgpl.txt
+*/
+package org.jboss.soa.esb.actions.aggregation;
+
+import junit.framework.TestCase;
+import org.jboss.internal.soa.esb.couriers.MockCourierFactory;
+import org.jboss.internal.soa.esb.services.registry.MockRegistry;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.actions.*;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.message.MessageDeliverException;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.services.registry.RegistryException;
+import org.jboss.soa.esb.testutils.ESBConfigUtil;
+import org.jboss.soa.esb.util.Util;
+import org.xml.sax.SAXException;
+
+import javax.xml.parsers.ParserConfigurationException;
+import java.io.IOException;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Tests for JBESB-1204 and JBESB-1331.
+ * <p/>
+ * Make sure the message aggregation info flows in the following scenario...
+ * <pre>
+ *
+ * |------------------ service1 ----------------|
+ * | |
+ * splitter1 --| |-- aggregator2 --
+ * | |--service2--| |
+ * |-- splitter2 --| |--aggregator1--|
+ * |--service3--|
+ *
+ * </pre>
+ *
+ * @author <a href="mailto:tom.fennelly at gmail.com">tom.fennelly at gmail.com</a>
+ */
+public class Nested_Splits_UnitTest extends TestCase {
+
+ private TestCourier splitter2Courier; // no need for a courier for splitter1
+ private TestCourier service1Courier;
+ private TestCourier service2Courier;
+ private TestCourier service3Courier;
+ private TestCourier aggregator1Courier;
+ private TestCourier aggregator2Courier;
+
+ private StaticRouter splitter1;
+ private StaticRouter splitter2;
+ private StaticRouter service1;
+ private StaticRouter service2;
+ private StaticRouter service3;
+ private Aggregator aggregator1;
+ private Aggregator aggregator2;
+ private Aggregator aggregator3;
+
+ protected void setUp() throws Exception {
+ MockCourierFactory.install();
+ MockRegistry.install();
+
+ splitter2Courier = new TestCourier();
+ service1Courier = new TestCourier();
+ service2Courier = new TestCourier();
+ service3Courier = new TestCourier();
+ aggregator1Courier = new TestCourier();
+ aggregator2Courier = new TestCourier();
+
+ MockRegistry.register("test", "splitter2", splitter2Courier);
+ MockRegistry.register("test", "service1", service1Courier);
+ MockRegistry.register("test", "service2", service2Courier);
+ MockRegistry.register("test", "service3", service3Courier);
+ MockRegistry.register("test", "aggregator1", aggregator1Courier);
+ MockRegistry.register("test", "aggregator2", aggregator2Courier);
+
+ initaliseServices();
+ }
+
+ private void initaliseServices() throws ConfigurationException, RegistryException, ActionLifecycleException {
+ ESBConfigUtil esbConfig = new ESBConfigUtil(getClass().getResourceAsStream("action-configs-02.xml"));
+ ConfigTree splitter1Config = esbConfig.getActionConfig("null-listener", "splitter1-action");
+ ConfigTree splitter2Config = esbConfig.getActionConfig("null-listener", "splitter2-action");
+ ConfigTree service1Config = esbConfig.getActionConfig("null-listener", "service1-config");
+ ConfigTree service2Config = esbConfig.getActionConfig("null-listener", "service2-config");
+ ConfigTree service3Config = esbConfig.getActionConfig("null-listener", "service3-config");
+ ConfigTree aggregator1Config = esbConfig.getActionConfig("null-listener", "aggregator1-config");
+ ConfigTree aggregator2Config = esbConfig.getActionConfig("null-listener", "aggregator2-config");
+ ConfigTree aggregator3Config = esbConfig.getActionConfig("null-listener", "aggregator3-config");
+
+ splitter1 = new StaticRouter(splitter1Config);
+ splitter1.initialise();
+ splitter2 = new StaticRouter(splitter2Config);
+ splitter2.initialise();
+ service1 = new StaticRouter(service1Config);
+ service1.initialise();
+ service2 = new StaticRouter(service2Config);
+ service2.initialise();
+ service3 = new StaticRouter(service3Config);
+ service3.initialise();
+ aggregator1 = new Aggregator(aggregator1Config);
+ aggregator1.initialise();
+ aggregator2 = new Aggregator(aggregator2Config);
+ aggregator2.initialise();
+ aggregator3 = new Aggregator(aggregator3Config);
+ aggregator3.initialise();
+ }
+
+ protected void tearDown() throws Exception {
+ splitter1.destroy();
+ service1.destroy();
+ service2.destroy();
+ aggregator1.destroy();
+ MockRegistry.uninstall();
+ MockCourierFactory.uninstall();
+ }
+
+ /**
+ * |------------------ service1 ----------------|
+ * | |
+ * splitter1 --| |-- aggregator2 --
+ * | |--service2--| |
+ * |-- splitter2 --| |--aggregator1--|
+ * |--service3--|
+ */
+ public void test_nested_split() throws RegistryException, ConfigurationException, ActionProcessingException, MessageDeliverException, IOException, SAXException, ParserConfigurationException {
+ Message messageIn = MessageFactory.getInstance().getMessage();
+
+ // Manually deliver the message to the splitter1 service...
+ splitter1.process(messageIn);
+ AggregationDetails service1Message = Aggregator.getAggregatorDetails(service1Courier.messages.get(0), 0);
+ assertNotNull(service1Message);
+
+ // Manually deliver the message in service1Courier into service1...
+ service1.process(service1Courier.messages.get(0));
+
+ // Manually deliver the message in splitter2Courier into splitter2...
+ splitter2.process(splitter2Courier.messages.get(0));
+ AggregationDetails service2Message = Aggregator.getAggregatorDetails(service2Courier.messages.get(0), 0);
+ assertNotNull(service2Message);
+
+ // Manually deliver the message in aggregator2Courier into aggregator2 (this is the message from service1)...
+ aggregator2.process(aggregator2Courier.messages.get(0));
+
+ // Manually deliver the message in service2Courier into service2...
+ service2.process(service2Courier.messages.get(0));
+
+ // Manually deliver the message in service3Courier into service3...
+ service3.process(service3Courier.messages.get(0));
+
+ // aggregator1Courier should have 2 messages in it... one from service2
+ // and one from service3...
+ assertEquals(2, aggregator1Courier.messages.size());
+
+ // Should be 2 aggrTags before aggregation...
+ List<String> aggrTags = Aggregator.getAggregatorTags(aggregator1Courier.messages.get(1));
+ assertEquals(2, aggrTags.size());
+
+ // Manually deliver the 2 messages to aggregator1...
+ aggregator1.process(aggregator1Courier.messages.get(0));
+ Message aggregator1Message = aggregator1.process(aggregator1Courier.messages.get(1));
+ assertNoAggregationTags(aggregator1Courier.messages.get(0));
+ assertNoAggregationTags(aggregator1Courier.messages.get(1));
+ aggrTags = Aggregator.getAggregatorTags(aggregator1Message);
+ assertEquals(1, aggrTags.size());
+ AggregationDetails aggregator1MessageAggrDetails = Aggregator.getAggregatorDetails(aggregator1Message, 0);
+ assertEquals(service1Message.getSeriesUuid(), aggregator1MessageAggrDetails.getSeriesUuid());
+
+ // Manually deliver the aggregator1Message to aggregator2...
+ Message aggregator2Message = aggregator2.process(aggregator1Message);
+ assertNoAggregationTags(aggregator1Message);
+ assertEquals(2, aggregator2Message.getAttachment().getUnnamedCount());
+ Message message1 = Util.deserialize((Serializable) aggregator2Message.getAttachment().itemAt(0));
+ assertNoAggregationTags(message1);
+ Message message2 = Util.deserialize((Serializable) aggregator2Message.getAttachment().itemAt(1));
+ assertNoAggregationTags(message2);
+ }
+
+ public void test_splitIds() throws ActionProcessingException {
+ // Should be allowed to pump messages with diff splitIds into aggregator2
+ // because there's no splitId set on it...
+ test_splitIds(aggregator2, "splitId-1", "splitId-2");
+
+ // Should get an error if I try the same with aggregator 3, coz it has
+ // a "splitId" set on it...
+ try {
+ test_splitIds(aggregator3, "splitId-x", "splitId-y");
+ fail("Expected ActionProcessingException");
+ } catch (ActionProcessingException e) {
+ assertEquals("Invalid aggregation config on aggregator 'aggregator3-config' . This aggregator is configured to only aggregate message with an aggregation 'spliId' of 'splitId1'. The splitId on the received message is 'splitId-x'. A nested aggregation point may be missing, or may have been bypassed.", e.getMessage());
+ }
+
+ // The following should work because the splitIds match the split ID on
+ // aggregator3's config (see action-configs-02.xml).
+ test_splitIds(aggregator3, "splitId1", "splitId1");
+
+ }
+
+ private void test_splitIds(Aggregator aggregator, String splitId1, String splitId2) throws ActionProcessingException {
+ Message messageIn = MessageFactory.getInstance().getMessage();
+ AggregationDetails aggrDetails;
+ List<String> aggrTags = new ArrayList<String>();
+
+ aggrDetails = new AggregationDetails("xx", 1, 2, 123123);
+ aggrDetails.setSplitId(splitId1);
+ aggrTags.add(aggrDetails.toString());
+ Aggregator.setAggregatorTags(messageIn, aggrTags);
+ aggregator.process(messageIn);
+
+ aggrDetails = new AggregationDetails("cc", 1, 2, 123123);
+ aggrDetails.setSplitId(splitId1);
+ aggrTags.add(aggrDetails.toString());
+ Aggregator.setAggregatorTags(messageIn, aggrTags);
+ aggregator.process(messageIn);
+
+ }
+
+ private void assertNoAggregationTags(Message aggregator1Message) {
+ List<String> aggrTags;
+ aggrTags = Aggregator.getAggregatorTags(aggregator1Message);
+ assertNull(aggrTags);
+ }
+}
\ No newline at end of file
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/TestCourier.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/TestCourier.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/TestCourier.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -1,56 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006, JBoss Inc.
- */
-package org.jboss.soa.esb.actions.aggregation;
-
-import org.jboss.internal.soa.esb.couriers.MockCourier;
-import org.jboss.internal.soa.esb.message.format.xml.MessageImpl;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.tests.XMLMessageUnitTest;
-import org.jboss.soa.esb.couriers.CourierException;
-import org.jboss.soa.esb.addressing.MalformedEPRException;
-
-import java.util.List;
-import java.util.ArrayList;
-
-import junit.framework.Assert;
-
-/**
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
-*/
-class TestCourier extends MockCourier {
-
- public List<Message> messages = new ArrayList<Message>();
-
- public TestCourier() {
- super(true);
- }
-
- public boolean deliver(Message message) throws CourierException, MalformedEPRException {
- try {
- String xmlRepresentation = XMLMessageUnitTest.msgToXML((MessageImpl)message);
- messages.add(XMLMessageUnitTest.msgFromXML(xmlRepresentation));
- return true;
- } catch(Exception e) {
- e.printStackTrace();
- Assert.fail(e.getMessage());
- }
- return false;
- }
-}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/TestCourier.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/TestCourier.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/TestCourier.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/TestCourier.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.actions.aggregation;
+
+import org.jboss.internal.soa.esb.couriers.MockCourier;
+import org.jboss.internal.soa.esb.message.format.xml.MessageImpl;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.tests.XMLMessageUnitTest;
+import org.jboss.soa.esb.couriers.CourierException;
+import org.jboss.soa.esb.addressing.MalformedEPRException;
+
+import java.util.List;
+import java.util.ArrayList;
+
+import junit.framework.Assert;
+
+/**
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+*/
+class TestCourier extends MockCourier {
+
+ public List<Message> messages = new ArrayList<Message>();
+
+ public TestCourier() {
+ super(true);
+ }
+
+ public boolean deliver(Message message) throws CourierException, MalformedEPRException {
+ try {
+ String xmlRepresentation = XMLMessageUnitTest.msgToXML((MessageImpl)message);
+ messages.add(XMLMessageUnitTest.msgFromXML(xmlRepresentation));
+ return true;
+ } catch(Exception e) {
+ e.printStackTrace();
+ Assert.fail(e.getMessage());
+ }
+ return false;
+ }
+}
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/action-configs-01.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/action-configs-01.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/action-configs-01.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -1,43 +0,0 @@
-<?xml version = "1.0" encoding = "UTF-8"?>
-<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">
-
- <providers>
- <bus-provider name="null"><bus busid="null"/></bus-provider>
- </providers>
-
- <services>
- <service category="MessageRouting" name="SplitterService" description="Sends messages to N destinations">
-
- <listeners>
- <listener name="null-listener" busidref="null" />
- </listeners>
-
- <actions>
-
- <action name="splitter1-action" class="org.jboss.soa.esb.actions.StaticRouter">
- <property name="destinations">
- <route-to service-category="test" service-name="service1"/>
- <route-to service-category="test" service-name="service2"/>
- </property>
- </action>
-
- <action name="service1-config" class="org.jboss.soa.esb.actions.StaticRouter">
- <property name="destinations">
- <route-to service-category="test" service-name="aggregator"/>
- </property>
- </action>
-
- <action name="service2-config" class="org.jboss.soa.esb.actions.StaticRouter">
- <property name="destinations">
- <route-to service-category="test" service-name="aggregator"/>
- </property>
- </action>
-
- <action name="aggregator-config" class="org.jboss.soa.esb.actions.Aggregator">
- <property name="timeoutInMillies" value="2000"/>
- </action>
-
- </actions>
- </service>
- </services>
-</jbossesb>
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/action-configs-01.xml (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/action-configs-01.xml)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/action-configs-01.xml (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/action-configs-01.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,43 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">
+
+ <providers>
+ <bus-provider name="null"><bus busid="null"/></bus-provider>
+ </providers>
+
+ <services>
+ <service category="MessageRouting" name="SplitterService" description="Sends messages to N destinations">
+
+ <listeners>
+ <listener name="null-listener" busidref="null" />
+ </listeners>
+
+ <actions>
+
+ <action name="splitter1-action" class="org.jboss.soa.esb.actions.StaticRouter">
+ <property name="destinations">
+ <route-to service-category="test" service-name="service1"/>
+ <route-to service-category="test" service-name="service2"/>
+ </property>
+ </action>
+
+ <action name="service1-config" class="org.jboss.soa.esb.actions.StaticRouter">
+ <property name="destinations">
+ <route-to service-category="test" service-name="aggregator"/>
+ </property>
+ </action>
+
+ <action name="service2-config" class="org.jboss.soa.esb.actions.StaticRouter">
+ <property name="destinations">
+ <route-to service-category="test" service-name="aggregator"/>
+ </property>
+ </action>
+
+ <action name="aggregator-config" class="org.jboss.soa.esb.actions.Aggregator">
+ <property name="timeoutInMillies" value="2000"/>
+ </action>
+
+ </actions>
+ </service>
+ </services>
+</jbossesb>
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/action-configs-02.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/action-configs-02.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/action-configs-02.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -1,66 +0,0 @@
-<?xml version = "1.0" encoding = "UTF-8"?>
-<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">
-
- <providers>
- <bus-provider name="null"><bus busid="null"/></bus-provider>
- </providers>
-
- <services>
- <service category="MessageRouting" name="SplitterService" description="Sends messages to N destinations">
-
- <listeners>
- <listener name="null-listener" busidref="null" />
- </listeners>
-
- <actions>
-
- <action name="splitter1-action" class="org.jboss.soa.esb.actions.StaticRouter">
- <property name="destinations">
- <route-to service-category="test" service-name="service1"/>
- <route-to service-category="test" service-name="splitter2"/>
- </property>
- </action>
-
- <action name="splitter2-action" class="org.jboss.soa.esb.actions.StaticRouter">
- <property name="destinations">
- <route-to service-category="test" service-name="service2"/>
- <route-to service-category="test" service-name="service3"/>
- </property>
- </action>
-
- <action name="service1-config" class="org.jboss.soa.esb.actions.StaticRouter">
- <property name="destinations">
- <route-to service-category="test" service-name="aggregator2"/>
- </property>
- </action>
-
- <action name="service2-config" class="org.jboss.soa.esb.actions.StaticRouter">
- <property name="destinations">
- <route-to service-category="test" service-name="aggregator1"/>
- </property>
- </action>
-
- <action name="service3-config" class="org.jboss.soa.esb.actions.StaticRouter">
- <property name="destinations">
- <route-to service-category="test" service-name="aggregator1"/>
- </property>
- </action>
-
- <action name="aggregator1-config" class="org.jboss.soa.esb.actions.Aggregator">
- <property name="timeoutInMillies" value="200000"/>
- </action>
-
- <action name="aggregator2-config" class="org.jboss.soa.esb.actions.Aggregator">
- <property name="timeoutInMillies" value="200000"/>
- </action>
-
- <!-- Used for splitId checking tests -->
- <action name="aggregator3-config" class="org.jboss.soa.esb.actions.Aggregator">
- <property name="timeoutInMillies" value="200000"/>
- <property name="splitId" value="splitId1"/>
- </action>
-
- </actions>
- </service>
- </services>
-</jbossesb>
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/action-configs-02.xml (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/action-configs-02.xml)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/action-configs-02.xml (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/actions/aggregation/action-configs-02.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,66 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">
+
+ <providers>
+ <bus-provider name="null"><bus busid="null"/></bus-provider>
+ </providers>
+
+ <services>
+ <service category="MessageRouting" name="SplitterService" description="Sends messages to N destinations">
+
+ <listeners>
+ <listener name="null-listener" busidref="null" />
+ </listeners>
+
+ <actions>
+
+ <action name="splitter1-action" class="org.jboss.soa.esb.actions.StaticRouter">
+ <property name="destinations">
+ <route-to service-category="test" service-name="service1"/>
+ <route-to service-category="test" service-name="splitter2"/>
+ </property>
+ </action>
+
+ <action name="splitter2-action" class="org.jboss.soa.esb.actions.StaticRouter">
+ <property name="destinations">
+ <route-to service-category="test" service-name="service2"/>
+ <route-to service-category="test" service-name="service3"/>
+ </property>
+ </action>
+
+ <action name="service1-config" class="org.jboss.soa.esb.actions.StaticRouter">
+ <property name="destinations">
+ <route-to service-category="test" service-name="aggregator2"/>
+ </property>
+ </action>
+
+ <action name="service2-config" class="org.jboss.soa.esb.actions.StaticRouter">
+ <property name="destinations">
+ <route-to service-category="test" service-name="aggregator1"/>
+ </property>
+ </action>
+
+ <action name="service3-config" class="org.jboss.soa.esb.actions.StaticRouter">
+ <property name="destinations">
+ <route-to service-category="test" service-name="aggregator1"/>
+ </property>
+ </action>
+
+ <action name="aggregator1-config" class="org.jboss.soa.esb.actions.Aggregator">
+ <property name="timeoutInMillies" value="200000"/>
+ </action>
+
+ <action name="aggregator2-config" class="org.jboss.soa.esb.actions.Aggregator">
+ <property name="timeoutInMillies" value="200000"/>
+ </action>
+
+ <!-- Used for splitId checking tests -->
+ <action name="aggregator3-config" class="org.jboss.soa.esb.actions.Aggregator">
+ <property name="timeoutInMillies" value="200000"/>
+ <property name="splitId" value="splitId1"/>
+ </action>
+
+ </actions>
+ </service>
+ </services>
+</jbossesb>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/XMLMessageUnitTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/XMLMessageUnitTest.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/XMLMessageUnitTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -22,30 +22,19 @@
package org.jboss.soa.esb.message.tests;
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.net.URL;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
import junit.framework.TestCase;
-
import org.apache.log4j.Logger;
import org.jboss.internal.soa.esb.message.format.xml.MessageImpl;
import org.jboss.soa.esb.addressing.Call;
import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.PortReference;
import org.jboss.soa.esb.addressing.eprs.*;
import org.jboss.soa.esb.message.Message;
import org.jboss.soa.esb.message.body.content.BytesBody;
import org.jboss.soa.esb.message.format.MessageFactory;
import org.jboss.soa.esb.message.format.MessageType;
-import org.w3c.dom.Document;
-import org.xml.sax.InputSource;
+import org.jboss.soa.esb.util.Util;
-import com.sun.org.apache.xml.internal.serialize.OutputFormat;
-import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
+import java.net.URL;
/**
* Unit tests for the Class class.
@@ -550,42 +539,12 @@
public static String msgToXML(final MessageImpl msg)
throws Exception
{
- final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance() ;
-
- factory.setNamespaceAware(true);
-
- final DocumentBuilder builder = factory.newDocumentBuilder() ;
- Document doc = builder.newDocument() ;
-
- doc = msg.toXML(doc) ;
-
- final StringWriter sWriter = new StringWriter() ;
- final OutputFormat format = new OutputFormat() ;
- format.setIndenting(true) ;
-
- final XMLSerializer xmlS = new XMLSerializer(sWriter, format) ;
-
- xmlS.asDOMSerializer() ;
- xmlS.serialize(doc) ;
-
- return sWriter.toString() ;
+ return (String) Util.serialize(msg);
}
public static MessageImpl msgFromXML(final String xmlRepresentation)
throws Exception
{
- final StringReader stringReader = new StringReader(xmlRepresentation) ;
- final InputSource inputSource = new InputSource(stringReader) ;
-
- final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance() ;
-
- factory.setNamespaceAware(true);
-
- final DocumentBuilder builder = factory.newDocumentBuilder() ;
- final Document doc = builder.parse(inputSource) ;
-
- final MessageImpl message = new MessageImpl() ;
- message.fromXML(doc) ;
- return message ;
+ return (MessageImpl) Util.deserialize(xmlRepresentation);
}
}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/testutils/NullAction.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/rosetta/tests/src/org/jboss/soa/esb/testutils/NullAction.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/testutils/NullAction.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/testutils/NullAction.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.testutils;
+
+import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.message.Message;
+
+/**
+ * Null action.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class NullAction extends AbstractActionPipelineProcessor {
+ public Message process(Message message) throws ActionProcessingException {
+ return null;
+ }
+}
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/util/AbstractCommandVehicleUnitTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/util/AbstractCommandVehicleUnitTest.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/util/AbstractCommandVehicleUnitTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -1,85 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.soa.esb.util;
-
-import junit.framework.TestCase;
-
-import org.jboss.soa.esb.message.Message;
-
-/**
- * AbstractCommandVehicle unit tests.
- * @author <a href="mailto:schifest at heuristica.com.ar">Esteban</a>
- */
-public class AbstractCommandVehicleUnitTest extends TestCase {
-
- static class MyVehicle extends AbstractCommandVehicle
- {
- private static final long serialVersionUID = 1L;
- @Override
- public String getCommandOpcodeKey() { return "myCmdOpcodeKey"; }
- @Override
- public String getCommandValuesTag() { return "CMD_VALUES_TAG"; }
- @Override
- public Operation operatorFromString(String value) {return Operation.valueOf(value); }
-
- public static final String VAL1 = "value1_tag";
-
- public enum Operation
- {
- oper1
- ,oper2
- }
-
- public MyVehicle(Enum command) { super(command); }
- public MyVehicle(Message message) { super(message); }
-
- public void setVal1(String obj) { super.setValue(VAL1, obj); }
- public String getVal1() { return (String)_values.get(VAL1); }
- }
-
- public void test_01()
- {
- String compareValue = "12345";
-
- MyVehicle vh1 = new MyVehicle(MyVehicle.Operation.oper1);
- vh1.setVal1(compareValue);
- Message msg = vh1.toCommandMessage();
-
- MyVehicle newVh = new MyVehicle(msg);
- assertEquals(MyVehicle.Operation.oper1, newVh.getOperator());
- assertEquals(compareValue, newVh.getVal1());
- }
-
- public void test_02()
- {
- String compareValue = "ZZZZZZZZZZZZZZ";
-
- MyVehicle vh1 = new MyVehicle(MyVehicle.Operation.oper2);
- vh1.setVal1(compareValue);
- Message msg = vh1.toCommandMessage();
-
- MyVehicle newVh = new MyVehicle(msg);
- assertEquals(MyVehicle.Operation.oper2, newVh.getOperator());
- assertEquals(compareValue, newVh.getVal1());
- }
-
-}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/aggregator/aggregation_service/jbossesb.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/aggregator/aggregation_service/jbossesb.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/aggregator/aggregation_service/jbossesb.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -24,11 +24,14 @@
<action class="org.jboss.soa.esb.actions.Aggregator" name="Aggregator">
<property name="timeoutInMillies" value="60000"/>
</action>
+
+ <!-- add transformation action to aggregate the attachments into 1 message -->
+ <action name="assemble" class="org.jboss.soa.esb.samples.quickstart.aggregator.AggregatedMessageAssembler" />
+
<action name="print-after" class="org.jboss.soa.esb.actions.SystemPrintln">
- <property name="message" value="An aggregated message was created" />
+ <property name="message" value="An aggregated message was created (see attachments)" />
</action>
- <!-- add transformation action to aggregate the attachments into 1 message -->
- </actions>
+ </actions>
</service>
</services>
</jbossesb>
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/aggregator/src/org/jboss/soa/esb/samples/quickstart/aggregator/AggregatedMessageAssembler.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/samples/quickstarts/aggregator/src/org/jboss/soa/esb/samples/quickstart/aggregator/AggregatedMessageAssembler.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/aggregator/src/org/jboss/soa/esb/samples/quickstart/aggregator/AggregatedMessageAssembler.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/aggregator/src/org/jboss/soa/esb/samples/quickstart/aggregator/AggregatedMessageAssembler.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstart.aggregator;
+
+import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Attachment;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.util.Util;
+
+import java.io.Serializable;
+
+/**
+ * Assemble an aggregated message.
+ * <p/>
+ * This is just an example. Of course a real worl example would do something more
+ * useful than just append the messages together in a StringBuffer!
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class AggregatedMessageAssembler extends AbstractActionPipelineProcessor {
+
+ public AggregatedMessageAssembler(ConfigTree config) {
+ }
+
+ public Message process(Message message) throws ActionProcessingException {
+ Attachment attachments = message.getAttachment();
+ int attachmentCount = attachments.getUnnamedCount();
+ StringBuffer assemblyBuffer = new StringBuffer();
+
+ for (int i = 0; i < attachmentCount; i++) {
+ try {
+ Message aggrMessage = Util.deserialize((Serializable) attachments.itemAt(i));
+ String payload = aggrMessage.getBody().get().toString();
+
+ assemblyBuffer.append("**** Payload from Message Attachment " + i + ":\n");
+ assemblyBuffer.append(payload + "\n");
+ } catch (Exception e) {
+ // Not an aggregated message attachment... continue...
+ }
+ }
+
+ message.getBody().add(assemblyBuffer.toString());
+
+ return message;
+ }
+}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration1/jboss-esb-unfiltered.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration1/jboss-esb-unfiltered.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration1/jboss-esb-unfiltered.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -84,12 +84,16 @@
<fs-listener name="ESB-Listener" busidref="deployEsbChannel"
maxThreads="1"/>
</listeners>
- <actions>
+ <actions>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore">
+ <property name="logSuccess" value="true"/>
+ </action>
<action name="DeployFromFile"
class="org.jboss.soa.esb.services.jbpm.actions.BpmProcessor">
<property name="command" value="DeployProcessDefinition" />
<property name="process-definition-file" value="/processdefinition.xml" />
- </action>
+ </action>
+
</actions>
</service>
@@ -105,7 +109,7 @@
<actions>
<action name="spy1"
class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration1.esb_actions.MessageSpy"/>
-
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
<!-- move the body.getContents() into jBPM -->
<action name="create_new_process_instance"
class="org.jboss.soa.esb.services.jbpm.actions.BpmProcessor">
@@ -139,7 +143,7 @@
<action name="spy3"
class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration1.esb_actions.MessageSpy"/>
-
+
</actions>
</service>
@@ -164,7 +168,8 @@
<actions>
<action name="groovy" class="org.jboss.soa.esb.actions.scripting.GroovyActionProcessor">
<property name="script" value="/scripts/service2.groovy" />
- </action>
+ </action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
<service category="BPM_Orchestration_Service3" name="Service3"
@@ -177,6 +182,7 @@
<action name="groovy" class="org.jboss.soa.esb.actions.scripting.GroovyActionProcessor">
<property name="script" value="/scripts/service3.groovy" />
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
<service category="BPM_Orchestration_ResultsService" name="ResultsService"
@@ -187,7 +193,8 @@
</listeners>
<actions>
<action name="spy"
- class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration1.esb_actions.MessageSpy"/>
+ class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration1.esb_actions.MessageSpy"/>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration1/readme.txt
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration1/readme.txt 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration1/readme.txt 2007-11-30 15:43:56 UTC (rev 16945)
@@ -12,28 +12,19 @@
'[SchemaExport] schema export complete' to appear on the console.
4. Switch back to "Window2", type 'ant startProcess'.
5. Switch back to Application Server console to see the output from the ESB.
- 6. To undeploy the esb archive, type 'ant undeploy' ("Window1").
+
+ Sample Output from "ant startProcess":
+ ======================================
+ 10:42:14,386 INFO [MessageSpy] Body: Start It Up
+ 10:42:14,463 INFO [ProcessInfo] Token ID: 1
+ 10:42:14,463 INFO [ProcessInfo] Process Name: null
+ 10:42:14,463 INFO [ProcessInfo] Process Version: null
+ 10:42:14,463 INFO [MessageSpy] Body: Start It Up
+
+ 6. In the http://localhost:8080/jbpm-console, you can check that the "processDefinition2" is
+ deployed and that there is one running instance.
+ 7. To undeploy the esb archive, type 'ant undeploy' ("Window1").
-Sample Output from "ant startProcess":
-======================================
-10:42:14,386 INFO [MessageSpy] Body: Start It Up
-10:42:14,463 INFO [ProcessInfo] Token ID: 1
-10:42:14,463 INFO [ProcessInfo] Process Name: null
-10:42:14,463 INFO [ProcessInfo] Process Version: null
-10:42:14,463 INFO [MessageSpy] Body: Start It Up
-10:42:14,482 WARN [ProxyWarnLog] Narrowing proxy to class org.jbpm.graph.node.StartState - this operation breaks ==
-10:42:15,182 INFO [STDOUT] 1********** Begin Service 1 ***********
-10:42:15,263 INFO [STDOUT] In: Start It Up
-10:42:15,263 INFO [STDOUT] Out: Service 1 Start It Up
-10:42:15,263 INFO [STDOUT] ************ End Service 1 ************
-10:42:15,747 INFO [STDOUT] 2********** Begin Service 2 ***********
-10:42:15,747 INFO [STDOUT] In: Start It Up
-10:42:15,747 INFO [STDOUT] Out: Service 2 Start It Up
-10:42:15,748 INFO [STDOUT] ************ End Service 2 ************
-10:42:16,889 INFO [STDOUT] 3********** Begin Service 3 ***********
-10:42:16,890 INFO [STDOUT] In: Start It Up
-10:42:16,890 INFO [STDOUT] Out: Service 3 Start It Up
-10:42:16,890 INFO [STDOUT] ************ End Service 3 ************
-10:42:17,596 INFO [STDOUT] Executed by the process, not by the ESB
-10:42:17,653 INFO [MessageSpy] Body: Start It Up
-10:42:18,637 INFO [MessageSpy] Body: Start It Up
+
+
+
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration1/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration1/esb_actions/ProcessInfo.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration1/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration1/esb_actions/ProcessInfo.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration1/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration1/esb_actions/ProcessInfo.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -22,7 +22,6 @@
import org.jboss.soa.esb.actions.AbstractActionLifecycle;
import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Body;
import org.jboss.soa.esb.message.Message;
import org.apache.log4j.Logger;
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration1/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration1/process_actions/MyBPMActionHandler.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration1/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration1/process_actions/MyBPMActionHandler.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration1/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration1/process_actions/MyBPMActionHandler.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -20,10 +20,8 @@
*/
package org.jboss.soa.esb.samples.quickstarts.bpm_orchestration1.process_actions;
-import org.jbpm.context.exe.ContextInstance;
import org.jbpm.graph.def.ActionHandler;
import org.jbpm.graph.exe.ExecutionContext;
-import org.jbpm.graph.exe.Token;
public class MyBPMActionHandler implements ActionHandler
{
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration1/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration1/test/SendTestMessage.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration1/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration1/test/SendTestMessage.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration1/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration1/test/SendTestMessage.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -29,27 +29,26 @@
public class SendTestMessage {
public SendTestMessage() {
-
}
- public static void main(String args[]) throws Exception
- {
- System.out.println("Here");
- String inputDirectory = args[0];
- String fileExt = args[1];
- String fileContents = args[2];
-
+
+ public void sendMessage(String inputDirectory, String fileExtension, String fileContents) {
String prefix = Long.toString(Calendar.getInstance().getTimeInMillis());
- File x = File.createTempFile(prefix + "_",fileExt,new File(inputDirectory));
-
-
+ File x = null;
try {
+ x = File.createTempFile(prefix + "_",fileExtension,new File(inputDirectory));
BufferedWriter out = new BufferedWriter(new FileWriter(x));
out.write(fileContents.toCharArray());
out.close();
} catch (Exception e) {
System.out.println("Error while writing the file: " + x.getAbsolutePath());
System.out.println(e.getMessage());
- }
+ }
+ }
+
+ public static void main(String args[]) throws Exception
+ {
+ SendTestMessage stm = new SendTestMessage();
+ stm.sendMessage(args[0], args[1], args[2]);
}
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration2/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration2/jboss-esb.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration2/jboss-esb.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -72,6 +72,9 @@
maxThreads="1"/>
</listeners>
<actions>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore">
+ <property name="logSuccess" value="true"/>
+ </action>
<action name="DeployFromFile"
class="org.jboss.soa.esb.services.jbpm.actions.BpmProcessor">
<property name="command" value="DeployProcessDefinition" />
@@ -80,8 +83,8 @@
<action name="deployed-message" class="org.jboss.soa.esb.actions.SystemPrintln">
<property name="message" value="Process Definition Deployed" />
</action>
- </actions>
- </service>
+ </actions>
+ </service>
<service category="BPM_Orchestration2_Starter_Service" name="Starter_Service"
description="BPM Orchestration Sample 2: Use this service to start a process instance">
@@ -93,48 +96,23 @@
maxThreads="1"/>
</listeners>
<actions>
-
- <action name="dump1" class="org.jboss.soa.esb.actions.SystemPrintln">
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
+ <action name="dump1" class="org.jboss.soa.esb.actions.SystemPrintln">
<property name="printfull" value="true"/>
- </action>
- <!--
- <action name="create_new_process_instance"
- class="org.jboss.soa.esb.services.jbpm.actions.BpmProcessor">
- <property name="command" value="NewProcessInstanceCommand" />
- <property name="process-definition-name" value="bpm_orchestration2Process"/>
- <property name="object-paths">
- <object-path esb="BODY_CONTENT" bpm="theBody" />
- </property>
- </action>
-
- <action name="dump2" class="org.jboss.soa.esb.actions.SystemPrintln">
- <property name="printfull" value="true"/>
- </action>
-
- <action name="signal_the_new_process_instance"
+ </action>
+ <action name="start_a_new_process_instance"
class="org.jboss.soa.esb.services.jbpm.actions.BpmProcessor">
- <property name="command" value="SignalCommand" />
- <property name="process-definition-name" value="bpm_orchestration2Process"/>
- <property name="object-paths">
- <object-path esb="BODY_CONTENT" bpm="theBody" />
- </property>
- </action>
- -->
-
- <action name="start_a_new_process_instance"
- class="org.jboss.soa.esb.services.jbpm.actions.BpmProcessor">
<property name="command" value="StartProcessInstanceCommand" />
<property name="process-definition-name" value="bpm_orchestration2Process"/>
<property name="object-paths">
<object-path esb="eVar1" bpm="counter" value="45" />
<object-path esb="BODY_CONTENT" bpm="theBody" />
</property>
- </action>
-
- <action name="dump3" class="org.jboss.soa.esb.actions.SystemPrintln">
+ </action>
+
+ <action name="dump3" class="org.jboss.soa.esb.actions.SystemPrintln">
<property name="printfull" value="true"/>
- </action>
-
+ </action>
</actions>
</service>
@@ -156,7 +134,7 @@
<action name="alert" class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration2.esb_actions.SimpleJMSNotifier">
<property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration2_service1_Alert" />
</action>
-
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
<service category="BPM_Orchestration2_Service2" name="Service2"
@@ -174,6 +152,7 @@
<property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration2_service2_Alert" />
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
<service category="BPM_Orchestration2_Service3" name="Service3"
@@ -191,6 +170,7 @@
<property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration2_service3_Alert" />
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
@@ -207,6 +187,7 @@
<action name="alert" class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration2.esb_actions.SimpleJMSNotifier">
<property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration2_service4_Alert" />
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
<service category="BPM_Orchestration2_Service5" name="Service5"
@@ -222,6 +203,7 @@
<action name="alert" class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration2.esb_actions.SimpleJMSNotifier">
<property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration2_service5_Alert" />
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
<service category="BPM_Orchestration2_Service6" name="Service6"
@@ -238,6 +220,7 @@
<action name="alert" class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration2.esb_actions.SimpleJMSNotifier">
<property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration2_service6_Alert" />
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
<service category="BPM_Orchestration2_Service7" name="Service7"
@@ -254,6 +237,7 @@
<action name="alert" class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration2.esb_actions.SimpleJMSNotifier">
<property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration2_service7_Alert" />
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
@@ -272,6 +256,7 @@
<action name="alert" class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration2.esb_actions.SimpleJMSNotifier">
<property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration2_results_Alert" />
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
<action name="results-message" class="org.jboss.soa.esb.actions.SystemPrintln">
<property name="message" value="SUCCESS!" />
</action>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration3/build.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration3/build.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration3/build.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -45,6 +45,7 @@
</target>
<target name="startProcess" depends="compile" description="Sends a message to start a new process instance">
+ <echo>TOKEN=$token</echo>
<echo>Sends a message to start a new process instance</echo>
<java fork="yes" classname="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration3.test.SendJMSMessage" failonerror="true">
<arg value="queue/quickstart_bpm_orchestration3_start_Request_gw"/>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration3/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration3/jboss-esb.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration3/jboss-esb.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -58,14 +58,17 @@
maxThreads="1"/>
</listeners>
<actions>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore">
+ <property name="logSuccess" value="true"/>
+ </action>
<action name="DeployFromFile"
class="org.jboss.soa.esb.services.jbpm.actions.BpmProcessor">
<property name="command" value="DeployProcessDefinition" />
<property name="process-definition-file" value="/processDefinition/processdefinition.xml" />
</action>
- <action name="deployed-message" class="org.jboss.soa.esb.actions.SystemPrintln">
- <property name="message" value="Process Definition Deployed" />
- </action>
+ <action name="deployed-message" class="org.jboss.soa.esb.actions.SystemPrintln">
+ <property name="message" value="Process Definition Deployed" />
+ </action>
</actions>
</service>
@@ -79,13 +82,13 @@
maxThreads="1"/>
</listeners>
<actions>
-
<action name="setupKey" class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration3.esb_actions.SetupKey">
</action>
<action name="dump2" class="org.jboss.soa.esb.actions.SystemPrintln">
<property name="message" value="After" />
<property name="printfull" value="true"/>
- </action>
+ </action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
<action name="start_a_new_process_instance"
class="org.jboss.soa.esb.services.jbpm.actions.BpmProcessor">
<property name="command" value="StartProcessInstanceCommand" />
@@ -96,12 +99,6 @@
<object-path esb="contentsAsString" bpm="theData" />
</property>
</action>
- <!--
- <action name="dump3" class="org.jboss.soa.esb.actions.SystemPrintln">
- <property name="message" value="After" />
- <property name="printfull" value="true"/>
- </action>
- -->
</actions>
</service>
@@ -137,7 +134,8 @@
<property name="message" value="After" />
<property name="printfull" value="true"/>
</action>
- -->
+ -->
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
@@ -164,6 +162,7 @@
<property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration3_service1_Alert" />
</action>
-->
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
<service category="BPM_Orchestration3_Service2" name="Service2"
@@ -186,6 +185,7 @@
<property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration2_service2_Alert" />
</action>
-->
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
<service category="BPM_Orchestration3_Service3" name="Service3"
@@ -208,6 +208,7 @@
<property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration2_service3_Alert" />
</action>
-->
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration3/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration3/esb_actions/SimpleJMSNotifier.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration3/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration3/esb_actions/SimpleJMSNotifier.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration3/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration3/esb_actions/SimpleJMSNotifier.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -37,6 +37,8 @@
import javax.naming.Context;
import javax.naming.InitialContext;
+import org.jboss.soa.esb.actions.StoreMessageToFile;
+
public class SimpleJMSNotifier extends AbstractActionLifecycle {
protected ConfigTree _config;
private Logger logger = Logger.getLogger(SimpleJMSNotifier.class);
@@ -65,6 +67,7 @@
QueueSender send = session.createSender(que);
TextMessage tm = session.createTextMessage((String)message.getBody().get());
+ tm.setStringProperty(StoreMessageToFile.PROPERTY_JBESB_FILENAME, "BPMOrchestration3Test.log");
send.send(tm);
send.close();
@@ -80,4 +83,4 @@
queueName = _config.getAttribute("ALERT_QUEUE_NAME");
logger.info("Who to alert: " + queueName);
}
-}
\ No newline at end of file
+}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration3/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration3/test/SendJMSMessage.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration3/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration3/test/SendJMSMessage.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration3/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration3/test/SendJMSMessage.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -30,6 +30,8 @@
import javax.naming.InitialContext;
import javax.naming.NamingException;
+import org.jboss.soa.esb.actions.StoreMessageToFile;
+
public class SendJMSMessage {
QueueConnection conn;
QueueSession session;
@@ -49,21 +51,9 @@
public void stop() throws JMSException
{
- try {
- if(conn != null) {
- conn.stop();
- }
- } finally {
- try {
- if(session != null) {
- session.close();
- }
- } finally {
- if(conn != null) {
- conn.close();
- }
- }
- }
+ conn.stop();
+ session.close();
+ conn.close();
}
public void sendAMessage(String msg, String tokenID) throws JMSException {
@@ -72,28 +62,27 @@
ObjectMessage tm = session.createObjectMessage(msg);
if (tokenID != null && !tokenID.equals(""))
tm.setStringProperty("token",tokenID);
+ tm.setStringProperty(StoreMessageToFile.PROPERTY_JBESB_FILENAME, "BPMOrchestration3Test.log");
send.send(tm);
send.close();
}
public static void main(String args[]) throws Exception
- {
- SendJMSMessage sm = new SendJMSMessage();
- try {
- sm.setupConnection(args[0]);
- if (args.length < 3)
- sm.sendAMessage(args[1], null);
- else
- sm.sendAMessage(args[1], args[2]);
- } catch (Exception e) {
- System.out.println("\n**** Failed to send message to JMS Destination '" + args[0] + "'. " +
- "\n**** Your JMS Provider (e.g. your JBoss ESB/App Server) may not be running, or the JMS Destination may not be deployed." +
- "\n**** Exception: " + e.getMessage());
- } finally {
- sm.stop();
- }
-
+ {
+ SendJMSMessage sm = new SendJMSMessage();
+ try {
+ sm.setupConnection(args[0]);
+ if (args.length < 3)
+ sm.sendAMessage(args[1],null);
+ else
+ sm.sendAMessage(args[1],args[2]);
+ } catch (Exception e) {
+ System.out.println(e);
+ } finally {
+ sm.stop();
+ }
+
}
-}
\ No newline at end of file
+}
Property changes on: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/bpm_orchestration4
___________________________________________________________________
Name: svn:ignore
+ build
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/business_rules_service/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/business_rules_service/jboss-esb.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/business_rules_service/jboss-esb.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -113,6 +113,7 @@
<object-path esb="body.customer" />
</property>
</action>
+
</actions>
</service>
<service category="ConciergeManager"
@@ -127,6 +128,7 @@
class="org.jboss.soa.esb.samples.quickstart.businessrules.ReviewMessage">
<property name="stuff" value="Concierge"/>
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
@@ -142,6 +144,7 @@
class="org.jboss.soa.esb.samples.quickstart.businessrules.ReviewMessage">
<property name="stuff" value="Distribution"/>
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
<service category="BasicShipping"
@@ -156,6 +159,7 @@
class="org.jboss.soa.esb.samples.quickstart.businessrules.ReviewMessage">
<property name="stuff" value="Shipping"/>
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/samples/quickstart/businessrules/test/SendJMSMessage.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/samples/quickstart/businessrules/test/SendJMSMessage.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/samples/quickstart/businessrules/test/SendJMSMessage.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -20,6 +20,7 @@
*/
package org.jboss.soa.esb.samples.quickstart.businessrules.test;
+import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.jms.JMSException;
@@ -33,7 +34,10 @@
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
+import java.util.Properties;
+import org.jboss.soa.esb.actions.StoreMessageToFile;
+
public class SendJMSMessage {
QueueConnection conn;
QueueSession session;
@@ -42,7 +46,14 @@
public void setupConnection() throws JMSException, NamingException
{
- InitialContext iniCtx = new InitialContext();
+ Properties properties1 = new Properties();
+ properties1.put(Context.INITIAL_CONTEXT_FACTORY,
+ "org.jnp.interfaces.NamingContextFactory");
+ properties1.put(Context.URL_PKG_PREFIXES,
+ "org.jboss.naming:org.jnp.interfaces");
+ properties1.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1099");
+ InitialContext iniCtx = new InitialContext(properties1);
+
Object tmp = iniCtx.lookup("ConnectionFactory");
QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
conn = qcf.createQueueConnection();
@@ -63,6 +74,7 @@
QueueSender send = session.createSender(que);
ObjectMessage tm = session.createObjectMessage(msg);
+ tm.setStringProperty(StoreMessageToFile.PROPERTY_JBESB_FILENAME, "BusinessRulesServiceTest.log");
send.send(tm);
send.close();
}
@@ -107,4 +119,4 @@
}
-}
\ No newline at end of file
+}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/conf/base-build.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/conf/base-build.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/conf/base-build.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -26,7 +26,10 @@
<and>
<available file="${product.dir}/JBossORG-EULA.txt"/>
<not>
- <available file="${product.dir}/server/default"/>
+ <or>
+ <available file="${product.dir}/server/default"/>
+ <available file="${product.dir}/server/production"/>
+ </or>
</not>
</and>
</condition>
@@ -34,7 +37,10 @@
<condition property="hierarchy.jbossesb-server">
<and>
<available file="${product.dir}/JBossORG-EULA.txt"/>
- <available file="${product.dir}/server/default"/>
+ <or>
+ <available file="${product.dir}/server/default"/>
+ <available file="${product.dir}/server/production"/>
+ </or>
</and>
</condition>
<!-- Do we build against a jbossesb distribution? -->
@@ -66,7 +72,7 @@
<!-- This section handles the discovery of the messaging platform. -->
<!-- ==================================================================== -->
- <target name="messaging-config">
+ <target name="messaging-config" depends="jbossesb-dependencies">
<property name="org.jboss.esb.server.deploy.dir"
value="${org.jboss.esb.server.server}/deploy"/>
@@ -85,13 +91,13 @@
</target>
<!-- dependencies specific to JBoss Messaging -->
- <target name="messaging-dependencies" if="messaging.present">
+ <target name="messaging-dependencies" if="messaging.present" depends="messaging-config">
<property name="jms.service.file" value="jbm-queue-service.xml"/>
<property name="jms.description" value="JBoss Messaging"/>
</target>
<!-- dependencies specific to JBoss MQ -->
- <target name="jbossmq-dependencies" if="jbossmq.present">
+ <target name="jbossmq-dependencies" if="jbossmq.present" depends="messaging-config">
<property name="jms.service.file" value="jbmq-queue-service.xml"/>
<property name="jms.description" value="JBoss MQ"/>
</target>
@@ -120,7 +126,7 @@
<!-- ==================================================================== -->
<!-- Configure dependencies for jbossesb and source distributions -->
- <target name="jbossesb-dependencies" depends="jbossesb-source-dependencies, jbossesb-server-dependencies">
+ <target name="jbossesb-dependencies" depends="check-jbossesb-dist, qslib-dependencies, non-qslib-dependencies, jbossesb-source-dependencies, jbossesb-server-dependencies">
<property name="org.jboss.esb.server.server" location="${org.jboss.esb.server.home}/server/${org.jboss.esb.server.config}"/>
<path id="deployment-classpath">
@@ -145,8 +151,9 @@
<fileset dir="${org.jboss.esb.server.server}/deploy/soap.esb" includes="*.jar"/>
<pathelement location="${org.jboss.esb.server.server}/deploy/soap.esb"/>
<!-- general libs -->
- <pathelement location="${org.jboss.esb.server.server}/lib/commons-logging.jar"/>
- <pathelement location="${org.jboss.esb.server.server}/lib/jboss-system.jar"/>
+ <pathelement location="${org.jboss.esb.server.home}/lib/commons-logging.jar"/>
+ <pathelement location="${org.jboss.esb.server.home}/lib/commons-codec.jar"/>
+ <pathelement location="${org.jboss.esb.server.home}/lib/jboss-system.jar"/>
</path>
</target>
@@ -188,7 +195,33 @@
<!-- Configure dependencies for jbossesb-server distribution -->
<target name="jbossesb-server-dependencies" if="hierarchy.jbossesb-server">
<property name="org.jboss.esb.server.home" value="${product.dir}"/>
- <property name="org.jboss.esb.server.config" value="default"/>
+
+ <condition property="jbossesb-server-production">
+ <available file="${product.dir}/server/production/deploy/jbossesb.sar"/>
+ </condition>
+ <condition property="jbossesb-server-default">
+ <available file="${product.dir}/server/default/deploy/jbossesb.sar"/>
+ </condition>
+
+ <condition property="jbossesb-server-recognised">
+ <or>
+ <isset property="jbossesb-server-production"/>
+ <isset property="jbossesb-server-default"/>
+ </or>
+ </condition>
+
+ <fail unless="jbossesb-server-recognised" message="Could not detect embedded ESB configuration"/>
+
+ <condition property="org.jboss.esb.server.config"
+ value="default">
+ <isset property="jbossesb-server-default"/>
+ </condition>
+ <condition property="org.jboss.esb.server.config"
+ value="production">
+ <isset property="jbossesb-server-production"/>
+ </condition>
+
+ <echo message="Defaulting to profile: ${org.jboss.esb.server.config}"/>
</target>
<!-- ==================================================================== -->
@@ -197,7 +230,7 @@
<!-- compile-classpath, exec-classpath -->
<!-- ==================================================================== -->
- <target name="dependencies" depends="check-jbossesb-dist, qslib-dependencies, non-qslib-dependencies, jbossesb-dependencies, messaging-config, messaging-dependencies, jbossmq-dependencies, quickstart-specific-dependencies">
+ <target name="dependencies" depends="messaging-dependencies, jbossmq-dependencies, quickstart-specific-dependencies">
<path id="compile-classpath">
<path refid="quickstart-dependencies-classpath" />
@@ -318,30 +351,21 @@
</target>
- <target name="check-jms-dests">
- <condition property="jbossmq-present">
- <available file="${basedir}/jbmq-queue-service.xml"/>
- </condition>
- <condition property="messaging.present">
- <available file="${basedir}/jbm-queue-service.xml"/>
- </condition>
+ <target name="check-jms-dests" depends="messaging-dependencies">
<condition property="jms.dests.notrequired">
<not>
- <or>
- <istrue value="${messaging.present}"/>
- <istrue value="${jbossmq-present}"/>
- </or>
+ <available file="${basedir}/${jms.service.file}"/>
</not>
</condition>
</target>
- <target name="deploy-jms-dests" depends="check-jms-dests, dependencies, deploy-messaging">
+ <target name="deploy-jms-dests" depends="dependencies, deploy-messaging">
<description>deploy-jms-dests will deploy the jms destinations for application server
</description>
</target>
- <target name="undeploy-jms-dests" depends="check-jms-dests, dependencies, undeploy-messaging">
+ <target name="undeploy-jms-dests" depends="dependencies, undeploy-messaging">
<description>undeploy-jms-dests will undeploy the jms destination for application server
</description>
</target>
@@ -407,7 +431,7 @@
<copy file="${jms.service.file}" overwrite="true" tofile="${org.jboss.esb.server.deploy.dir}/${ant.project.name}-queue-service.xml" failonerror="false"/>
</target>
- <target name="undeploy-messaging">
+ <target name="undeploy-messaging" depends="check-jms-dests" unless="jms.dests.notrequired">
<delete file="${org.jboss.esb.server.deploy.dir}/${ant.project.name}-queue-service.xml" quiet="true"/>
</target>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/custom_action/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/custom_action/jboss-esb.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/custom_action/jboss-esb.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -38,7 +38,7 @@
maxThreads="1"
/>
</listeners>
- <actions mep="OneWay">
+ <actions mep="RequestResponse">
<action name="first" class="org.jboss.soa.esb.samples.quickstart.customaction.MyBasicAction" process="displayMessage" >
<property name="exceptionMethod" value="exceptionHandler" />
</action>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/deadletter/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/deadletter/jboss-esb.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/deadletter/jboss-esb.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -51,8 +51,13 @@
<!-- Send message to My Action -->
<action name="MyFailingAction" class="org.jboss.soa.esb.samples.quickstart.deadletter.MyFailingAsyncAction"/>
<action name="MyFailingSyncAction" class="org.jboss.soa.esb.samples.quickstart.deadletter.MyFailingSyncAction"/>
- </actions>
- </service>
+ <action name="action2" class="org.jboss.soa.esb.actions.SystemPrintln">
+ <property name="printfull" value="true"/>
+ </action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
+
+ </actions>
+ </service>
</services>
</jbossesb>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/MyFailingAsyncAction.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/MyFailingAsyncAction.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/MyFailingAsyncAction.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -61,7 +61,8 @@
//the jbossesb.esb an by default it stores the message in the
//MessageStore under the DLQ categorization.
MessageStore ms = MessageStoreFactory.getInstance().getMessageStore();
-
+ Message rdlvrMessage = null;
+
try {
//empty out the DLQ
Map<URI, Message> messageMap = ms.getAllMessages(MessageStore.CLASSIFICATION_RDLVR);
@@ -84,7 +85,7 @@
rdlvrMessageMap = ms.getAllMessages(MessageStore.CLASSIFICATION_RDLVR);
}
for (URI key : rdlvrMessageMap.keySet()) {
- Message rdlvrMessage = rdlvrMessageMap.get(key);
+ rdlvrMessage = rdlvrMessageMap.get(key);
logger.info("*******************************");
logger.info("Message in the RDLVR should be the same message: " + message.getBody().toString().equals(rdlvrMessage.getBody().toString()));
logger.info("Message=" + message.getBody());
@@ -98,8 +99,8 @@
} catch (MessageDeliverException mde) {
throw new ActionProcessingException(mde.getMessage(), mde);
}
- return message;
+ return rdlvrMessage;
}
-}
\ No newline at end of file
+}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/MyFailingSyncAction.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/MyFailingSyncAction.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/MyFailingSyncAction.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -63,7 +63,7 @@
//the jbossesb.esb an by default it stores the message in the
//MessageStore under the DLQ categorization.
MessageStore ms = MessageStoreFactory.getInstance().getMessageStore();
-
+ Message dlqMessage = null;
try {
//empty out the DLQ
Map<URI, Message> messageMap = ms.getAllMessages(MessageStore.CLASSIFICATION_DLQ);
@@ -90,7 +90,7 @@
messageMap = ms.getAllMessages(MessageStore.CLASSIFICATION_DLQ);
}
for (URI key : messageMap.keySet()) {
- Message dlqMessage = messageMap.get(key);
+ dlqMessage = messageMap.get(key);
logger.info("*******************************");
logger.info("Message in the DLQ queue should be the same message: " + message.getBody().toString().equals(dlqMessage.getBody().toString()));
logger.info("Message=" + message.getBody());
@@ -105,8 +105,8 @@
} catch (FaultMessageException fme) {
throw new ActionProcessingException(fme.getMessage(), fme);
}
- return message;
+ return dlqMessage;
}
-}
\ No newline at end of file
+}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/test/SendJMSMessage.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/test/SendJMSMessage.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/test/SendJMSMessage.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -21,6 +21,7 @@
package org.jboss.soa.esb.samples.quickstart.deadletter.test;
import java.util.Date;
+import java.util.Properties;
import javax.jms.JMSException;
import javax.jms.ObjectMessage;
@@ -29,6 +30,7 @@
import javax.jms.QueueConnectionFactory;
import javax.jms.QueueSender;
import javax.jms.QueueSession;
+import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
@@ -42,7 +44,14 @@
public void setupConnection() throws JMSException, NamingException
{
- InitialContext iniCtx = new InitialContext();
+ Properties properties1 = new Properties();
+ properties1.put(Context.INITIAL_CONTEXT_FACTORY,
+ "org.jnp.interfaces.NamingContextFactory");
+ properties1.put(Context.URL_PKG_PREFIXES,
+ "org.jboss.naming:org.jnp.interfaces");
+ properties1.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1099");
+
+ InitialContext iniCtx = new InitialContext(properties1);
Object tmp = iniCtx.lookup("ConnectionFactory");
QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
conn = qcf.createQueueConnection();
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/exceptions_faults/build.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/exceptions_faults/build.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/exceptions_faults/build.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -12,7 +12,7 @@
<echo>Runs Test JMS Sender</echo>
<java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.exceptions.test.SendJMSMessage" failonerror="true">
<arg value="queue/quickstart_exceptions_faults_GW"/>
- <arg value="LostMessageService"/>
+ <arg value="ExceptionCaughtService"/>
<arg value="Via Gateway"/>
<classpath refid="exec-classpath"/>
</java>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/exceptions_faults/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/exceptions_faults/jboss-esb.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/exceptions_faults/jboss-esb.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -60,6 +60,9 @@
<action name="A Good Action" class="org.jboss.soa.esb.samples.quickstart.exceptions.MyBasicAction"
process="displayMessage" >
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore">
+ <property name="logException" value="true"/>
+ </action>
<action name="Bad Action" class="org.jboss.soa.esb.samples.quickstart.exceptions.MyBasicAction"
process="causesMyException" >
</action>
@@ -95,13 +98,13 @@
process="displayMessage" >
<property name="exceptionMethod" value="catchesException" />
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore">
+ <property name="logException" value="true"/>
+ </action>
<action name="Bad Action" class="org.jboss.soa.esb.samples.quickstart.exceptions.MyBasicAction"
- process="causesException" >
- </action>
+ process="causesException"/>
<action name="Never Reached" class="org.jboss.soa.esb.samples.quickstart.exceptions.MyBasicAction"
- process="displayMessage" >
- </action>
-
+ process="displayMessage"/>
</actions>
</service>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/fun_cbr/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/fun_cbr/jboss-esb.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/fun_cbr/jboss-esb.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -71,6 +71,7 @@
/>
</listeners>
<actions mep="OneWay">
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
<action name="notificationAction"
class="org.jboss.soa.esb.actions.Notifier">
<property name="okMethod" value="notifyOK" />
@@ -101,6 +102,7 @@
/>
</listeners>
<actions mep="OneWay">
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
<action name="notificationAction"
class="org.jboss.soa.esb.actions.Notifier">
<property name="okMethod" value="notifyOK" />
@@ -131,6 +133,7 @@
/>
</listeners>
<actions mep="OneWay">
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
<!-- Inject the transformer actions here -->
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/fun_cbr/src/org/jboss/soa/esb/samples/quickstart/funcbr/test/SendJMSMessage.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/fun_cbr/src/org/jboss/soa/esb/samples/quickstart/funcbr/test/SendJMSMessage.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/fun_cbr/src/org/jboss/soa/esb/samples/quickstart/funcbr/test/SendJMSMessage.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -29,11 +29,16 @@
import javax.jms.QueueSession;
import javax.jms.QueueSender;
import javax.jms.ObjectMessage;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
+import java.util.Properties;
+
public class SendJMSMessage {
QueueConnection conn;
QueueSession session;
@@ -42,7 +47,14 @@
public void setupConnection() throws JMSException, NamingException
{
- InitialContext iniCtx = new InitialContext();
+ Properties properties1 = new Properties();
+ properties1.put(Context.INITIAL_CONTEXT_FACTORY,
+ "org.jnp.interfaces.NamingContextFactory");
+ properties1.put(Context.URL_PKG_PREFIXES,
+ "org.jboss.naming:org.jnp.interfaces");
+ properties1.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1099");
+ InitialContext iniCtx = new InitialContext(properties1);
+
Object tmp = iniCtx.lookup("ConnectionFactory");
QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
conn = qcf.createQueueConnection();
@@ -60,12 +72,13 @@
}
public void sendAMessage(String msg) throws JMSException {
-
QueueSender send = session.createSender(que);
ObjectMessage tm = session.createObjectMessage(msg);
+ tm.setStringProperty("jbesbfilename", "FunCBRTest.log");
send.send(tm);
send.close();
}
+
public String readAsciiFile(String fileName) throws IOException {
FileReader fr = null;
char[] thechars = null;
@@ -107,4 +120,4 @@
}
-}
\ No newline at end of file
+}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/groovy_gateway/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/groovy_gateway/jboss-esb.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/groovy_gateway/jboss-esb.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -30,6 +30,8 @@
<actions mep="RequestResponse">
<action name="greeting1" class="org.jboss.soa.esb.samples.quickstart.groovygateway.GreeterAction"/>
<action name="greeting2" class="org.jboss.soa.esb.samples.quickstart.groovygateway.AnotherAction"/>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
+
</actions>
</service>
</services>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld/jboss-esb.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld/jboss-esb.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -47,7 +47,7 @@
<property name="printfull" value="true"/>
</action>
<!-- The next action is for Continuous Integration testing -->
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/SendEsbMessage.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/SendEsbMessage.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/SendEsbMessage.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -50,10 +50,10 @@
Message esbMessage = MessageFactory.getInstance().getMessage();
- esbMessage.getBody().setByteArray(args[2].getBytes());
+ esbMessage.getBody().add(args[2]);
new ServiceInvoker(args[0], args[1]).deliverAsync(esbMessage);
}
-}
\ No newline at end of file
+}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_action/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_action/jboss-esb.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_action/jboss-esb.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -51,8 +51,6 @@
<property name="exceptionMethod" value="exceptionHandler"/>
</action>
- <!-- The next action is for Continuous Integration testing -->
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
<action name="notificationAction"
class="org.jboss.soa.esb.actions.Notifier">
<property name="okMethod" value="notifyOK" />
@@ -65,7 +63,9 @@
</target>
</NotificationList>
</property>
- </action>
+ </action>
+ <!-- The next action is for Continuous Integration testing -->
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_action/src/org/jboss/soa/esb/samples/quickstart/helloworldaction/test/SendJMSMessage.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_action/src/org/jboss/soa/esb/samples/quickstart/helloworldaction/test/SendJMSMessage.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_action/src/org/jboss/soa/esb/samples/quickstart/helloworldaction/test/SendJMSMessage.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -30,6 +30,8 @@
import javax.naming.InitialContext;
import javax.naming.NamingException;
+import org.jboss.soa.esb.actions.StoreMessageToFile;
+
public class SendJMSMessage {
QueueConnection conn;
QueueSession session;
@@ -59,6 +61,7 @@
QueueSender send = session.createSender(que);
ObjectMessage tm = session.createObjectMessage(msg);
+ tm.setStringProperty(StoreMessageToFile.PROPERTY_JBESB_FILENAME, "HelloWorldActionTest.log");
send.send(tm);
send.close();
}
@@ -73,4 +76,4 @@
}
-}
\ No newline at end of file
+}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_file_action/jboss-esb-unfiltered.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_file_action/jboss-esb-unfiltered.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_file_action/jboss-esb-unfiltered.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -62,7 +62,7 @@
<property name="printfull" value="true"/>
</action>
<!-- The next action is for Continuous Integration testing -->
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile" />
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore" />
</actions>
</service>
</services>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_file_notifier/build.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_file_notifier/build.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_file_notifier/build.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -1,4 +1,6 @@
<project name="Quickstart_helloworld_file_notifier" default="run" basedir=".">
+
+ <property environment="env" />
<description>
${ant.project.name}
@@ -10,10 +12,12 @@
<target name="config">
<property name="results.dir" location="."/>
+ <echoproperties/>
<copy file="jboss-esb-unfiltered.xml"
tofile="jboss-esb.xml" overwrite="true">
<filterset>
<filter token="results.dir" value="file:///${results.dir}"/>
+ <filter token="tmp.dir" value="${java.io.tmpdir}"/>
</filterset>
</copy>
</target>
@@ -30,7 +34,7 @@
<target name="sendesb" depends="compile"
description="Will send an esb Message">
<echo>Runs Test ESB Message Sender</echo>
- <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.helloworldfilenotifier.test.SendEsbMessage" failonerror="true">
+ <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.helloworld.test.SendEsbMessage" failonerror="true">
<arg value="FirstServiceESB"/> <!-- service category -->
<arg value="SimpleListener"/> <!-- service name -->
<arg value="Hello World - Straight to ESB listener - no Gateway"/> <!-- Message text -->
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_file_notifier/jboss-esb-unfiltered.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_file_notifier/jboss-esb-unfiltered.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_file_notifier/jboss-esb-unfiltered.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -54,7 +54,7 @@
maxThreads="1"
/>
</listeners>
- <actions mep="OneWay">
+ <actions>
<action name="routeAction" class="org.jboss.soa.esb.actions.StaticRouter">
<property name="destinations">
<route-to service-category="routerToDisplay" service-name="DisplayRouterListener" />
@@ -98,6 +98,7 @@
<target class="NotifyConsole"/>
<target class="NotifyFiles">
<file append="false" URI="@results.dir@/results.log"/>
+ <file append="false" URI="@tmp.dir@/HelloWorldFileNotifierTest.log"/>
</target>
</NotificationList>
<NotificationList type="err">
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/jms_topic/build.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/jms_topic/build.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/jms_topic/build.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -9,10 +9,8 @@
<import file="../conf/base-build.xml"/>
<target name="runtest" depends="compile" description="Send a message to the JMS Topic">
- <java fork="yes" classname="org.jboss.soa.esb.testutils.JMSUtil" failonerror="true"
+ <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.jmstopic.SendJMSMessage" failonerror="true"
classpathref="exec-classpath">
- <arg value="quickstart_jmstopic_topic"/>
- <arg value="topic"/>
<arg value="Hello"/>
</java>
</target>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/jms_topic/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/jms_topic/jboss-esb.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/jms_topic/jboss-esb.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -72,6 +72,7 @@
</listeners>
<actions mep="OneWay">
<action name="target" class="org.jboss.soa.esb.samples.quickstart.jmstopic.TargetServiceAction" />
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/jms_topic/src/org/jboss/soa/esb/samples/quickstart/jmstopic/SendJMSMessage.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/samples/quickstarts/jms_topic/src/org/jboss/soa/esb/samples/quickstart/jmstopic/SendJMSMessage.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/jms_topic/src/org/jboss/soa/esb/samples/quickstart/jmstopic/SendJMSMessage.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/jms_topic/src/org/jboss/soa/esb/samples/quickstart/jmstopic/SendJMSMessage.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstart.jmstopic;
+
+import java.util.Properties;
+
+import javax.jms.JMSException;
+import javax.jms.ObjectMessage;
+
+import javax.jms.Topic;
+import javax.jms.TopicConnection;
+import javax.jms.TopicConnectionFactory;
+import javax.jms.TopicPublisher;
+import javax.jms.TopicSubscriber;
+import javax.jms.TopicSession;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+public class SendJMSMessage {
+ TopicConnectionFactory tcf;
+ TopicSession session;
+ Topic topic;
+ TopicConnection tc;
+
+ public void setupConnection() throws JMSException, NamingException
+ {
+ Properties properties1 = new Properties();
+ properties1.put(Context.INITIAL_CONTEXT_FACTORY,
+ "org.jnp.interfaces.NamingContextFactory");
+ properties1.put(Context.URL_PKG_PREFIXES,
+ "org.jboss.naming:org.jnp.interfaces");
+ properties1.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1099");
+ InitialContext iniCtx = new InitialContext(properties1);
+
+ tcf = (TopicConnectionFactory) iniCtx.lookup("ConnectionFactory");
+ topic = (Topic) iniCtx.lookup("/topic/quickstart_jmstopic_topic");
+ }
+
+ public void stop() throws JMSException
+ {
+ tc.close();
+ session.close();
+ tc.close();
+ }
+
+ public void sendAMessage(String msg) throws JMSException {
+ tc = tcf.createTopicConnection();
+ session = tc.createTopicSession(false, TopicSession.AUTO_ACKNOWLEDGE);
+ TopicPublisher tp = session.createPublisher(topic);
+ ObjectMessage tm = session.createObjectMessage(msg);
+ tp.publish(tm);
+ }
+
+
+ public static void main(String args[]) throws Exception
+ {
+ SendJMSMessage sm = new SendJMSMessage();
+ sm.setupConnection();
+ sm.sendAMessage(args[0]);
+ sm.stop();
+
+ }
+
+}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/load_generator/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/load_generator/jboss-esb.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/load_generator/jboss-esb.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -59,6 +59,7 @@
class="org.jboss.soa.esb.actions.SystemPrintln">
<property name="printfull" value="true" />
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/load_generator/scripts/JmsLoadAgent.groovy
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/load_generator/scripts/JmsLoadAgent.groovy 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/load_generator/scripts/JmsLoadAgent.groovy 2007-11-30 15:43:56 UTC (rev 16945)
@@ -29,6 +29,8 @@
import javax.naming.InitialContext
import javax.naming.NamingException
+import org.jboss.soa.esb.actions.StoreMessageToFile
+
/**
* Simple Groovy load script that will simulate load for a JMS gateway based ESB service call.
*
@@ -124,6 +126,7 @@
QueueSender send = session.createSender(que)
ObjectMessage tm = session.createObjectMessage(new File(agentBean.payload).text)
+ tm.setStringProperty(StoreMessageToFile.PROPERTY_JBESB_FILENAME, "LoadGeneratorTest.log");
1.upto(agentBean.msgCount)
{
send.send(tm)
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/messagefilter/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/messagefilter/jboss-esb.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/messagefilter/jboss-esb.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -70,12 +70,13 @@
<action name="notificationAction" class="org.jboss.soa.esb.actions.Notifier">
<property name="okMethod" value="notifyOK" />
<property name="notification-details">
- <NotificationList type="OK">
- <target class="NotifyConsole" />
- </NotificationList>
- </property>
- </action>
- </actions>
+ <NotificationList type="OK">
+ <target class="NotifyConsole" />
+ </NotificationList>
+ </property>
+ </action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
+ </actions>
</service>
</services>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/messagefilter/src/org/jboss/soa/esb/samples/quickstart/messagefilter/test/SendJMSMessage.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/messagefilter/src/org/jboss/soa/esb/samples/quickstart/messagefilter/test/SendJMSMessage.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/messagefilter/src/org/jboss/soa/esb/samples/quickstart/messagefilter/test/SendJMSMessage.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -32,6 +32,8 @@
import javax.naming.InitialContext;
import javax.naming.NamingException;
+import org.jboss.soa.esb.actions.StoreMessageToFile;
+
import org.jboss.soa.esb.samples.quickstart.messagefilter.Order;
public class SendJMSMessage {
@@ -63,6 +65,7 @@
QueueSender send = session.createSender(que);
ObjectMessage tm = session.createObjectMessage(msg);
+ tm.setStringProperty(StoreMessageToFile.PROPERTY_JBESB_FILENAME, "MessageFilterTest.log");
send.send(tm);
send.close();
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/messagestore/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/messagestore/jboss-esb.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/messagestore/jboss-esb.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -47,7 +47,10 @@
<target class="NotifyConsole" />
</NotificationList>
</property>
- </action>
+ </action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore">
+ <property name="logSuccess" value="true"/>
+ </action>
<!-- Check that the message is really there (executes on success of pipeline) -->
<action name="CheckMessageStore" class="org.jboss.soa.esb.samples.quickstart.messagestore.CheckMessageStoreAction" />
<!-- Add a copy of the message to the message store under categorization 'test' -->
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/scheduled_services/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/scheduled_services/jboss-esb.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/scheduled_services/jboss-esb.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -28,6 +28,8 @@
<action name="groovy" class="org.jboss.soa.esb.actions.scripting.GroovyActionProcessor">
<property name="script" value="/scripts/iTunesTop5.groovy" />
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
+
</actions>
</service>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/scheduled_services/src/org/jboss/soa/esb/samples/quickstart/scheduler/MyScheduledActionMsgComposer.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/scheduled_services/src/org/jboss/soa/esb/samples/quickstart/scheduler/MyScheduledActionMsgComposer.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/scheduled_services/src/org/jboss/soa/esb/samples/quickstart/scheduler/MyScheduledActionMsgComposer.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -28,6 +28,8 @@
import org.jboss.soa.esb.message.format.MessageType;
import org.jboss.soa.esb.schedule.SchedulingException;
+import org.jboss.soa.esb.actions.StoreMessageToFile;
+
public class MyScheduledActionMsgComposer implements ScheduledEventMessageComposer {
public void initialize(ConfigTree config) throws ConfigurationException {
System.out.println("** initialize: " + config);
@@ -41,6 +43,7 @@
System.out.println("compose a message");
Message myMessage = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
myMessage.getBody().add("Hello Scheduled World");
+ myMessage.getProperties().setProperty(StoreMessageToFile.PROPERTY_JBESB_FILENAME, "ScheduledServices.log");
return myMessage;
}
@@ -48,4 +51,4 @@
System.out.println("onProcessingComplete");
return message;
}
-}
\ No newline at end of file
+}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/scheduled_services/src/org/jboss/soa/esb/samples/quickstart/scheduler/test/SendEsbMessage.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/scheduled_services/src/org/jboss/soa/esb/samples/quickstart/scheduler/test/SendEsbMessage.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/scheduled_services/src/org/jboss/soa/esb/samples/quickstart/scheduler/test/SendEsbMessage.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -35,9 +35,25 @@
*/
public class SendEsbMessage
{
+ public SendEsbMessage() {
+ }
+
+ public void sendMessage(String category, String serviceName, String msgText) {
+ System.out.println("Inbound Data: " + msgText);
+ try {
+ ServiceInvoker invoker = new ServiceInvoker(category,serviceName);
+ Message requestMessage;
+ requestMessage = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+ requestMessage.getBody().add(msgText);
+ invoker.deliverAsync(requestMessage); // no waiting for a response
+ } catch (Exception e) {
+ System.out.println("Exception caught by client: " + e);
+ }
+ }
+
public static void main(String args[]) throws Exception
{
-// Setting the ConnectionFactory such that it will use scout
+ // Setting the ConnectionFactory such that it will use scout
System.setProperty("javax.xml.registry.ConnectionFactoryClass","org.apache.ws.scout.registry.ConnectionFactoryImpl");
@@ -55,17 +71,8 @@
if (args[2] != null && !args[2].equals(""))
msgText = args[2];
- System.out.println("Inbound Data: " + msgText);
-
- ServiceInvoker invoker = new ServiceInvoker(category,serviceName);
- Message requestMessage;
- requestMessage = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
- requestMessage.getBody().add(msgText);
- try {
- invoker.deliverAsync(requestMessage); // no waiting for a response
- } catch (Exception e) {
- System.out.println("Exception caught by client: " + e);
- }
+ SendEsbMessage sem = new SendEsbMessage();
+ sem.sendMessage(category, serviceName, msgText);
}
}
\ No newline at end of file
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/scripting_groovy/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/scripting_groovy/jboss-esb.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/scripting_groovy/jboss-esb.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -51,7 +51,7 @@
<property name="script" value="/scripts/messagePlay.groovy" />
</action>
<!-- The next action is for Continuous Integration testing -->
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/simple_cbr/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/simple_cbr/jboss-esb.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/simple_cbr/jboss-esb.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -79,6 +79,7 @@
/>
</listeners>
<actions mep="OneWay">
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
<action name="displayMessageAction"
class="org.jboss.soa.esb.samples.quickstart.simplecbr.MyJMSListenerAction"
process="displayMessage"
@@ -104,6 +105,7 @@
/>
</listeners>
<actions mep="OneWay">
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
<action name="displayMessageAction"
class="org.jboss.soa.esb.samples.quickstart.simplecbr.MyJMSListenerAction"
process="displayMessage"
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/simple_cbr/src/org/jboss/soa/esb/samples/quickstart/simplecbr/test/SendJMSMessage.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/simple_cbr/src/org/jboss/soa/esb/samples/quickstart/simplecbr/test/SendJMSMessage.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/simple_cbr/src/org/jboss/soa/esb/samples/quickstart/simplecbr/test/SendJMSMessage.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -63,6 +63,7 @@
QueueSender send = session.createSender(que);
ObjectMessage tm = session.createObjectMessage(msg);
+ tm.setStringProperty("jbesbfilename", "SimpleCBRTest.log");
send.send(tm);
send.close();
}
@@ -107,4 +108,4 @@
}
-}
\ No newline at end of file
+}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/spring_aop/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/spring_aop/jboss-esb.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/spring_aop/jboss-esb.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -42,7 +42,8 @@
process="sayHelloAopStyle">
<property name="exceptionMethod" value="exceptionHandler"/>
<property name="springContextXml" value="spring-context.xml"/>
- </action>
+ </action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/spring_aop/src/org/jboss/soa/esb/samples/quickstart/spring_aop/MySpringEnabledAction.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/spring_aop/src/org/jboss/soa/esb/samples/quickstart/spring_aop/MySpringEnabledAction.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/spring_aop/src/org/jboss/soa/esb/samples/quickstart/spring_aop/MySpringEnabledAction.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -49,7 +49,9 @@
logHeader();
// interceptor will get applied here
// check the console output to see the interceptor changed the message
- hello.setGreeting((String)message.getBody().get());
+ String helloString = (String) message.getBody().get();
+ hello.setGreeting(helloString);
+ message.getBody().add(hello.getGreeting());
logFooter();
return message;
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/spring_aop/src/org/jboss/soa/esb/samples/quickstart/spring_aop/test/SendJMSMessage.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/spring_aop/src/org/jboss/soa/esb/samples/quickstart/spring_aop/test/SendJMSMessage.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/spring_aop/src/org/jboss/soa/esb/samples/quickstart/spring_aop/test/SendJMSMessage.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -30,6 +30,8 @@
import javax.naming.InitialContext;
import javax.naming.NamingException;
+import org.jboss.soa.esb.actions.StoreMessageToFile;
+
/**
* Send a JMS message that the ESB will listen for.
*
@@ -67,6 +69,7 @@
{
QueueSender send = session.createSender(que);
ObjectMessage tm = session.createObjectMessage(msg);
+ tm.setStringProperty(StoreMessageToFile.PROPERTY_JBESB_FILENAME, "SpringAOPTest.log");
send.send(tm);
send.close();
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/spring_helloworld/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/spring_helloworld/jboss-esb.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/spring_helloworld/jboss-esb.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -49,12 +49,13 @@
<property name="exceptionMethod" value="exceptionHandler"/>
<property name="springContextXml" value="spring-context-goodbye.xml"/>
</action>
- <action name="addHelloGoodbye"
+ <action name="addHelloGoodbye"
class="org.jboss.soa.esb.samples.quickstart.spring_helloworld.MySpringEnabledAction"
process="sayHelloSpring,sayGoodbyeSpring,displayMessage">
<property name="exceptionMethod" value="exceptionHandler"/>
<property name="springContextXml" value="spring-context-goodbye.xml,spring-context-hello.xml"/>
- </action>
+ </action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/spring_helloworld/src/org/jboss/soa/esb/samples/quickstart/spring_helloworld/test/SendJMSMessage.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/spring_helloworld/src/org/jboss/soa/esb/samples/quickstart/spring_helloworld/test/SendJMSMessage.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/spring_helloworld/src/org/jboss/soa/esb/samples/quickstart/spring_helloworld/test/SendJMSMessage.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -30,6 +30,8 @@
import javax.naming.InitialContext;
import javax.naming.NamingException;
+import org.jboss.soa.esb.actions.StoreMessageToFile;
+
/**
* Send a JMS message that the ESB will listen for.
*
@@ -66,6 +68,7 @@
QueueSender send = session.createSender(que);
ObjectMessage tm = session.createObjectMessage(msg);
+ tm.setStringProperty(StoreMessageToFile.PROPERTY_JBESB_FILENAME, "SpringHelloWorldTest.log");
send.send(tm);
send.close();
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/spring_jpetstore/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/spring_jpetstore/jboss-esb.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/spring_jpetstore/jboss-esb.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -37,12 +37,13 @@
/>
</listeners>
<actions>
- <action name="insertOrderAction"
+ <action name="insertOrderAction"
class="org.jboss.soa.esb.samples.quickstart.spring_jpetstore.InsertOrderAction"
process="insertOrder">
<property name="exceptionMethod" value="exceptionHandler"/>
<property name="springContextXml" value="applicationContext.xml,dataAccessContext-local.xml"/>
- </action>
+ </action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/spring_jpetstore/src/org/jboss/soa/esb/samples/quickstart/spring_jpetstore/test/SendJMSMessage.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/spring_jpetstore/src/org/jboss/soa/esb/samples/quickstart/spring_jpetstore/test/SendJMSMessage.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/spring_jpetstore/src/org/jboss/soa/esb/samples/quickstart/spring_jpetstore/test/SendJMSMessage.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -34,6 +34,8 @@
import javax.naming.InitialContext;
import javax.naming.NamingException;
+import org.jboss.soa.esb.actions.StoreMessageToFile;
+
/**
* Send a JMS message that the ESB will listen for.
*
@@ -70,6 +72,7 @@
QueueSender send = session.createSender(que);
ObjectMessage tm = session.createObjectMessage(msg);
+ tm.setStringProperty(StoreMessageToFile.PROPERTY_JBESB_FILENAME, "SpringJPetStoreTest.log");
send.send(tm);
send.close();
}
@@ -114,4 +117,4 @@
sm.stop();
}
-}
\ No newline at end of file
+}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/transform_CSV2XML/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/transform_CSV2XML/jboss-esb.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/transform_CSV2XML/jboss-esb.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -64,9 +64,7 @@
<property name="message" value=">>>> Message after Smooks intermediate xml -> target xml : " />
</action>
<!-- The next action is for Continuous Integration testing -->
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile">
- <property name="raw" value="true"/>
- </action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/transform_EDI2XML_Groovy_XSLT/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/transform_EDI2XML_Groovy_XSLT/jboss-esb.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/transform_EDI2XML_Groovy_XSLT/jboss-esb.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -37,9 +37,7 @@
<property name="message" value="[transform_EDI2XML_Groovy_XSLT] Message after transformation" />
</action>
<!-- The next action is for Continuous Integration testing -->
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile">
- <property name="raw" value="true"/>
- </action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/transform_XML2POJO/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/transform_XML2POJO/jboss-esb.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/transform_XML2POJO/jboss-esb.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -57,9 +57,7 @@
<property name="message" value=">>>> Message after Smooks intermediate xml -> target pojos : " />
</action>
<!-- The next action is for Continuous Integration testing -->
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile">
- <property name="raw" value="true"/>
- </action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/transform_XML2POJO2/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/transform_XML2POJO2/jboss-esb.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/transform_XML2POJO2/jboss-esb.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -38,7 +38,7 @@
maxThreads="1"
/>
</listeners>
- <actions mep="OneWay">
+ <actions mep="RequestResponse">
<action name="displayBeforeTransformer"
class="org.jboss.soa.esb.samples.quickstart.transformxml2pojo2.MyAction"
process="displayMessage"
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/transform_XML2XML_date_manipulation/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/transform_XML2XML_date_manipulation/jboss-esb.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/transform_XML2XML_date_manipulation/jboss-esb.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -39,9 +39,7 @@
value="[transform_XML2XML_date_manipulation] Message after transformation"/>
</action>
<!-- The next action is for Continuous Integration testing -->
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile">
- <property name="raw" value="true"/>
- </action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/transform_XML2XML_simple/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/transform_XML2XML_simple/jboss-esb.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/transform_XML2XML_simple/jboss-esb.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -37,9 +37,7 @@
<property name="message" value="[transform_XML2XML_simple] Message after transformation" />
</action>
<!-- The next action is for Continuous Integration testing -->
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile">
- <property name="raw" value="true"/>
- </action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer1/build.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer1/build.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer1/build.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -47,6 +47,15 @@
<delete verbose="true" quiet="true"
file="${org.jboss.esb.server.deploy.dir}/${ant.project.name}.war"/>
</target>
+
+ <target name="sendjms" depends="compile">
+ <echo>Send ESB message that triggers webservice call</echo>
+ <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.webservice_consumer1.test.SendJMSMessage" failonerror="true">
+ <arg value="Jimbo"/>
+ <classpath refid="exec-classpath"/>
+ </java>
+
+ </target>
<target name="runtest" depends="compile">
<echo>Send ESB message that triggers webservice call</echo>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer1/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer1/jboss-esb.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer1/jboss-esb.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -37,6 +37,7 @@
<action name="response-mapper"
class="org.jboss.soa.esb.samples.quickstart.webservice_consumer1.MyResponseAction">
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer1/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer1/test/SendEsbMessage.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer1/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer1/test/SendEsbMessage.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer1/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer1/test/SendEsbMessage.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -26,13 +26,15 @@
import org.jboss.soa.esb.message.format.MessageFactory;
import org.jboss.soa.esb.message.format.MessageType;
+import org.jboss.soa.esb.actions.StoreMessageToFile;
+
public class SendEsbMessage
{
/*
* Send a message directly the the ESB internal JMS listener. Demonstrates
* how one can bypass the gateway and speak directly to an ESB service.
*/
- private void sendMessage(String message) throws Exception
+ public void sendMessage(String message) throws Exception
{
// Create the delivery adapter for the target service (cache it)
System.setProperty("javax.xml.registry.ConnectionFactoryClass",
@@ -48,6 +50,7 @@
MessageType.JBOSS_XML);
requestMessage.getBody().add(message);
+ requestMessage.getProperties().setProperty(StoreMessageToFile.PROPERTY_JBESB_FILENAME, "WebServicesConsumer1Test.log");
// Deliver the request message synchronously - timeout after 20
// seconds...
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer1/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer1/test/SendJMSMessage.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/samples/quickstarts/webservice_consumer1/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer1/test/SendJMSMessage.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer1/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer1/test/SendJMSMessage.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer1/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer1/test/SendJMSMessage.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,86 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstart.webservice_consumer1.test;
+
+import java.util.Properties;
+
+import javax.jms.JMSException;
+import javax.jms.ObjectMessage;
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.QueueSender;
+import javax.jms.QueueSession;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+public class SendJMSMessage {
+ QueueConnection conn;
+ QueueSession session;
+ Queue que;
+
+
+ public void setupConnection() throws JMSException, NamingException
+ {
+ Properties properties1 = new Properties();
+ properties1.put(Context.INITIAL_CONTEXT_FACTORY,
+ "org.jnp.interfaces.NamingContextFactory");
+ properties1.put(Context.URL_PKG_PREFIXES,
+ "org.jboss.naming:org.jnp.interfaces");
+ properties1.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1099");
+ InitialContext iniCtx = new InitialContext(properties1);
+
+ Object tmp = iniCtx.lookup("ConnectionFactory");
+ QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
+ conn = qcf.createQueueConnection();
+ que = (Queue) iniCtx.lookup("queue/quickstart_webservice_consumer1_esb");
+ session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+ conn.start();
+ System.out.println("Connection Started");
+ }
+
+ public void stop() throws JMSException
+ {
+ conn.stop();
+ session.close();
+ conn.close();
+ }
+
+ public void sendAMessage(String msg) throws JMSException {
+
+ QueueSender send = session.createSender(que);
+ ObjectMessage tm = session.createObjectMessage(msg);
+ send.send(tm);
+ send.close();
+ }
+
+
+ public static void main(String args[]) throws Exception
+ {
+ SendJMSMessage sm = new SendJMSMessage();
+ sm.setupConnection();
+ sm.sendAMessage(args[0]);
+ sm.stop();
+
+ }
+
+}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer2/build.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer2/build.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer2/build.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -48,6 +48,16 @@
<delete verbose="true" quiet="true"
file="${org.jboss.esb.server.deploy.dir}/${ant.project.name}.war"/>
</target>
+
+ <target name="sendjms" depends="compile">
+
+ <echo>Send ESB message that triggers webservice call</echo>
+ <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.webservice_consumer2.test.SendJMSMessage" failonerror="true">
+ <arg value="Jimbo"/>
+ <classpath refid="exec-classpath"/>
+ </java>
+ </target>
+
<target name="runtest" depends="compile">
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer2/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer2/jboss-esb.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer2/jboss-esb.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -36,7 +36,8 @@
</action>
<action name="response-mapper"
class="org.jboss.soa.esb.samples.quickstart.webservice_consumer2.MyResponseAction">
- </action>
+ </action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer2/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer2/test/SendEsbMessage.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer2/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer2/test/SendEsbMessage.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer2/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer2/test/SendEsbMessage.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -25,6 +25,7 @@
import org.jboss.soa.esb.message.format.MessageFactory;
import org.jboss.soa.esb.message.format.MessageType;
+import org.jboss.soa.esb.actions.StoreMessageToFile;
public class SendEsbMessage
{
@@ -59,4 +60,4 @@
SendEsbMessage sm = new SendEsbMessage();
sm.sendMessage();
}
-}
\ No newline at end of file
+}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer2/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer2/test/SendJMSMessage.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/samples/quickstarts/webservice_consumer2/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer2/test/SendJMSMessage.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer2/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer2/test/SendJMSMessage.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_consumer2/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer2/test/SendJMSMessage.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,88 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstart.webservice_consumer2.test;
+
+import java.util.Properties;
+
+import javax.jms.JMSException;
+import javax.jms.ObjectMessage;
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.QueueSender;
+import javax.jms.QueueSession;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+public class SendJMSMessage {
+ QueueConnection conn;
+ QueueSession session;
+ Queue que;
+
+
+ public void setupConnection() throws JMSException, NamingException
+ {
+ Properties properties1 = new Properties();
+ properties1.put("javax.xml.registry.ConnectionFactoryClass",
+ "org.apache.ws.scout.registry.ConnectionFactoryImpl");
+ properties1.put(Context.INITIAL_CONTEXT_FACTORY,
+ "org.jnp.interfaces.NamingContextFactory");
+ properties1.put(Context.URL_PKG_PREFIXES,
+ "org.jboss.naming:org.jnp.interfaces");
+ properties1.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1099");
+ InitialContext iniCtx = new InitialContext(properties1);
+
+ Object tmp = iniCtx.lookup("ConnectionFactory");
+ QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
+ conn = qcf.createQueueConnection();
+ que = (Queue) iniCtx.lookup("queue/quickstart_webservice_consumer2_esb");
+ session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+ conn.start();
+ System.out.println("Connection Started");
+ }
+
+ public void stop() throws JMSException
+ {
+ conn.stop();
+ session.close();
+ conn.close();
+ }
+
+ public void sendAMessage(String msg) throws JMSException {
+
+ QueueSender send = session.createSender(que);
+ ObjectMessage tm = session.createObjectMessage(msg);
+ send.send(tm);
+ send.close();
+ }
+
+
+ public static void main(String args[]) throws Exception
+ {
+ SendJMSMessage sm = new SendJMSMessage();
+ sm.setupConnection();
+ sm.sendAMessage(args[0]);
+ sm.stop();
+
+ }
+
+}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_mtom/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_mtom/jboss-esb.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_mtom/jboss-esb.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -39,6 +39,7 @@
<property name="message"
value="[Quickstart_webservice_producer] Message after invoking jbossws endpoint"/>
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_mtom/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/MTOMEndpointBean.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_mtom/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/MTOMEndpointBean.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_mtom/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/MTOMEndpointBean.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -35,7 +35,7 @@
public ImageResponse echoImage(ImageRequest request) {
Image image = request.getData();
- System.out.println("*** Recieved Image: " + image);
+ System.out.println("*** Received Image: " + image);
//System.out.println("*** Image attached to ESB Message: " + image);
return new ImageResponse(image);
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_producer/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_producer/jboss-esb.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_producer/jboss-esb.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -37,7 +37,7 @@
<jms-listener name="JMS-ESBListener" busidref="quickstartEsbChannel" maxThreads="1"/>
</listeners>
- <actions mep="RequestResponse">
+ <actions>
<action name="print-before" class="org.jboss.soa.esb.actions.SystemPrintln">
<property name="message"
value="[Quickstart_webservice_producer] BEFORE invoking jbossws endpoint"/>
@@ -49,6 +49,7 @@
<property name="message"
value="[Quickstart_webservice_producer] AFTER invoking jbossws endpoint"/>
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_producer/src/org/jboss/soa/esb/samples/quickstart/webserviceproducer/test/SendMessage.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_producer/src/org/jboss/soa/esb/samples/quickstart/webserviceproducer/test/SendMessage.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/webservice_producer/src/org/jboss/soa/esb/samples/quickstart/webserviceproducer/test/SendMessage.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -35,6 +35,8 @@
import javax.naming.NamingException;
import java.net.InetAddress;
+import org.jboss.soa.esb.actions.StoreMessageToFile;
+
public class SendMessage {
QueueConnection conn;
QueueSession session;
@@ -49,6 +51,7 @@
sender = session.createSender(que);
tm = session.createObjectMessage(message);
+ tm.setStringProperty(StoreMessageToFile.PROPERTY_JBESB_FILENAME, "WebServiceProducerTest.log");
sender.send(tm);
} finally {
if(sender != null) {
@@ -107,14 +110,11 @@
SendMessage sm = new SendMessage();
String msg = getMessage("01");
- sm.sendMessageToJBRListener("http", 8765, msg);
- /*
String protocol = args[0];
if(protocol.equals("jms")) {
sm.sendMessageOverJMS(msg);
} else {
sm.sendMessageToJBRListener(protocol, Integer.parseInt(args[1]), msg);
}
- */
}
-}
\ No newline at end of file
+}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/wiretap/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/wiretap/jboss-esb.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/wiretap/jboss-esb.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -80,7 +80,7 @@
</property>
</action>
<!-- The next action is for Continuous Integration testing -->
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile" />
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore" />
</actions>
</service>
@@ -103,7 +103,7 @@
</NotificationList>
</property>
</action>
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile" />
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore" />
</actions>
</service>
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/CommandExecutorFactory.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/CommandExecutorFactory.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/CommandExecutorFactory.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006,
- */
-package org.jboss.soa.esb.services.jbpm;
-
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.services.jbpm.actions.CommandInterpreter;
-import org.jboss.soa.esb.services.jbpm.actions.impl.DefaultCommandExecutorFactoryImpl;
-
-/**
- * Factory to obtain appropriate Performer for the jBPM CommandInterpreter
- *
- * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
- *
- */
-public abstract class CommandExecutorFactory
-{
-
- public abstract CommandInterpreter.CommandExecutor
- getExecutor(Message message) throws Exception;
-
-
- protected static final Object s_oSynch = new Integer(0);
-
- protected static CommandExecutorFactory _factory;
- public static CommandExecutorFactory getInstance()
- {
- if (null==_factory)
- synchronized(s_oSynch)
- {
- if (null==_factory)
- _factory=new DefaultCommandExecutorFactoryImpl();
- };
- return _factory;
- } //________________________________
-}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/Constants.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/Constants.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/Constants.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -95,23 +95,23 @@
// ,AbstractGetObjectBaseCommand
// ,AsynchronousCommand
,CancelProcessInstanceCommand
- ,CancelTokenCommand
- ,CancelWorkOnTaskCommand
+// ,CancelTokenCommand
+// ,CancelWorkOnTaskCommand
// ,ChangeProcessInstanceVersionCommand
// ,Command
// ,CommandService
// ,CompositeCommand
// ,GetProcessDefinitionCommand
- ,GetProcessInstanceCommand
+// ,GetProcessInstanceCommand
// ,GetProcessInstancesCommand
- ,GetTaskInstanceCommand
- ,GetTaskListCommand
+// ,GetTaskInstanceCommand
+// ,GetTaskListCommand
,NewProcessInstanceCommand
,SignalCommand
,StartProcessInstanceCommand
- ,StartWorkOnTaskCommand
- ,TaskInstanceEndCommand
- ,VariablesCommand
+// ,StartWorkOnTaskCommand
+// ,TaskInstanceEndCommand
+// ,VariablesCommand
;
}
}
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/MessageFacadeFactory.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/MessageFacadeFactory.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/MessageFacadeFactory.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -1,53 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006,
- */
-package org.jboss.soa.esb.services.jbpm;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.services.jbpm.actions.BpmProcessor;
-import org.jboss.soa.esb.services.jbpm.actions.impl.DefaultMessageFacadeFactoryImpl;
-
-/**
- * Factory to obtain appropriate MessageManipulator for jBPM BpmProcessor
- *
- * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
- *
- */
-public abstract class MessageFacadeFactory
-{
-
- public abstract BpmProcessor.MessageFacade
- getPreProcessor(ConfigTree config) throws ConfigurationException;
-
-
- protected static final Object s_oSynch = new Integer(0);
-
- private static MessageFacadeFactory _factory;
- public static MessageFacadeFactory getInstance()
- {
- if (null==_factory)
- synchronized(s_oSynch)
- {
- if (null==_factory)
- _factory=new DefaultMessageFacadeFactoryImpl();
- };
- return _factory;
- } //________________________________
-}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actionhandlers/EsbActionHandler.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actionhandlers/EsbActionHandler.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actionhandlers/EsbActionHandler.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -37,11 +37,10 @@
import org.jboss.soa.esb.listeners.message.MessageDeliverException;
import org.jboss.soa.esb.message.Body;
import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.body.content.BytesBody;
import org.jboss.soa.esb.message.format.MessageFactory;
import org.jboss.soa.esb.message.mapping.ObjectMapper;
import org.jboss.soa.esb.services.jbpm.Constants;
-import org.jboss.soa.esb.services.jbpm.util.Helper;
+import org.jboss.soa.esb.services.jbpm.cmd.MessageHelper;
import org.jbpm.context.exe.ContextInstance;
import org.jbpm.graph.def.ActionHandler;
import org.jbpm.graph.def.Node;
@@ -254,22 +253,22 @@
Call call = template.getHeader().getCall();
call.setMessageID(new URI(UUID.randomUUID().toString()));
- Helper.setLongValue(template, Constants.TOKEN_ID, _token.getId());
+ MessageHelper.setLongValue(template, Constants.TOKEN_ID, _token.getId());
Node node = _token.getNode();
if (null != node)
- Helper.setStringValue(template, Constants.CURRENT_NODE_NAME, node
+ MessageHelper.setStringValue(template, Constants.CURRENT_NODE_NAME, node
.getName());
ProcessInstance instance = _token.getProcessInstance();
- Helper.setLongValue(template, Constants.PROCESS_INSTANCE_ID, instance
+ MessageHelper.setLongValue(template, Constants.PROCESS_INSTANCE_ID, instance
.getId());
ProcessDefinition process = instance.getProcessDefinition();
- Helper.setObjectValue(template, Constants.PROCESS_DEFINITION_NAME,
+ MessageHelper.setObjectValue(template, Constants.PROCESS_DEFINITION_NAME,
process.getName());
- Helper.setIntValue(template, Constants.PROCESS_DEFINITION_VERSION,
+ MessageHelper.setIntValue(template, Constants.PROCESS_DEFINITION_VERSION,
process.getVersion());
- Helper.setLongValue(template, Constants.PROCESS_DEFINITION_ID, process
+ MessageHelper.setLongValue(template, Constants.PROCESS_DEFINITION_ID, process
.getId());
return template;
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actions/BpmProcessor.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actions/BpmProcessor.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actions/BpmProcessor.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -22,14 +22,17 @@
package org.jboss.soa.esb.services.jbpm.actions;
+import org.apache.log4j.Logger;
import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.actions.ActionLifecycle;
+import org.jboss.soa.esb.actions.ActionLifecycleException;
import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.addressing.MalformedEPRException;
-import org.jboss.soa.esb.couriers.CourierException;
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.message.Message;
import org.jboss.soa.esb.services.jbpm.Constants;
-import org.jboss.soa.esb.services.jbpm.MessageFacadeFactory;
+import org.jboss.soa.esb.services.jbpm.cmd.CommandExecutor;
+import org.jboss.soa.esb.services.jbpm.cmd.MessageFacade;
+import org.jbpm.JbpmException;
/**
*
@@ -37,52 +40,58 @@
* Part of the message content will be taken from constructor time configuration
* (from the action configuration XML)
*
-* @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
+* @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
+* @author <a href="mailto:kurt.stam at jboss.com">Kurt Stam</a>
*/
-public class BpmProcessor extends CommandInterpreter
+public class BpmProcessor implements ActionLifecycle
{
+ protected MessageFacade _stuffer;
+ protected ConfigTree _config;
+ private static Logger _logger = Logger.getLogger(BpmProcessor.class);
public static final String COMMAND_ATTRIBUTE_TAG = "command";
+ public void destroy() throws ActionLifecycleException {
+ _logger.info("destroy() invoked");
+ }
+ public void initialise() throws ActionLifecycleException {
+ _logger.info("initialise() invoked - config="+_config);
+ if (null==_config)
+ _config = new ConfigTree("autoGenerated");
+ }
+
public BpmProcessor(ConfigTree config) throws ConfigurationException
{
- super(config);
+ _config = config;
+ checkMyParms();
}
public Constants.OpCode getOpCode() { return _stuffer.getOpCode(); }
- @Override
+
protected void checkMyParms() throws ConfigurationException
{
- _stuffer = MessageFacadeFactory.getInstance().getPreProcessor(_config);
- } // _______________________________
-
- @Override
- public Message process(Message message)
- throws MalformedEPRException, CourierException, ActionProcessingException
+ _stuffer = MessageFacade.getFacade(_config);
+ }
+
+ public void process(Message message)
+ throws ActionProcessingException
{
message.getBody().add(Constants.COMMAND_CODE,getOpCode().toString());
- _stuffer.preFormat(message);
- Message response = super.process(message);
- return _stuffer.postFormat(response);
- } // _______________________________
-
- protected MessageFacade _stuffer;
- public interface MessageFacade
- {
- /**
- * Obtain the operation code that this preprocessor will force into the command message
- * @return Constants.OpCode
- */
- public Constants.OpCode getOpCode();
- /**
- * Some message values are fixed at action configuration time (from the jboss-esb.xml).
- * <br/>This method is responsible of stuffing these static values into every Message
- * before passing it to the generic CommandInterpreter process(Message) method
- * <br/>Some of the Message content will thus come from configuration XML, and some will
- * be the users' responsibility (e.g. processId, tokenId, etc)
- * <br/>Variable name mapping between esb and jBPM is also handled by this interface
- * @param message Message - Into which the static values will be added
- */
- public void preFormat(Message request);
- public Message postFormat(Message response);
+ _stuffer.setJBPMContextParameters(message);
+ try
+ {
+ CommandExecutor commandExecutor = CommandExecutor.getInstance();
+ String commandString = (String)message.getBody().get(Constants.COMMAND_CODE);
+ commandExecutor.getCommand(commandString).execute(message);
+ }
+ catch (JbpmException e)
+ {
+ throw new ActionProcessingException(e.getMessage(), e);
+ }
+ catch (Exception e)
+ {
+ _logger.error(e.getMessage(), e);
+ throw new ActionProcessingException(e.getMessage(), e);
+ }
}
+
}
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actions/CommandInterpreter.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actions/CommandInterpreter.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actions/CommandInterpreter.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -1,232 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.soa.esb.services.jbpm.actions;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.actions.ActionLifecycle;
-import org.jboss.soa.esb.actions.ActionLifecycleException;
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.actions.ActionProcessingFaultException;
-import org.jboss.soa.esb.addressing.MalformedEPRException;
-import org.jboss.soa.esb.couriers.CourierException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Body;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.services.jbpm.CommandExecutorFactory;
-import org.jboss.soa.esb.services.jbpm.Constants;
-import org.jboss.soa.esb.services.jbpm.util.Helper;
-import org.jbpm.JbpmConfiguration;
-import org.jbpm.JbpmException;
-import org.jbpm.command.Command;
-import org.jbpm.command.CommandService;
-import org.jbpm.command.impl.CommandServiceImpl;
-
-/**
- *
- * jBPM command interpreter.
- *
- * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
- *
- */
-public class CommandInterpreter implements ActionLifecycle
-{
- public void destroy() throws ActionLifecycleException {
- _logger.info("destroy() invoked");
- }
- public void initialise() throws ActionLifecycleException {
- _logger.info("initialise() invoked - config="+_config);
- if (null==_config)
- _config = new ConfigTree("autoGenerated");
-
- }
-
- public CommandInterpreter(ConfigTree config) throws ConfigurationException
- {
- _config = config;
- checkMyParms();
- } // ________________________________
-
- /**
- * If the end state is reached within a jBPM process, then the ESB will propagate back
- * an appropriate error message to the sender.
- *
- * @param message
- * @return
- * @throws MalformedEPRException
- * @throws CourierException
- * @throws ActionProcessingException
- */
-
- public Message process(Message message)
- throws MalformedEPRException, CourierException, ActionProcessingException
- {
- Message response = null;
- try
- {
- response = CommandExecutorFactory.getInstance().getExecutor(message).execute(message);
- }
- catch (JbpmException e)
- {
- _logger.error(e.getMessage(), e);
-
- if (endState(e))
- {
- _logger.info("End-state reached for jBPM process.");
-
- /*
- * Throw an exception so that the fault message can be
- * propagated back to the sender.
- */
-
- throw new ActionProcessingFaultException("jBPM end state reached!");
- }
- else
- throw new ActionProcessingException(e.getMessage(), e);
- }
- catch (Exception e)
- {
- _logger.error(e.getMessage(), e);
- throw new ActionProcessingException(e.getMessage(), e);
- }
-
- return response;
- } //________________________________
-
- public static Message doTheJob(Command command) throws JbpmException
- {
- Message response = Helper.commandMessageTemplate();
- Body body = response.getBody();
-
- try
- {
- Object obj = getJbpmCommandService().execute(command);
- body.add(Constants.RETURN_CODE, Constants.RETCODE_OK);
- if (null!=obj)
- body.add(Constants.JBPM_RETURN_OBJECT, obj);
- }
- catch (JbpmException e)
- {
- // why do we do this when response will clearly not be returned?!
- // http://jira.jboss.com/jira/browse/JBESB-1272
-
- body.add(Constants.RETURN_CODE, Constants.RETCODE_EXCEPTION);
- body.add(Constants.EXCEPTION, e);
- throw e;
- }
-
- return response;
- } //________________________________
-
- /**
- * Should this class need any extra configuration, this is the placeholder where to check
- * if configuration is OK.
- * @throws ConfigurationException
- */
- protected void checkMyParms() throws ConfigurationException
- {
- } // _______________________________
-
- /**
- * Encapsulate obtention of jBPM CommandService here
- * <br/>If it can't be cached, we only need to change this method.
- * @return CommandService
- */
- public static CommandService getJbpmCommandService()
- {
- if (null== s_jbpmService)
- synchronized (s_oSynch)
- {
- if (null!= s_jbpmService)
- return s_jbpmService;
-
- if (null==s_jbpmConfig)
- s_jbpmConfig = JbpmConfiguration.getInstance();
- s_jbpmService = new CommandServiceImpl(s_jbpmConfig);
- }
- return s_jbpmService;
- } //________________________________
-
- protected static JbpmConfiguration getJbpmConfig()
- {
- if (null== s_jbpmConfig)
- synchronized (s_oSynch)
- {
- if (null==s_jbpmConfig)
- s_jbpmConfig = JbpmConfiguration.getInstance();
- }
- return s_jbpmConfig;
- } //________________________________
-
- /**
- * Set an ad hoc jbpm configuration (generally used for testing)
- * @param xmlConfig String - The jbpm.cfg.xml compliant xml string
- * @throws Exception - If jbpm configuration was already set
- */
- public static void setJbpmConfig(String xmlConfig) throws Exception
- {
- if (null== s_jbpmConfig)
- synchronized (s_oSynch)
- {
- if (null==s_jbpmConfig)
- {
- s_jbpmConfig = JbpmConfiguration.getInstance(xmlConfig);
- return;
- }
- }
- throw new Exception("Jbpm configuration has already been set");
- } //________________________________
-
- protected ConfigTree _config;
- private static Logger _logger = Logger.getLogger(CommandInterpreter.class);
-
- private static final Object s_oSynch = new Integer(0);
- private static JbpmConfiguration s_jbpmConfig;
- private static CommandService s_jbpmService;
-
- private final String END_STATE = "couldn't signal token 'Token(/)' : node 'EndState(end-state1)'";
-
- /*
- * Would be nice if JbpmExceptions contained a fault code. Or had more subclasses
- * of JbpmException.
- */
-
- private final boolean endState (JbpmException ex)
- {
- Throwable thrw = ex;
-
- while (thrw != null)
- {
- if (thrw.getMessage().contains(END_STATE))
- return true;
- else
- thrw = thrw.getCause();
- }
-
- return false;
- }
-
- public interface CommandExecutor
- {
- public Message execute (Message message) throws Exception;
- }
-}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd)
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CancelProcessInstanceFacade.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CancelProcessInstanceFacade.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CancelProcessInstanceFacade.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -1,49 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.soa.esb.services.jbpm.cmd;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.services.jbpm.Constants;
-import org.jboss.soa.esb.services.jbpm.Constants.OpCode;
-
-/**
- *
- * Implementation of a message preprocessor to obtain data from a process instance
- * from the action configuration XML
- *
- * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
- */
-public class CancelProcessInstanceFacade extends MessageFacade
-{
- public OpCode getOpCode() { return Constants.OpCode.CancelProcessInstanceCommand; }
-
- public CancelProcessInstanceFacade(ConfigTree config) throws ConfigurationException
- {
- }
-
- public void setJBPMContextParameters(Message message)
- {
- }
-}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CancelProcessInstanceFacade.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CancelProcessInstanceFacade.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CancelProcessInstanceFacade.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CancelProcessInstanceFacade.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.soa.esb.services.jbpm.cmd;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.services.jbpm.Constants;
+import org.jboss.soa.esb.services.jbpm.Constants.OpCode;
+
+/**
+ *
+ * Implementation of a message preprocessor to obtain data from a process instance
+ * from the action configuration XML
+ *
+ * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
+ */
+public class CancelProcessInstanceFacade extends MessageFacade
+{
+ public OpCode getOpCode() { return Constants.OpCode.CancelProcessInstanceCommand; }
+
+ public CancelProcessInstanceFacade(ConfigTree config) throws ConfigurationException
+ {
+ }
+
+ public void setJBPMContextParameters(Message message)
+ {
+ }
+}
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/Command.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/Command.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/Command.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -1,16 +0,0 @@
-/**
- *
- */
-package org.jboss.soa.esb.services.jbpm.cmd;
-
-import org.jboss.soa.esb.message.Message;
-import org.jbpm.JbpmException;
-
-/**
- * @author kstam
- *
- */
-public interface Command
-{
- public void execute (Message message) throws JbpmException;
-}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/Command.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/Command.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/Command.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/Command.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,16 @@
+/**
+ *
+ */
+package org.jboss.soa.esb.services.jbpm.cmd;
+
+import org.jboss.soa.esb.message.Message;
+import org.jbpm.JbpmException;
+
+/**
+ * @author kstam
+ *
+ */
+public interface Command
+{
+ public void execute (Message message) throws JbpmException;
+}
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CommandExecutor.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CommandExecutor.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CommandExecutor.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -1,244 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.soa.esb.services.jbpm.cmd;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.mapping.ObjectMapper;
-import org.jboss.soa.esb.message.mapping.ObjectMappingException;
-import org.jboss.soa.esb.services.jbpm.Constants;
-import org.jbpm.JbpmConfiguration;
-import org.jbpm.JbpmContext;
-import org.jbpm.JbpmException;
-import org.jbpm.command.CancelProcessInstanceCommand;
-import org.jbpm.command.CommandService;
-import org.jbpm.command.GetProcessInstanceCommand;
-import org.jbpm.command.NewProcessInstanceCommand;
-import org.jbpm.command.SignalCommand;
-import org.jbpm.command.StartProcessInstanceCommand;
-import org.jbpm.command.impl.CommandServiceImpl;
-import org.jbpm.graph.def.ProcessDefinition;
-import org.jbpm.graph.exe.ProcessInstance;
-
-/**
- * Executes jBPM commands.
- *
- * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
- * @author <a href="mailto:kurt.stam at jboss.com">Kurt Stam</a>
- *
- */
-public class CommandExecutor
-{
- static CommandExecutor commandExecutor;
-
- private static Logger _logger = Logger.getLogger(CommandExecutor.class);
- private static JbpmConfiguration s_jbpmConfig;
- private static CommandService s_jbpmService;
-
- public static CommandExecutor getInstance()
- {
- if (commandExecutor==null) {
- commandExecutor =new CommandExecutor();
- }
- return commandExecutor;
- }
-
- public Command getCommand(String commandString) throws Exception
- {
- Constants.OpCode opCode = Constants.OpCode.valueOf(commandString);
- Command command = _values.get(opCode);
- if (null==command)
- throw new Exception(opCode.toString()+" not implemented,");
- return command;
- }
-
- protected static final Command DEPLOY_PROCESS_DEF_EXECUTOR = new Command()
- {
- public void execute(Message request) throws JbpmException
- {
- Object obj = MessageHelper.getObjectValue(request, Constants.PROCESS_DEFINITION);
- if (null==obj)
- {
- obj = ProcessDefinition.parseXmlString
- ((String)MessageHelper.getObjectValue(request,Constants.PROCESS_DEFINITION_XML));
- }
- final ProcessDefinition def = (ProcessDefinition)obj;
- _logger.debug("Deploying new process definition " + def.getName());
- executeJbpmCommand(new org.jbpm.command.Command()
- {
- private static final long serialVersionUID = 1L;
- ProcessDefinition _def = def;
-
- public Object execute(JbpmContext jbpmCtx) throws Exception
- {
- jbpmCtx.deployProcessDefinition(_def);
- _logger.info("Process Definition '" + def.getName() + "' is deployed.");
- return null;
- }
- });
- }
- };
-
-
- protected static final Command CANCEL_PROCESS_INSTANCE_EXECUTOR = new Command()
- {
- public void execute(Message request) throws JbpmException
- {
- long processId = MessageHelper.getLongValue(request,Constants.PROCESS_INSTANCE_ID);
- _logger.debug("Cancel Process Instance Command for ProcessId=" + processId);
- executeJbpmCommand(new CancelProcessInstanceCommand(processId));
- }
- };
-
- protected static final Command SIGNAL_EXECUTOR=new Command()
- {
- public void execute(Message request) throws JbpmException
- {
- SignalCommand command = new SignalCommand();
- Long tokenId = MessageHelper.getLongValue(request,Constants.TOKEN_ID);
- if (null== tokenId)
- {
- Long processId = MessageHelper.getLongValue(request,Constants.PROCESS_INSTANCE_ID);
- _logger.debug("TokenId was not found, so try to obtain the root token from this process definition, " +
- " with ProcessId=" + processId);
- // now try with the process id (use root token)
- if (processId==null) {
- throw new JbpmException("Either <"+Constants.TOKEN_ID+"> or <"+Constants.PROCESS_INSTANCE_ID
- +"> object must be specified in Message body to know who to signal");
- }
- ProcessInstance inst = (ProcessInstance)getJbpmCommandService()
- .execute(new GetProcessInstanceCommand(processId));
- tokenId = inst.getRootToken().getId();
- }
- command.setTokenId(tokenId);
-
- String transition = MessageHelper.getStringValue(request, Constants.TRANSITION_NAME);
- if (null!=transition)
- command.setTransitionName(transition);
-
- Map map = (Map)MessageHelper.getObjectValue(request, Constants.VARIABLE_VALUES);
- if (null!=map) command.setVariables(map);
-
- _logger.debug("Signaling Process with TokenId=" + tokenId + ", Transition=" + transition + ", VariableMap=" + map);
- executeJbpmCommand(command);
- }
- };
-
-
- protected static Map<Constants.OpCode,Command> _values = new HashMap<Constants.OpCode,Command>();
- static
- {
- _values.put(Constants.OpCode.CancelProcessInstanceCommand,CANCEL_PROCESS_INSTANCE_EXECUTOR);
- _values.put(Constants.OpCode.SignalCommand ,SIGNAL_EXECUTOR);
- _values.put(Constants.OpCode.DeployProcessDefinition ,DEPLOY_PROCESS_DEF_EXECUTOR);
- _values.put(Constants.OpCode.NewProcessInstanceCommand
- ,new CommandExecutor.NewProcessInstancePerformer(false));
- _values.put(Constants.OpCode.StartProcessInstanceCommand
- ,new CommandExecutor.NewProcessInstancePerformer(true));
- }
-
- // this class is used both for NewProcessInstance and for StartProcessInstance
- protected static final class NewProcessInstancePerformer implements Command
- {
- private boolean _start;
- public NewProcessInstancePerformer(boolean start) { _start = start; }
-
- public void execute(Message request) throws JbpmException
- {
- perform(request,_start);
- }
-
- private void perform(Message request, boolean start) throws JbpmException
- {
- ObjectMapper objectMapper = new ObjectMapper();
- NewProcessInstanceCommand command = null;
- if (start) {
- StartProcessInstanceCommand startCmd = new StartProcessInstanceCommand();
- String transition = MessageHelper.getStringValue(request, Constants.TRANSITION_NAME);
- if (null!=transition)
- startCmd.setStartTransitionName(transition);
- command = startCmd;
- } else {
- command = new NewProcessInstanceCommand();
- }
- Long processDefId = MessageHelper.getLongValue(request,Constants.PROCESS_DEFINITION_ID);
- if (null!=processDefId) {
- command.setProcessId(processDefId);
- } else {
- String processName = MessageHelper.getStringValue(request,Constants.PROCESS_DEFINITION_NAME);
- if (null!=processName) {
- command.setProcessName(processName);
- } else {
- throw new JbpmException("At least one of "+Constants.PROCESS_DEFINITION_NAME
- +" or "+Constants.PROCESS_DEFINITION_ID+" must have a valid value");
- }
- }
- String keyPath = MessageHelper.getStringValue(request, Constants.KEYPATH);
- if (keyPath!=null) {
- try {
- String key = String.valueOf(objectMapper.getObjectFromMessage(request, keyPath));
- command.setKey(key);
- } catch (ObjectMappingException e) {
- _logger.error("Could not locate key " + e.getMessage(), e);
- }
- }
- String actorId=MessageHelper.getStringValue(request, Constants.ACTOR_ID);
- if (null!=actorId) command.setActorId(actorId);
- Boolean createStartTask = MessageHelper.getBooleanValue(request, Constants.CREATE_START_TASK);
- if (null!=createStartTask) command.setCreateStartTask(createStartTask);
- Map<String, Object> variables = MessageHelper.getVariablesMap(request, Constants.VARIABLE_VALUES);
- if (null!=variables) command.setVariables(variables);
-
- _logger.debug("New process instance with command=" + command);
- executeJbpmCommand(command);
- }
- }
-
- private static void executeJbpmCommand(org.jbpm.command.Command command) throws JbpmException
- {
- if (_logger.isDebugEnabled()) {
- _logger.debug(command);
- }
- getJbpmCommandService().execute(command);
- }
-
- /**
- * Encapsulate obtention of jBPM CommandService here
- * <br/>If it can't be cached, we only need to change this method.
- * @return CommandService
- */
- public static CommandService getJbpmCommandService()
- {
- if (null== s_jbpmService) {
- s_jbpmConfig = JbpmConfiguration.getInstance();
- s_jbpmService = new CommandServiceImpl(s_jbpmConfig);
- }
- return s_jbpmService;
- }
-
-
-
-}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CommandExecutor.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CommandExecutor.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CommandExecutor.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/CommandExecutor.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,244 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.soa.esb.services.jbpm.cmd;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.mapping.ObjectMapper;
+import org.jboss.soa.esb.message.mapping.ObjectMappingException;
+import org.jboss.soa.esb.services.jbpm.Constants;
+import org.jbpm.JbpmConfiguration;
+import org.jbpm.JbpmContext;
+import org.jbpm.JbpmException;
+import org.jbpm.command.CancelProcessInstanceCommand;
+import org.jbpm.command.CommandService;
+import org.jbpm.command.GetProcessInstanceCommand;
+import org.jbpm.command.NewProcessInstanceCommand;
+import org.jbpm.command.SignalCommand;
+import org.jbpm.command.StartProcessInstanceCommand;
+import org.jbpm.command.impl.CommandServiceImpl;
+import org.jbpm.graph.def.ProcessDefinition;
+import org.jbpm.graph.exe.ProcessInstance;
+
+/**
+ * Executes jBPM commands.
+ *
+ * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
+ * @author <a href="mailto:kurt.stam at jboss.com">Kurt Stam</a>
+ *
+ */
+public class CommandExecutor
+{
+ static CommandExecutor commandExecutor;
+
+ private static Logger _logger = Logger.getLogger(CommandExecutor.class);
+ private static JbpmConfiguration s_jbpmConfig;
+ private static CommandService s_jbpmService;
+
+ public static CommandExecutor getInstance()
+ {
+ if (commandExecutor==null) {
+ commandExecutor =new CommandExecutor();
+ }
+ return commandExecutor;
+ }
+
+ public Command getCommand(String commandString) throws Exception
+ {
+ Constants.OpCode opCode = Constants.OpCode.valueOf(commandString);
+ Command command = _values.get(opCode);
+ if (null==command)
+ throw new Exception(opCode.toString()+" not implemented,");
+ return command;
+ }
+
+ protected static final Command DEPLOY_PROCESS_DEF_EXECUTOR = new Command()
+ {
+ public void execute(Message request) throws JbpmException
+ {
+ Object obj = MessageHelper.getObjectValue(request, Constants.PROCESS_DEFINITION);
+ if (null==obj)
+ {
+ obj = ProcessDefinition.parseXmlString
+ ((String)MessageHelper.getObjectValue(request,Constants.PROCESS_DEFINITION_XML));
+ }
+ final ProcessDefinition def = (ProcessDefinition)obj;
+ _logger.debug("Deploying new process definition " + def.getName());
+ executeJbpmCommand(new org.jbpm.command.Command()
+ {
+ private static final long serialVersionUID = 1L;
+ ProcessDefinition _def = def;
+
+ public Object execute(JbpmContext jbpmCtx) throws Exception
+ {
+ jbpmCtx.deployProcessDefinition(_def);
+ _logger.info("Process Definition '" + def.getName() + "' is deployed.");
+ return null;
+ }
+ });
+ }
+ };
+
+
+ protected static final Command CANCEL_PROCESS_INSTANCE_EXECUTOR = new Command()
+ {
+ public void execute(Message request) throws JbpmException
+ {
+ long processId = MessageHelper.getLongValue(request,Constants.PROCESS_INSTANCE_ID);
+ _logger.debug("Cancel Process Instance Command for ProcessId=" + processId);
+ executeJbpmCommand(new CancelProcessInstanceCommand(processId));
+ }
+ };
+
+ protected static final Command SIGNAL_EXECUTOR=new Command()
+ {
+ public void execute(Message request) throws JbpmException
+ {
+ SignalCommand command = new SignalCommand();
+ Long tokenId = MessageHelper.getLongValue(request,Constants.TOKEN_ID);
+ if (null== tokenId)
+ {
+ Long processId = MessageHelper.getLongValue(request,Constants.PROCESS_INSTANCE_ID);
+ _logger.debug("TokenId was not found, so try to obtain the root token from this process definition, " +
+ " with ProcessId=" + processId);
+ // now try with the process id (use root token)
+ if (processId==null) {
+ throw new JbpmException("Either <"+Constants.TOKEN_ID+"> or <"+Constants.PROCESS_INSTANCE_ID
+ +"> object must be specified in Message body to know who to signal");
+ }
+ ProcessInstance inst = (ProcessInstance)getJbpmCommandService()
+ .execute(new GetProcessInstanceCommand(processId));
+ tokenId = inst.getRootToken().getId();
+ }
+ command.setTokenId(tokenId);
+
+ String transition = MessageHelper.getStringValue(request, Constants.TRANSITION_NAME);
+ if (null!=transition)
+ command.setTransitionName(transition);
+
+ Map map = (Map)MessageHelper.getObjectValue(request, Constants.VARIABLE_VALUES);
+ if (null!=map) command.setVariables(map);
+
+ _logger.debug("Signaling Process with TokenId=" + tokenId + ", Transition=" + transition + ", VariableMap=" + map);
+ executeJbpmCommand(command);
+ }
+ };
+
+
+ protected static Map<Constants.OpCode,Command> _values = new HashMap<Constants.OpCode,Command>();
+ static
+ {
+ _values.put(Constants.OpCode.CancelProcessInstanceCommand,CANCEL_PROCESS_INSTANCE_EXECUTOR);
+ _values.put(Constants.OpCode.SignalCommand ,SIGNAL_EXECUTOR);
+ _values.put(Constants.OpCode.DeployProcessDefinition ,DEPLOY_PROCESS_DEF_EXECUTOR);
+ _values.put(Constants.OpCode.NewProcessInstanceCommand
+ ,new CommandExecutor.NewProcessInstancePerformer(false));
+ _values.put(Constants.OpCode.StartProcessInstanceCommand
+ ,new CommandExecutor.NewProcessInstancePerformer(true));
+ }
+
+ // this class is used both for NewProcessInstance and for StartProcessInstance
+ protected static final class NewProcessInstancePerformer implements Command
+ {
+ private boolean _start;
+ public NewProcessInstancePerformer(boolean start) { _start = start; }
+
+ public void execute(Message request) throws JbpmException
+ {
+ perform(request,_start);
+ }
+
+ private void perform(Message request, boolean start) throws JbpmException
+ {
+ ObjectMapper objectMapper = new ObjectMapper();
+ NewProcessInstanceCommand command = null;
+ if (start) {
+ StartProcessInstanceCommand startCmd = new StartProcessInstanceCommand();
+ String transition = MessageHelper.getStringValue(request, Constants.TRANSITION_NAME);
+ if (null!=transition)
+ startCmd.setStartTransitionName(transition);
+ command = startCmd;
+ } else {
+ command = new NewProcessInstanceCommand();
+ }
+ Long processDefId = MessageHelper.getLongValue(request,Constants.PROCESS_DEFINITION_ID);
+ if (null!=processDefId) {
+ command.setProcessId(processDefId);
+ } else {
+ String processName = MessageHelper.getStringValue(request,Constants.PROCESS_DEFINITION_NAME);
+ if (null!=processName) {
+ command.setProcessName(processName);
+ } else {
+ throw new JbpmException("At least one of "+Constants.PROCESS_DEFINITION_NAME
+ +" or "+Constants.PROCESS_DEFINITION_ID+" must have a valid value");
+ }
+ }
+ String keyPath = MessageHelper.getStringValue(request, Constants.KEYPATH);
+ if (keyPath!=null) {
+ try {
+ String key = String.valueOf(objectMapper.getObjectFromMessage(request, keyPath));
+ command.setKey(key);
+ } catch (ObjectMappingException e) {
+ _logger.error("Could not locate key " + e.getMessage(), e);
+ }
+ }
+ String actorId=MessageHelper.getStringValue(request, Constants.ACTOR_ID);
+ if (null!=actorId) command.setActorId(actorId);
+ Boolean createStartTask = MessageHelper.getBooleanValue(request, Constants.CREATE_START_TASK);
+ if (null!=createStartTask) command.setCreateStartTask(createStartTask);
+ Map<String, Object> variables = MessageHelper.getVariablesMap(request, Constants.VARIABLE_VALUES);
+ if (null!=variables) command.setVariables(variables);
+
+ _logger.debug("New process instance with command=" + command);
+ executeJbpmCommand(command);
+ }
+ }
+
+ private static void executeJbpmCommand(org.jbpm.command.Command command) throws JbpmException
+ {
+ if (_logger.isDebugEnabled()) {
+ _logger.debug(command);
+ }
+ getJbpmCommandService().execute(command);
+ }
+
+ /**
+ * Encapsulate obtention of jBPM CommandService here
+ * <br/>If it can't be cached, we only need to change this method.
+ * @return CommandService
+ */
+ public static CommandService getJbpmCommandService()
+ {
+ if (null== s_jbpmService) {
+ s_jbpmConfig = JbpmConfiguration.getInstance();
+ s_jbpmService = new CommandServiceImpl(s_jbpmConfig);
+ }
+ return s_jbpmService;
+ }
+
+
+
+}
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/DeployProcessDefinitionFacade.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/DeployProcessDefinitionFacade.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/DeployProcessDefinitionFacade.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -1,115 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.soa.esb.services.jbpm.cmd;
-
-import java.io.InputStream;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.services.jbpm.Constants;
-import org.jboss.soa.esb.services.jbpm.Constants.OpCode;
-import org.jboss.soa.esb.services.jbpm.actions.BpmProcessor;
-import org.jboss.soa.esb.util.ClassUtil;
-import org.jboss.soa.esb.util.Util;
-import org.jbpm.graph.def.ProcessDefinition;
-
-/**
- *
- * Implementation of a message preprocessor that obtains the process definition
- * from the action configuration XML
- *
- * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
- */
-public class DeployProcessDefinitionFacade extends MessageFacade
-{
- public OpCode getOpCode() { return Constants.OpCode.DeployProcessDefinition; }
-
- public DeployProcessDefinitionFacade(ConfigTree config) throws ConfigurationException
- {
- _fileName=config.getAttribute(Constants.PROCESS_DEFINITION_FILE_TAG);
- ConfigTree[] childs = config.getChildren(Constants.PROCESS_DEFINITION_XML_TAG);
-
- if (null!=_fileName)
- {
- if (childs.length>0)
- throw new ConfigurationException
- ("You can specify either '"+Constants.PROCESS_DEFINITION_FILE_TAG+"' attribute OR "
- +Constants.PROCESS_DEFINITION_XML_TAG+"> element, but not both");
-
- InputStream stream = ClassUtil.getResourceAsStream(_fileName, BpmProcessor.class);
- _validProcessDef = ProcessDefinition.parseXmlInputStream(stream);
- return;
- }
-
- if (childs.length<1)
- throw new ConfigurationException("Missing or invalid <"+Constants.PROCESS_DEFINITION_XML_TAG+"> element");
- if (childs.length>1)
- throw new ConfigurationException("Only one <"+Constants.PROCESS_DEFINITION_XML_TAG+"> element can be specified");
-
- String version = childs[0].getAttribute("version");
- String encoding = childs[0].getAttribute("encoding");
- if (Util.isNullString(version) || Util.isNullString(encoding))
- throw new ConfigurationException("Wrong 'version' or 'encoding' attribute in <"+Constants.PROCESS_DEFINITION_XML_TAG+">");
- StringBuilder sb = new StringBuilder("<?xml version='").append(version)
- .append("' encoding='").append(encoding).append("' ?>\n")
- ;
-
- ConfigTree[] def = childs[0].getChildren("process-definition");
- if (null==def || def.length<1)
- throw new ConfigurationException("Missing or invalid <process-definition> element");
- if (def.length>1)
- throw new ConfigurationException("Only one <process-definition> element can be specified");
-
- final String xmlString = sb.append(def[0].toString()).toString();
- try
- {
- _validProcessDef = ProcessDefinition.parseXmlString(xmlString);
- }
- catch (Exception e)
- {
- throw new ConfigurationException(e);
- }
- }
-
- public void setJBPMContextParameters(Message message)
- {
- if (null!= _fileName)
- try
- {
- InputStream stream = ClassUtil.getResourceAsStream(_fileName, BpmProcessor.class);
- _validProcessDef = ProcessDefinition.parseXmlInputStream(stream);
- }
- catch (Exception e)
- {
- _logger.info("Keeping previous process definition");
- _logger.error("Invalid process definition file <"+_fileName+">",e);
- }
- message.getBody().add(Constants.PROCESS_DEFINITION, _validProcessDef);
- }
-
- protected String _fileName;
- protected ProcessDefinition _validProcessDef;
- private static final Logger _logger = Logger.getLogger(DeployProcessDefinitionFacade.class);
-}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/DeployProcessDefinitionFacade.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/DeployProcessDefinitionFacade.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/DeployProcessDefinitionFacade.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/DeployProcessDefinitionFacade.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,115 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.soa.esb.services.jbpm.cmd;
+
+import java.io.InputStream;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.services.jbpm.Constants;
+import org.jboss.soa.esb.services.jbpm.Constants.OpCode;
+import org.jboss.soa.esb.services.jbpm.actions.BpmProcessor;
+import org.jboss.soa.esb.util.ClassUtil;
+import org.jboss.soa.esb.util.Util;
+import org.jbpm.graph.def.ProcessDefinition;
+
+/**
+ *
+ * Implementation of a message preprocessor that obtains the process definition
+ * from the action configuration XML
+ *
+ * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
+ */
+public class DeployProcessDefinitionFacade extends MessageFacade
+{
+ public OpCode getOpCode() { return Constants.OpCode.DeployProcessDefinition; }
+
+ public DeployProcessDefinitionFacade(ConfigTree config) throws ConfigurationException
+ {
+ _fileName=config.getAttribute(Constants.PROCESS_DEFINITION_FILE_TAG);
+ ConfigTree[] childs = config.getChildren(Constants.PROCESS_DEFINITION_XML_TAG);
+
+ if (null!=_fileName)
+ {
+ if (childs.length>0)
+ throw new ConfigurationException
+ ("You can specify either '"+Constants.PROCESS_DEFINITION_FILE_TAG+"' attribute OR "
+ +Constants.PROCESS_DEFINITION_XML_TAG+"> element, but not both");
+
+ InputStream stream = ClassUtil.getResourceAsStream(_fileName, BpmProcessor.class);
+ _validProcessDef = ProcessDefinition.parseXmlInputStream(stream);
+ return;
+ }
+
+ if (childs.length<1)
+ throw new ConfigurationException("Missing or invalid <"+Constants.PROCESS_DEFINITION_XML_TAG+"> element");
+ if (childs.length>1)
+ throw new ConfigurationException("Only one <"+Constants.PROCESS_DEFINITION_XML_TAG+"> element can be specified");
+
+ String version = childs[0].getAttribute("version");
+ String encoding = childs[0].getAttribute("encoding");
+ if (Util.isNullString(version) || Util.isNullString(encoding))
+ throw new ConfigurationException("Wrong 'version' or 'encoding' attribute in <"+Constants.PROCESS_DEFINITION_XML_TAG+">");
+ StringBuilder sb = new StringBuilder("<?xml version='").append(version)
+ .append("' encoding='").append(encoding).append("' ?>\n")
+ ;
+
+ ConfigTree[] def = childs[0].getChildren("process-definition");
+ if (null==def || def.length<1)
+ throw new ConfigurationException("Missing or invalid <process-definition> element");
+ if (def.length>1)
+ throw new ConfigurationException("Only one <process-definition> element can be specified");
+
+ final String xmlString = sb.append(def[0].toString()).toString();
+ try
+ {
+ _validProcessDef = ProcessDefinition.parseXmlString(xmlString);
+ }
+ catch (Exception e)
+ {
+ throw new ConfigurationException(e);
+ }
+ }
+
+ public void setJBPMContextParameters(Message message)
+ {
+ if (null!= _fileName)
+ try
+ {
+ InputStream stream = ClassUtil.getResourceAsStream(_fileName, BpmProcessor.class);
+ _validProcessDef = ProcessDefinition.parseXmlInputStream(stream);
+ }
+ catch (Exception e)
+ {
+ _logger.info("Keeping previous process definition");
+ _logger.error("Invalid process definition file <"+_fileName+">",e);
+ }
+ message.getBody().add(Constants.PROCESS_DEFINITION, _validProcessDef);
+ }
+
+ protected String _fileName;
+ protected ProcessDefinition _validProcessDef;
+ private static final Logger _logger = Logger.getLogger(DeployProcessDefinitionFacade.class);
+}
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/FacadeUtil.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/FacadeUtil.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/FacadeUtil.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -1,136 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.soa.esb.services.jbpm.cmd;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Body;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.mapping.ObjectMapper;
-import org.jboss.soa.esb.message.mapping.ObjectMappingException;
-import org.jboss.soa.esb.services.jbpm.Constants;
-
-public class FacadeUtil
-{
- static Boolean booleanFromConfig(ConfigTree tree, String tag)
- throws ConfigurationException
- {
- ConfigTree[] childs = tree.getChildren(tag);
- if (null==childs || childs.length<1)
- return null;
- if (childs.length>1)
- throw new ConfigurationException("Only one <"+tag
- +"> element allowed in configuration");
- try
- {
- return Boolean.parseBoolean(childs[0].getAttribute("value"));
- }
- catch (Exception e)
- {
- throw new ConfigurationException("<"+tag
- +"> must have a 'value' attribute containing 'true' or 'false'");
- }
- } //________________________________
-
- static VariableMapping variablesFromConfig(ConfigTree tree, boolean acceptValue)
- throws ConfigurationException
- {
- VariableMapping ret = new VariableMapping();
- ConfigTree[] objectList = tree.getChildren(Constants.OBJECT_PATH_TAG);
- if (objectList != null) {
- for (ConfigTree curr : objectList) {
- String esbName = curr.getAttribute(Constants.ESB_VARNAME_TAG);
- String jbpmName = curr.getAttribute(Constants.JBPM_VARNAME_TAG);
- String value = curr.getAttribute("value");
- ret.setVariable(esbName, jbpmName, value);
- }
- }
- return ret;
- }
-
- static String[] actorsFromConfig(ConfigTree tree, boolean acceptValue)
- throws ConfigurationException
- {
- String tag = Constants.ACTORS_TAG;
- ConfigTree[] childs = tree.getChildren(tag);
- if (null==childs || childs.length<1)
- return null;
- if (childs.length>1)
- throw new ConfigurationException("Only one <"+tag
- +"> element allowed in configuration");
-
- tag = Constants.ONE_ACTOR_TAG;
- childs = childs[0].getChildren(tag);
- if (null==childs || childs.length<1)
- throw new ConfigurationException("At least one <"+tag
- +"> child element required for <"+Constants.VARIABLES_TAG+">");
- String[] ret = new String[childs.length];
- int i1=0;
- for (ConfigTree curr: childs)
- {
- String name = curr.getAttribute("name");
- if (null==name)
- {
- throw new ConfigurationException
- ("You must specify the 'name' attribute for all <"
- +tag+"> element");
- }
- ret[i1++] = name;
- }
- return ret;
- }
-
-
- static void populateVariableValues (Message message, VariableMapping mapping)
- {
- if (null==mapping || mapping.size()<1)
- return;
-
- Body body = message.getBody();
- HashMap<String,Object> map = new HashMap<String, Object>();
- for (Map.Entry<String, Object> curr: mapping.esbVariables().entrySet())
- {
- String esbName = curr.getKey();
- String jbpmName = mapping.getJbpmName(esbName);
-
- ObjectMapper objectMapper = new ObjectMapper();
- Object value = null;
- try {
- value = objectMapper.getObjectFromMessage(message, esbName);
- } catch (ObjectMappingException ome) {
- throw new IllegalArgumentException(ome.getMessage(), ome);
- }
- // if object not found in body, use default value (from config)
- if (null==value)
- value = curr.getValue();
- // only put it in the map if it's not null
- if (null!=value)
- map.put(jbpmName, value);
- }
- body.add(Constants.VARIABLE_VALUES, map);
- }
-
-}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/FacadeUtil.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/FacadeUtil.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/FacadeUtil.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/FacadeUtil.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,136 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.soa.esb.services.jbpm.cmd;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Body;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.mapping.ObjectMapper;
+import org.jboss.soa.esb.message.mapping.ObjectMappingException;
+import org.jboss.soa.esb.services.jbpm.Constants;
+
+public class FacadeUtil
+{
+ static Boolean booleanFromConfig(ConfigTree tree, String tag)
+ throws ConfigurationException
+ {
+ ConfigTree[] childs = tree.getChildren(tag);
+ if (null==childs || childs.length<1)
+ return null;
+ if (childs.length>1)
+ throw new ConfigurationException("Only one <"+tag
+ +"> element allowed in configuration");
+ try
+ {
+ return Boolean.parseBoolean(childs[0].getAttribute("value"));
+ }
+ catch (Exception e)
+ {
+ throw new ConfigurationException("<"+tag
+ +"> must have a 'value' attribute containing 'true' or 'false'");
+ }
+ } //________________________________
+
+ static VariableMapping variablesFromConfig(ConfigTree tree, boolean acceptValue)
+ throws ConfigurationException
+ {
+ VariableMapping ret = new VariableMapping();
+ ConfigTree[] objectList = tree.getChildren(Constants.OBJECT_PATH_TAG);
+ if (objectList != null) {
+ for (ConfigTree curr : objectList) {
+ String esbName = curr.getAttribute(Constants.ESB_VARNAME_TAG);
+ String jbpmName = curr.getAttribute(Constants.JBPM_VARNAME_TAG);
+ String value = curr.getAttribute("value");
+ ret.setVariable(esbName, jbpmName, value);
+ }
+ }
+ return ret;
+ }
+
+ static String[] actorsFromConfig(ConfigTree tree, boolean acceptValue)
+ throws ConfigurationException
+ {
+ String tag = Constants.ACTORS_TAG;
+ ConfigTree[] childs = tree.getChildren(tag);
+ if (null==childs || childs.length<1)
+ return null;
+ if (childs.length>1)
+ throw new ConfigurationException("Only one <"+tag
+ +"> element allowed in configuration");
+
+ tag = Constants.ONE_ACTOR_TAG;
+ childs = childs[0].getChildren(tag);
+ if (null==childs || childs.length<1)
+ throw new ConfigurationException("At least one <"+tag
+ +"> child element required for <"+Constants.VARIABLES_TAG+">");
+ String[] ret = new String[childs.length];
+ int i1=0;
+ for (ConfigTree curr: childs)
+ {
+ String name = curr.getAttribute("name");
+ if (null==name)
+ {
+ throw new ConfigurationException
+ ("You must specify the 'name' attribute for all <"
+ +tag+"> element");
+ }
+ ret[i1++] = name;
+ }
+ return ret;
+ }
+
+
+ static void populateVariableValues (Message message, VariableMapping mapping)
+ {
+ if (null==mapping || mapping.size()<1)
+ return;
+
+ Body body = message.getBody();
+ HashMap<String,Object> map = new HashMap<String, Object>();
+ for (Map.Entry<String, Object> curr: mapping.esbVariables().entrySet())
+ {
+ String esbName = curr.getKey();
+ String jbpmName = mapping.getJbpmName(esbName);
+
+ ObjectMapper objectMapper = new ObjectMapper();
+ Object value = null;
+ try {
+ value = objectMapper.getObjectFromMessage(message, esbName);
+ } catch (ObjectMappingException ome) {
+ throw new IllegalArgumentException(ome.getMessage(), ome);
+ }
+ // if object not found in body, use default value (from config)
+ if (null==value)
+ value = curr.getValue();
+ // only put it in the map if it's not null
+ if (null!=value)
+ map.put(jbpmName, value);
+ }
+ body.add(Constants.VARIABLE_VALUES, map);
+ }
+
+}
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/MessageFacade.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/MessageFacade.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/MessageFacade.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -1,60 +0,0 @@
-/**
- *
- */
-package org.jboss.soa.esb.services.jbpm.cmd;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.services.jbpm.Constants;
-import org.jboss.soa.esb.services.jbpm.actions.BpmProcessor;
-
-/**
- * @author kstam
- *
- */
-public abstract class MessageFacade
-{
- /**
- * Obtain the operation code that this preprocessor will force into the command message
- * @return Constants.OpCode
- */
- public abstract Constants.OpCode getOpCode();
- /**
- * Some message values are fixed at action configuration time (from the jboss-esb.xml).
- * <br/>This method is responsible of stuffing these static values into every Message
- * before passing it to the generic CommandInterpreter process(Message) method
- * <br/>Some of the Message content will thus come from configuration XML, and some will
- * be the users' responsibility (e.g. processId, tokenId, etc)
- * <br/>Variable name mapping between esb and jBPM is also handled by this interface
- * @param message Message - Into which the static values will be added
- */
- public abstract void setJBPMContextParameters(Message request);
-
-
- public static MessageFacade getFacade(ConfigTree config)
- throws ConfigurationException, UnsupportedOperationException
- {
- Constants.OpCode opCode = null;
- String sAux = config.getRequiredAttribute(BpmProcessor.COMMAND_ATTRIBUTE_TAG);
- try { opCode = Constants.OpCode.valueOf(sAux); }
- catch (IllegalArgumentException e)
- {
- throw new ConfigurationException("Attribute '"+BpmProcessor.COMMAND_ATTRIBUTE_TAG+"' has an invalid value"
- +"- see CommandVehicle.Operation enum for possible values");
- }
-
- if (Constants.OpCode.CancelProcessInstanceCommand.equals(opCode))
- return new CancelProcessInstanceFacade(config);
- if (Constants.OpCode.NewProcessInstanceCommand.equals(opCode))
- return new NewProcessInstanceFacade(config, false);
- if (Constants.OpCode.SignalCommand.equals(opCode))
- return new SignalFacade(config);
- if (Constants.OpCode.StartProcessInstanceCommand.equals(opCode))
- return new NewProcessInstanceFacade(config, true);
- if (Constants.OpCode.DeployProcessDefinition.equals(opCode))
- return new DeployProcessDefinitionFacade(config);
-
- throw new UnsupportedOperationException(opCode.toString()+" not implemented");
- }
-}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/MessageFacade.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/MessageFacade.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/MessageFacade.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/MessageFacade.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,60 @@
+/**
+ *
+ */
+package org.jboss.soa.esb.services.jbpm.cmd;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.services.jbpm.Constants;
+import org.jboss.soa.esb.services.jbpm.actions.BpmProcessor;
+
+/**
+ * @author kstam
+ *
+ */
+public abstract class MessageFacade
+{
+ /**
+ * Obtain the operation code that this preprocessor will force into the command message
+ * @return Constants.OpCode
+ */
+ public abstract Constants.OpCode getOpCode();
+ /**
+ * Some message values are fixed at action configuration time (from the jboss-esb.xml).
+ * <br/>This method is responsible of stuffing these static values into every Message
+ * before passing it to the generic CommandInterpreter process(Message) method
+ * <br/>Some of the Message content will thus come from configuration XML, and some will
+ * be the users' responsibility (e.g. processId, tokenId, etc)
+ * <br/>Variable name mapping between esb and jBPM is also handled by this interface
+ * @param message Message - Into which the static values will be added
+ */
+ public abstract void setJBPMContextParameters(Message request);
+
+
+ public static MessageFacade getFacade(ConfigTree config)
+ throws ConfigurationException, UnsupportedOperationException
+ {
+ Constants.OpCode opCode = null;
+ String sAux = config.getRequiredAttribute(BpmProcessor.COMMAND_ATTRIBUTE_TAG);
+ try { opCode = Constants.OpCode.valueOf(sAux); }
+ catch (IllegalArgumentException e)
+ {
+ throw new ConfigurationException("Attribute '"+BpmProcessor.COMMAND_ATTRIBUTE_TAG+"' has an invalid value"
+ +"- see CommandVehicle.Operation enum for possible values");
+ }
+
+ if (Constants.OpCode.CancelProcessInstanceCommand.equals(opCode))
+ return new CancelProcessInstanceFacade(config);
+ if (Constants.OpCode.NewProcessInstanceCommand.equals(opCode))
+ return new NewProcessInstanceFacade(config, false);
+ if (Constants.OpCode.SignalCommand.equals(opCode))
+ return new SignalFacade(config);
+ if (Constants.OpCode.StartProcessInstanceCommand.equals(opCode))
+ return new NewProcessInstanceFacade(config, true);
+ if (Constants.OpCode.DeployProcessDefinition.equals(opCode))
+ return new DeployProcessDefinitionFacade(config);
+
+ throw new UnsupportedOperationException(opCode.toString()+" not implemented");
+ }
+}
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/MessageHelper.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/MessageHelper.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/MessageHelper.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -1,148 +0,0 @@
-package org.jboss.soa.esb.services.jbpm.cmd;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.Map;
-import java.util.UUID;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-/**
- * Convient Helper to set or set parameters on an EsbMessage.
- * @author kstam
- *
- */
-public class MessageHelper
-{
- private static Logger _logger = Logger.getLogger(MessageHelper.class);
-
- public static String argumentException(String str)
- {
- return new String("Missing or invalid <"+str+"> object in Message body");
- }
-
- public static Message commandMessageTemplate()
- {
- Message template = MessageFactory.getInstance().getMessage();
- URI uri = null;
- try { uri = new URI(UUID.randomUUID().toString()); }
- catch (URISyntaxException e)
- {
- _logger.fatal("Problem with UUID.randomUUID() - This should not happen");
- return null;
- }
- template.getHeader().getCall().setMessageID(uri);
-
- return template;
- }
-
- public static void setLongValue(Message message, String key, Long value)
- {
- setObjectValue(message, key, value);
- }
- public static void setIntValue(Message message, String key, Integer value)
- {
- setObjectValue(message, key, value);
- }
- public static void setBooleanValue(Message message, String key, Boolean value)
- {
- setObjectValue(message, key, value);
- }
- public static void setObjectValue(Message message, String key, Object value)
- {
- message.getBody().add(key, value);
- }
-
- public static void setStringValue(Message msg,String key,Object obj)
- {
- setStringValue(msg, key, obj.toString());
- }
-
- public static void setStringValue(Message msg,String key,String str)
- {
- setObjectValue(msg, key, str);
- }
-
- public static void setStringListValue(Message msg,String key,String[] list)
- {
- boolean addComma = false;
- StringBuilder sb = new StringBuilder();
- for (String curr : list)
- {
- sb.append((addComma)?",":"").append(curr);
- addComma = true;
- }
- setObjectValue(msg,key, sb.toString());
- }
-
- public static void setVariablesMap(Message msg,String key,Map<String,Object> value)
- {
- msg.getBody().add(key, value);
- }
-
- public static Integer getIntValue(Message msg,String key)
- {
- Object obj = msg.getBody().get(key);
- if (obj instanceof Integer) return (Integer)obj;
- if (obj instanceof String) return Integer.parseInt((String)obj);
- _logger.error(argumentException(key));
- return null;
- }
-
- public static Long getLongValue(Message msg,String key)
- {
- Object obj = msg.getBody().get(key);
- if (null==obj) return null;
- if (obj instanceof Long) return (Long)obj;
- if (obj instanceof String) return Long.parseLong((String)obj);
- if (obj instanceof Integer) return new Long(obj.toString());
- _logger.error(argumentException(key));
- return null;
- }
-
- public static Boolean getBooleanValue(Message msg,String key)
- {
- return getBooleanValue(msg, key, null);
- }
-
- public static Boolean getBooleanValue(Message msg,String key, Boolean dflt)
- {
- Object obj = msg.getBody().get(key);
- if (null==obj) return dflt;
- if (obj instanceof Boolean) return (Boolean)obj;
- if (obj instanceof String) return Boolean.parseBoolean((String)obj);
- _logger.error(argumentException(key));
- return null;
- }
-
- public static String getStringValue(Message msg,String key)
- {
- return getStringValue(msg, key, null);
- }
-
- public static String getStringValue(Message msg,String key, String dflt)
- {
- Object obj = msg.getBody().get(key);
- if (null==obj) return dflt;
- if (obj instanceof String) return (String)obj;
- _logger.error(argumentException(key));
- return null;
- }
-
- @SuppressWarnings("unchecked")
- public static Map<String,Object>getVariablesMap(Message msg,String key)
- {
- Object obj = msg.getBody().get(key);
- if (null==obj) return null;
- if (obj instanceof Map) return (Map<String,Object>)obj;
- _logger.error(argumentException(key));
- return null;
- }
-
- public static Object getObjectValue(Message msg,String key)
- {
- return msg.getBody().get(key);
- }
-
-}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/MessageHelper.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/MessageHelper.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/MessageHelper.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/MessageHelper.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,148 @@
+package org.jboss.soa.esb.services.jbpm.cmd;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Map;
+import java.util.UUID;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+/**
+ * Convient Helper to set or set parameters on an EsbMessage.
+ * @author kstam
+ *
+ */
+public class MessageHelper
+{
+ private static Logger _logger = Logger.getLogger(MessageHelper.class);
+
+ public static String argumentException(String str)
+ {
+ return new String("Missing or invalid <"+str+"> object in Message body");
+ }
+
+ public static Message commandMessageTemplate()
+ {
+ Message template = MessageFactory.getInstance().getMessage();
+ URI uri = null;
+ try { uri = new URI(UUID.randomUUID().toString()); }
+ catch (URISyntaxException e)
+ {
+ _logger.fatal("Problem with UUID.randomUUID() - This should not happen");
+ return null;
+ }
+ template.getHeader().getCall().setMessageID(uri);
+
+ return template;
+ }
+
+ public static void setLongValue(Message message, String key, Long value)
+ {
+ setObjectValue(message, key, value);
+ }
+ public static void setIntValue(Message message, String key, Integer value)
+ {
+ setObjectValue(message, key, value);
+ }
+ public static void setBooleanValue(Message message, String key, Boolean value)
+ {
+ setObjectValue(message, key, value);
+ }
+ public static void setObjectValue(Message message, String key, Object value)
+ {
+ message.getBody().add(key, value);
+ }
+
+ public static void setStringValue(Message msg,String key,Object obj)
+ {
+ setStringValue(msg, key, obj.toString());
+ }
+
+ public static void setStringValue(Message msg,String key,String str)
+ {
+ setObjectValue(msg, key, str);
+ }
+
+ public static void setStringListValue(Message msg,String key,String[] list)
+ {
+ boolean addComma = false;
+ StringBuilder sb = new StringBuilder();
+ for (String curr : list)
+ {
+ sb.append((addComma)?",":"").append(curr);
+ addComma = true;
+ }
+ setObjectValue(msg,key, sb.toString());
+ }
+
+ public static void setVariablesMap(Message msg,String key,Map<String,Object> value)
+ {
+ msg.getBody().add(key, value);
+ }
+
+ public static Integer getIntValue(Message msg,String key)
+ {
+ Object obj = msg.getBody().get(key);
+ if (obj instanceof Integer) return (Integer)obj;
+ if (obj instanceof String) return Integer.parseInt((String)obj);
+ _logger.error(argumentException(key));
+ return null;
+ }
+
+ public static Long getLongValue(Message msg,String key)
+ {
+ Object obj = msg.getBody().get(key);
+ if (null==obj) return null;
+ if (obj instanceof Long) return (Long)obj;
+ if (obj instanceof String) return Long.parseLong((String)obj);
+ if (obj instanceof Integer) return new Long(obj.toString());
+ _logger.error(argumentException(key));
+ return null;
+ }
+
+ public static Boolean getBooleanValue(Message msg,String key)
+ {
+ return getBooleanValue(msg, key, null);
+ }
+
+ public static Boolean getBooleanValue(Message msg,String key, Boolean dflt)
+ {
+ Object obj = msg.getBody().get(key);
+ if (null==obj) return dflt;
+ if (obj instanceof Boolean) return (Boolean)obj;
+ if (obj instanceof String) return Boolean.parseBoolean((String)obj);
+ _logger.error(argumentException(key));
+ return null;
+ }
+
+ public static String getStringValue(Message msg,String key)
+ {
+ return getStringValue(msg, key, null);
+ }
+
+ public static String getStringValue(Message msg,String key, String dflt)
+ {
+ Object obj = msg.getBody().get(key);
+ if (null==obj) return dflt;
+ if (obj instanceof String) return (String)obj;
+ _logger.error(argumentException(key));
+ return null;
+ }
+
+ @SuppressWarnings("unchecked")
+ public static Map<String,Object>getVariablesMap(Message msg,String key)
+ {
+ Object obj = msg.getBody().get(key);
+ if (null==obj) return null;
+ if (obj instanceof Map) return (Map<String,Object>)obj;
+ _logger.error(argumentException(key));
+ return null;
+ }
+
+ public static Object getObjectValue(Message msg,String key)
+ {
+ return msg.getBody().get(key);
+ }
+
+}
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/NewProcessInstanceFacade.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/NewProcessInstanceFacade.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/NewProcessInstanceFacade.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -1,91 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.soa.esb.services.jbpm.cmd;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Body;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.services.jbpm.Constants;
-import org.jboss.soa.esb.services.jbpm.Constants.OpCode;
-
-/**
- *
- * Implementation of a message preprocessor to obtain data from a process instance
- * from the action configuration XML
- *
- * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
- */
-public class NewProcessInstanceFacade extends MessageFacade
-{
- public OpCode getOpCode()
- {
- return (_start)
- ?Constants.OpCode.StartProcessInstanceCommand
- :Constants.OpCode.NewProcessInstanceCommand;
- }
-
- public NewProcessInstanceFacade(ConfigTree config, boolean start) throws ConfigurationException
- {
- _start = start;
- _actor = config.getAttribute(Constants.ONE_ACTOR_TAG);
- _processName= config.getAttribute(Constants.PROCESS_DEFINITION_NAME_TAG);
- _keyPath = config.getAttribute(Constants.KEY_TAG);
- String aux = config.getAttribute(Constants.PROCESS_DEFINITION_ID_TAG);
- if (null!=aux)
- try {_processId = Long.parseLong(aux); }
- catch(NumberFormatException e)
- {
- throw new ConfigurationException("Invalid value for '"+Constants.PROCESS_DEFINITION_ID_TAG+"'");
- }
- _variables = FacadeUtil.variablesFromConfig(config, true);
-
- if (_start)
- _transitionName = config.getAttribute(Constants.TRANSITION_NAME_TAG);
- }
-
- public void setJBPMContextParameters(Message message)
- {
- Body body = message.getBody();
- if (null!=_keyPath)
- body.add(Constants.KEYPATH, _keyPath);
- if (null!=_actor)
- body.add(Constants.ACTOR_ID ,_actor);
- if (null!=_processName)
- body.add(Constants.PROCESS_DEFINITION_NAME ,_processName);
- if (null!=_processId)
- body.add(Constants.PROCESS_DEFINITION_ID ,_processId);
- if (null!=_transitionName)
- body.add(Constants.TRANSITION_NAME, _transitionName);
-
- FacadeUtil.populateVariableValues(message,_variables);
- }
-
- boolean _start;
- String _keyPath;
- String _actor;
- String _processName;
- String _transitionName;
- Long _processId;
- VariableMapping _variables;
-}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/NewProcessInstanceFacade.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/NewProcessInstanceFacade.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/NewProcessInstanceFacade.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/NewProcessInstanceFacade.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,91 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.soa.esb.services.jbpm.cmd;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Body;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.services.jbpm.Constants;
+import org.jboss.soa.esb.services.jbpm.Constants.OpCode;
+
+/**
+ *
+ * Implementation of a message preprocessor to obtain data from a process instance
+ * from the action configuration XML
+ *
+ * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
+ */
+public class NewProcessInstanceFacade extends MessageFacade
+{
+ public OpCode getOpCode()
+ {
+ return (_start)
+ ?Constants.OpCode.StartProcessInstanceCommand
+ :Constants.OpCode.NewProcessInstanceCommand;
+ }
+
+ public NewProcessInstanceFacade(ConfigTree config, boolean start) throws ConfigurationException
+ {
+ _start = start;
+ _actor = config.getAttribute(Constants.ONE_ACTOR_TAG);
+ _processName= config.getAttribute(Constants.PROCESS_DEFINITION_NAME_TAG);
+ _keyPath = config.getAttribute(Constants.KEY_TAG);
+ String aux = config.getAttribute(Constants.PROCESS_DEFINITION_ID_TAG);
+ if (null!=aux)
+ try {_processId = Long.parseLong(aux); }
+ catch(NumberFormatException e)
+ {
+ throw new ConfigurationException("Invalid value for '"+Constants.PROCESS_DEFINITION_ID_TAG+"'");
+ }
+ _variables = FacadeUtil.variablesFromConfig(config, true);
+
+ if (_start)
+ _transitionName = config.getAttribute(Constants.TRANSITION_NAME_TAG);
+ }
+
+ public void setJBPMContextParameters(Message message)
+ {
+ Body body = message.getBody();
+ if (null!=_keyPath)
+ body.add(Constants.KEYPATH, _keyPath);
+ if (null!=_actor)
+ body.add(Constants.ACTOR_ID ,_actor);
+ if (null!=_processName)
+ body.add(Constants.PROCESS_DEFINITION_NAME ,_processName);
+ if (null!=_processId)
+ body.add(Constants.PROCESS_DEFINITION_ID ,_processId);
+ if (null!=_transitionName)
+ body.add(Constants.TRANSITION_NAME, _transitionName);
+
+ FacadeUtil.populateVariableValues(message,_variables);
+ }
+
+ boolean _start;
+ String _keyPath;
+ String _actor;
+ String _processName;
+ String _transitionName;
+ Long _processId;
+ VariableMapping _variables;
+}
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/SignalFacade.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/SignalFacade.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/SignalFacade.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -1,59 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.soa.esb.services.jbpm.cmd;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Body;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.services.jbpm.Constants;
-import org.jboss.soa.esb.services.jbpm.Constants.OpCode;
-
-/**
- *
- * Implementation of a message preprocessor to obtain data from a process instance
- * from the action configuration XML
- *
- * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
- */
-public class SignalFacade extends MessageFacade
-{
- public OpCode getOpCode() { return Constants.OpCode.SignalCommand; }
-
- public SignalFacade(ConfigTree config) throws ConfigurationException
- {
- _transition = config.getAttribute(Constants.TRANSITION_NAME_TAG);
- _variables = FacadeUtil.variablesFromConfig(config, false);
- }
-
- public void setJBPMContextParameters(Message message)
- {
- Body body = message.getBody();
- if (null!=_transition)
- body.add(Constants.TRANSITION_NAME, _transition);
- FacadeUtil.populateVariableValues(message, _variables);
- }
-
- String _transition;
- VariableMapping _variables;
-}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/SignalFacade.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/SignalFacade.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/SignalFacade.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/SignalFacade.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.soa.esb.services.jbpm.cmd;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Body;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.services.jbpm.Constants;
+import org.jboss.soa.esb.services.jbpm.Constants.OpCode;
+
+/**
+ *
+ * Implementation of a message preprocessor to obtain data from a process instance
+ * from the action configuration XML
+ *
+ * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
+ */
+public class SignalFacade extends MessageFacade
+{
+ public OpCode getOpCode() { return Constants.OpCode.SignalCommand; }
+
+ public SignalFacade(ConfigTree config) throws ConfigurationException
+ {
+ _transition = config.getAttribute(Constants.TRANSITION_NAME_TAG);
+ _variables = FacadeUtil.variablesFromConfig(config, false);
+ }
+
+ public void setJBPMContextParameters(Message message)
+ {
+ Body body = message.getBody();
+ if (null!=_transition)
+ body.add(Constants.TRANSITION_NAME, _transition);
+ FacadeUtil.populateVariableValues(message, _variables);
+ }
+
+ String _transition;
+ VariableMapping _variables;
+}
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/VariableMapping.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/VariableMapping.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/VariableMapping.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -1,66 +0,0 @@
-package org.jboss.soa.esb.services.jbpm.cmd;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.jboss.soa.esb.util.Util;
-
-/**
- * A container for variable names and values with access both by esb name and jbpm name.
- *
- * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
- *
- */
-public class VariableMapping
-{
- // internal key is always esb name
- private Map<String,Object> _values = new HashMap<String, Object>();
- // map jbpm names to esb names
- private Map<String,String> _jbpmNames = new HashMap<String, String>();
- // map esb names to jbpm names
- private Map<String,String> _esbNames = new HashMap<String, String>();
-
- public int size() { return _values.size(); }
-
- private String setMapping(String esbName, String jbpmName)
- {
- if (Util.isNullString(esbName) && Util.isNullString(jbpmName))
- throw new IllegalArgumentException("You must specify at least one valid variable name (esb or bpm)");
- if (Util.isNullString(jbpmName))
- jbpmName = getName(esbName);
- if (Util.isNullString(esbName))
- esbName = getName(jbpmName);
- String oldMapping = _esbNames.get(jbpmName);
- if (null!=oldMapping && !oldMapping.equals(jbpmName))
- throw new IllegalArgumentException
- ("Illegal mapping esb=<"+esbName+"> was mapped to bpm=<"+oldMapping+ "> cannot remap to "+jbpmName);
-
- _esbNames .put(esbName, jbpmName);
- _jbpmNames .put(jbpmName, esbName);
- // Internally, esbName is the key to the variable values
- return esbName;
- }
-
- protected String getName(String path)
- {
- String name = path;
- int index = path.lastIndexOf(".");
- if (index > 0) {
- name = path.substring(index+1);
- }
- return name;
- }
-
- public void setVariable(String esbName, String jbpmName, Object value)
- {
- _values .put(setMapping(esbName, jbpmName), value);
- }
-
- public String getEsbName (String key) { return _jbpmNames.get(key); }
- public String getJbpmName (String key) { return _esbNames.get(key); }
-
- public Object getEsbVariable (String key) { return _values.get(key); }
- public Object getJbpmVariable(String key) { return _values.get(_jbpmNames.get(key)); }
-
- public Map<String,Object> esbVariables() { return _values; }
-}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/VariableMapping.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/VariableMapping.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/VariableMapping.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/cmd/VariableMapping.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,66 @@
+package org.jboss.soa.esb.services.jbpm.cmd;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.soa.esb.util.Util;
+
+/**
+ * A container for variable names and values with access both by esb name and jbpm name.
+ *
+ * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
+ *
+ */
+public class VariableMapping
+{
+ // internal key is always esb name
+ private Map<String,Object> _values = new HashMap<String, Object>();
+ // map jbpm names to esb names
+ private Map<String,String> _jbpmNames = new HashMap<String, String>();
+ // map esb names to jbpm names
+ private Map<String,String> _esbNames = new HashMap<String, String>();
+
+ public int size() { return _values.size(); }
+
+ private String setMapping(String esbName, String jbpmName)
+ {
+ if (Util.isNullString(esbName) && Util.isNullString(jbpmName))
+ throw new IllegalArgumentException("You must specify at least one valid variable name (esb or bpm)");
+ if (Util.isNullString(jbpmName))
+ jbpmName = getName(esbName);
+ if (Util.isNullString(esbName))
+ esbName = getName(jbpmName);
+ String oldMapping = _esbNames.get(jbpmName);
+ if (null!=oldMapping && !oldMapping.equals(jbpmName))
+ throw new IllegalArgumentException
+ ("Illegal mapping esb=<"+esbName+"> was mapped to bpm=<"+oldMapping+ "> cannot remap to "+jbpmName);
+
+ _esbNames .put(esbName, jbpmName);
+ _jbpmNames .put(jbpmName, esbName);
+ // Internally, esbName is the key to the variable values
+ return esbName;
+ }
+
+ protected String getName(String path)
+ {
+ String name = path;
+ int index = path.lastIndexOf(".");
+ if (index > 0) {
+ name = path.substring(index+1);
+ }
+ return name;
+ }
+
+ public void setVariable(String esbName, String jbpmName, Object value)
+ {
+ _values .put(setMapping(esbName, jbpmName), value);
+ }
+
+ public String getEsbName (String key) { return _jbpmNames.get(key); }
+ public String getJbpmName (String key) { return _esbNames.get(key); }
+
+ public Object getEsbVariable (String key) { return _values.get(key); }
+ public Object getJbpmVariable(String key) { return _values.get(_jbpmNames.get(key)); }
+
+ public Map<String,Object> esbVariables() { return _values; }
+}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actionhandlers/EsbActionHandlerUnitTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actionhandlers/EsbActionHandlerUnitTest.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actionhandlers/EsbActionHandlerUnitTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -34,7 +34,6 @@
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
-import org.jboss.soa.esb.message.MessagePayloadProxy;
public class EsbActionHandlerUnitTest extends TestCase
{
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actions/BpmProcessorUnitTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actions/BpmProcessorUnitTest.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actions/BpmProcessorUnitTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -30,14 +30,9 @@
import org.apache.log4j.Logger;
import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Body;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.body.content.BytesBody;
-import org.jboss.soa.esb.services.jbpm.Constants;
-import org.jboss.soa.esb.services.jbpm.util.Helper;
+import org.jboss.soa.esb.services.jbpm.cmd.MessageHelper;
import org.jbpm.JbpmConfiguration;
import org.junit.AfterClass;
-import org.junit.BeforeClass;
import org.junit.Test;
/**
@@ -49,7 +44,7 @@
public class BpmProcessorUnitTest
{
-
+ static BpmProcessor processor;
private static Class thisClass = BpmProcessorUnitTest.class;
static Logger _logger = Logger.getLogger(thisClass);
@@ -60,21 +55,6 @@
return new JUnit4TestAdapter(thisClass);
}
- @BeforeClass
- public static void runBeforeAllTests()
- {
- _logger.info("@BeforeClass invoked");
- try
- {
- }
- catch (Exception e)
- {
- e.printStackTrace();
- assertTrue(false);
- }
- }
-
-
@AfterClass
public static void runAfterAllTests() throws Exception
{
@@ -86,112 +66,35 @@
_hibernateConfFile.delete();
}
}
-
@Test
- public void mockTest()
+ public void testDeployFromFile()
{
- // place holder so test will run even with no other @Test
- _logger.info("Mock test invoked");
- assertTrue(true);
- }
-
- @Test
- public void testDeployFromFile()
- {
- Message response;
- BpmProcessor command;
- String ret;
- try
- {
- String xml = JbpmTestUtil.stringFromFile("testDeployFromFile.xml");
- ConfigTree[] actions = ConfigTree.fromXml(xml).getChildren("action");
+ try
+ {
+ String xml = JbpmTestUtil.stringFromFile("testDeployFromFile.xml");
+ ConfigTree[] actions = ConfigTree.fromXml(xml).getChildren("action");
- command = new BpmProcessor(actions[0]);
- response = command.process(Helper.commandMessageTemplate());
- _logger.info(JbpmTestUtil.dumpResponse(response, command.getOpCode()));
- ret = Helper.getStringValue(response, Constants.RETURN_CODE);
- assertTrue(Constants.RETCODE_OK.equals(ret));
-
- }
- catch (Exception e)
- {
- e.printStackTrace();
- _logger.error(e);
- assertTrue(false);
- }
+ BpmProcessor command = new BpmProcessor(actions[0]);
+ command.process(MessageHelper.commandMessageTemplate());
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ _logger.error(e);
+ assertTrue(false);
+ }
}
@Test
public void testBpmProcessor()
{
- Message request, response;
- BpmProcessor command;
- String ret;
try
{
String xml = JbpmTestUtil.stringFromFile("testSingleCommands.xml");
ConfigTree[] actions = ConfigTree.fromXml(xml).getChildren("action");
int index = 0;
-
- command = new BpmProcessor(actions[index++]);
- response = command.process(Helper.commandMessageTemplate());
- _logger.info(JbpmTestUtil.dumpResponse(response, command.getOpCode()));
- ret = Helper.getStringValue(response, Constants.RETURN_CODE);
- assertTrue(Constants.RETCODE_OK.equals(ret));
-
- // Keep the variables for comparison in future steps
- ConfigTree[] vars = actions[index].getChildren(Constants.OBJECT_PATH_TAG);
-
- command = new BpmProcessor(actions[index++]);
- request = Helper.commandMessageTemplate();
- response = command.process(request);
- _logger.info(JbpmTestUtil.dumpResponse(response, command.getOpCode()));
- ret = Helper.getStringValue(response, Constants.RETURN_CODE);
- assertTrue(Constants.RETCODE_OK.equals(ret));
-
- Long tokenId = (Long)response.getBody().get(Constants.TOKEN_ID);
- Long processId = (Long)response.getBody().get(Constants.PROCESS_INSTANCE_ID);
-
- command = new BpmProcessor(actions[index++]);
- request = Helper.commandMessageTemplate();
- Helper.setLongValue(request, Constants.TOKEN_ID, tokenId);
- response = command.process(request);
- _logger.info(JbpmTestUtil.dumpResponse(response, command.getOpCode()));
- ret = Helper.getStringValue(response, Constants.RETURN_CODE);
- assertTrue(Constants.RETCODE_OK.equals(ret));
-
- // we've mapped differently, so check if mapping worked both ways
- Body body = response.getBody();
- assertTrue(vars[1].getAttribute("value").equals(body.get("xxx")));
- assertTrue(vars[2].getAttribute("value").equals(body.get("yyy")));
- assertTrue(vars[3].getAttribute("value").equals(body.get("newVar")));
-
- command = new BpmProcessor(actions[index++]);
- request = Helper.commandMessageTemplate();
- Helper.setLongValue(request, Constants.TOKEN_ID, tokenId);
- String myContent = "My content travels in the message";
- request.getBody().add(myContent.getBytes());
- response = command.process(request);
- _logger.info(JbpmTestUtil.dumpResponse(response, command.getOpCode()));
- ret = Helper.getStringValue(response, Constants.RETURN_CODE);
- assertTrue(Constants.RETCODE_OK.equals(ret));
-
- command = new BpmProcessor(actions[index++]);
- request = Helper.commandMessageTemplate();
- Helper.setLongValue(request, Constants.PROCESS_INSTANCE_ID, processId);
- response = command.process(request);
- _logger.info(JbpmTestUtil.dumpResponse(response, command.getOpCode()));
- ret = Helper.getStringValue(response, Constants.RETURN_CODE);
- assertTrue(Constants.RETCODE_OK.equals(ret));
-
- command = new BpmProcessor(actions[index++]);
- request = Helper.commandMessageTemplate();
- Helper.setLongValue(request, Constants.PROCESS_INSTANCE_ID, processId);
- response = command.process(request);
- _logger.info(JbpmTestUtil.dumpResponse(response, command.getOpCode()));
- ret = Helper.getStringValue(response, Constants.RETURN_CODE);
- assertTrue(Constants.RETCODE_OK.equals(ret));
-
+ BpmProcessor command = new BpmProcessor(actions[index++]);
+ command.process(MessageHelper.commandMessageTemplate());
}
catch (Exception e)
{
@@ -199,5 +102,7 @@
_logger.error(e);
assertTrue(false);
}
- } //________________________________
+ }
+
+
}
\ No newline at end of file
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actions/CommandInterpreterUnitTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actions/CommandInterpreterUnitTest.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actions/CommandInterpreterUnitTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -1,167 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.soa.esb.services.jbpm.actions;
-
-import static org.junit.Assert.assertTrue;
-
-import junit.framework.JUnit4TestAdapter;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.services.jbpm.Constants;
-import org.jboss.soa.esb.services.jbpm.util.Helper;
-import org.jbpm.JbpmConfiguration;
-import org.jbpm.graph.exe.Token;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Test the jBPM command interpreter class
- *
- * @author <a href="mailto:schifest at heuristica.com.ar">Esteban</a>
- */
-
-
-public class CommandInterpreterUnitTest
-{
-
- private static Class thisClass = CommandInterpreterUnitTest.class;
- static Logger _logger = Logger.getLogger(thisClass);
- static CommandInterpreter _interp;
- private static final String TEST_PROCESS_NAME = "simple";
-
-
- public static junit.framework.Test suite()
- {
- return new JUnit4TestAdapter(thisClass);
- }
-
- @BeforeClass
- public static void runBeforeAllTests()
- {
- _logger.info("@BeforeClass invoked");
- try
- {
- }
- catch (Exception e)
- {
- e.printStackTrace();
- assertTrue(false);
- }
- }
-
-
- @AfterClass
- public static void runAfterAllTests() throws Exception
- {
- _logger.info("@AfterClass invoked");
- JbpmConfiguration.getInstance().dropSchema();
- }
-
- @Test
- public void mockTest()
- {
- // place holder so test will run even with no other @Test
- _logger.info("Mock test invoked");
- assertTrue(true);
- }
-
- @Test
- public void testFullProcessLifecycle()
- {
- long instanceId=0 , tokenId=0;
- Constants.OpCode opCode = null;
- Message request, response;
-
- _logger.info("testFullProcessLifecycle() invoked");
- try
- {
- opCode = Constants.OpCode.DeployProcessDefinition;
- request = Helper.commandMessageTemplate();
- Helper.setStringValue(request, Constants.COMMAND_CODE, opCode);
- Helper.setStringValue(request, Constants.PROCESS_DEFINITION_XML
- , JbpmTestUtil.stringFromFile("simpleProcessDefinition.xml"));
-
- response = invokeJbpm(request);
- _logger.info(JbpmTestUtil.dumpResponse(response, opCode));
- assertTrue(Constants.RETCODE_OK.equals(Helper.getStringValue(response, Constants.RETURN_CODE)));
-
- opCode = Constants.OpCode.NewProcessInstanceCommand;
- request = Helper.commandMessageTemplate();
- request.getBody().add("key","some-order-id-key");
- Helper.setStringValue(request, Constants.COMMAND_CODE, opCode);
- Helper.setStringValue(request, Constants.PROCESS_DEFINITION_NAME, TEST_PROCESS_NAME);
- Helper.setStringValue(request, Constants.KEYPATH, "body.key");
- response = invokeJbpm(request);
- _logger.info(JbpmTestUtil.dumpResponse(response, opCode));
- assertTrue(Constants.RETCODE_OK.equals(Helper.getStringValue(response, Constants.RETURN_CODE)));
-
- instanceId = Helper.getLongValue(response,Constants.PROCESS_INSTANCE_ID);
- tokenId = Helper.getLongValue(response,Constants.TOKEN_ID);
- boolean signalToken = true;
- for (boolean continueLooping = true; continueLooping;)
- {
- opCode = Constants.OpCode.SignalCommand;
- // for this test, alternatively signal: token - process - token ...
-
- request = Helper.commandMessageTemplate();
- Helper.setStringValue(request, Constants.COMMAND_CODE, opCode);
- if (signalToken)
- Helper.setLongValue(request, Constants.TOKEN_ID, tokenId);
- else
- Helper.setLongValue(request, Constants.PROCESS_INSTANCE_ID, instanceId);
- response = invokeJbpm(request);
- signalToken = ! signalToken;
-
- if (null!=response)
- _logger.info(JbpmTestUtil.dumpResponse(response, opCode));
- else
- _logger.info("Response was not received");
- assertTrue(Constants.RETCODE_OK.equals(Helper.getObjectValue(response, Constants.RETURN_CODE)));
-
- Token token = (Token)Helper.getObjectValue(response, Constants.JBPM_RETURN_OBJECT);
- if (token.hasEnded())
- break;
- instanceId = Helper.getLongValue(response,Constants.PROCESS_INSTANCE_ID);
- tokenId = Helper.getLongValue(response,Constants.TOKEN_ID);
- }
-
- }
- catch (Exception _ex)
- {
- _ex.printStackTrace();
- assertTrue(false);
- }
-
- } //________________________________
-
- protected Message invokeJbpm(Message request) throws Exception
- {
- if (null==_interp)
- _interp = new CommandInterpreter(new ConfigTree("empty"));
- return _interp.process(request);
- }
-
-}
\ No newline at end of file
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actions/JbpmTestUtil.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actions/JbpmTestUtil.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actions/JbpmTestUtil.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -30,7 +30,6 @@
import java.io.PrintStream;
import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.body.content.BytesBody;
import org.jboss.soa.esb.services.jbpm.Constants;
import org.jboss.soa.esb.util.ClassUtil;
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actions/testSingleCommands.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actions/testSingleCommands.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actions/testSingleCommands.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -1,26 +1,4 @@
<testActions>
- <action name="TestEmbeddedDeploy"
- class="org.jboss.soa.esb.services.jbpm.actions.BpmProcessor"
- command="DeployProcessDefinition">
- <process-definition-xml version="1.0" encoding="UTF-8">
- <process-definition
- xmlns="urn:jbpm.org:jpdl-3.1"
- name="simple"
- >
- <start-state name="start">
- <transition name="to_state" to="first">
-
- </transition>
- </start-state>
- <state name="first">
- <transition name="to_end" to="end">
-
- </transition>
- </state>
- <end-state name="end"></end-state>
- </process-definition>
- </process-definition-xml>
- </action>
<action name="aNewInstance"
class="org.jboss.soa.esb.services.jbpm.actions.BpmProcessor"
@@ -35,38 +13,5 @@
<object-path esb="body.newVar" value="123" />
</action>
- <action name="nowGetItBack"
- class="org.jboss.soa.esb.services.jbpm.actions.BpmProcessor"
- command="GetProcessInstanceCommand"
- >
- <include-logs value="true"/>
- <include-all-variables value="true"/>
- <object-path esb="BODY_CONTENT" bpm="theBody" />
- <object-path esb="yyy" bpm="vJ22" />
- <object-path esb="xxx" bpm="j1" />
- <object-path bpm="newVar" />
- </action>
-
- <action name="testBodyContent"
- class="org.jboss.soa.esb.services.jbpm.actions.BpmProcessor"
- command="VariablesCommand"
- >
- <include-logs value="true"/>
- <object-path esb="BODY_CONTENT" bpm="theBody" />
- </action>
-
- <action name="nowCancelIt"
- class="org.jboss.soa.esb.services.jbpm.actions.BpmProcessor"
- command="CancelProcessInstanceCommand"
- >
- </action>
-
- <action name="getItAgain"
- class="org.jboss.soa.esb.services.jbpm.actions.BpmProcessor"
- command="GetProcessInstanceCommand"
- >
- <object-path esb="BODY_CONTENT" bpm="theBody" />
- </action>
-
</testActions>
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/cmd (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/cmd)
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/cmd/VariableMappingUnitTest.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/cmd/VariableMappingUnitTest.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/cmd/VariableMappingUnitTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -1,55 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.soa.esb.services.jbpm.cmd;
-
-import static org.junit.Assert.assertEquals;
-
-import junit.framework.JUnit4TestAdapter;
-
-import org.jboss.soa.esb.services.jbpm.cmd.VariableMapping;
-import org.junit.Test;
-
-
-/**
- * @author kstam
- *
- */
-public class VariableMappingUnitTest
-{
-
- @Test
- public void testGetName()
- {
- VariableMapping mapper = new VariableMapping();
- String path = "body.someobjectname";
- String name = mapper.getName(path);
- assertEquals("someobjectname",name);
- }
-
-
-
-
- public static junit.framework.Test suite()
- {
- return new JUnit4TestAdapter(VariableMappingUnitTest.class);
- }
-}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/cmd/VariableMappingUnitTest.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/cmd/VariableMappingUnitTest.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/cmd/VariableMappingUnitTest.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/cmd/VariableMappingUnitTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb.services.jbpm.cmd;
+
+import static org.junit.Assert.assertEquals;
+
+import junit.framework.JUnit4TestAdapter;
+
+import org.jboss.soa.esb.services.jbpm.cmd.VariableMapping;
+import org.junit.Test;
+
+
+/**
+ * @author kstam
+ *
+ */
+public class VariableMappingUnitTest
+{
+
+ @Test
+ public void testGetName()
+ {
+ VariableMapping mapper = new VariableMapping();
+ String path = "body.someobjectname";
+ String name = mapper.getName(path);
+ assertEquals("someobjectname",name);
+ }
+
+
+
+
+ public static junit.framework.Test suite()
+ {
+ return new JUnit4TestAdapter(VariableMappingUnitTest.class);
+ }
+}
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/JMXTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/JMXTest.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/JMXTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -1,57 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.soa.esb.monitoring;
-
-import javax.naming.*;
-
-import org.jboss.soa.esb.monitoring.client.DataCollector;
-
-import java.util.*;
-
-/**
- * JMXTest is a simple command line test of the DataCollector.
- *
- * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
- * @since Version 4.2
- */
-public class JMXTest {
- public JMXTest() {
- }
-
- /**
- * @param args the command line arguments
- */
- @SuppressWarnings("unchecked")
- public static void main(String[] args) throws Exception
- {
- Hashtable environment = new Hashtable();
- environment.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
- environment.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
- environment.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1099");
- InitialContext ic = new InitialContext(environment);
-
- DataCollector dcollector = new DataCollector(ic);
- dcollector.collectData();
- StatisticsData data = dcollector.getData();
- data.print();
- }
-}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/client/DataCollector.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/client/DataCollector.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/client/DataCollector.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -43,6 +43,7 @@
import org.apache.log4j.Logger;
import org.hibernate.Session;
+import org.jboss.mx.util.MBeanServerLocator;
import org.jboss.soa.esb.monitoring.MonitoringSessionFactory;
import org.jboss.soa.esb.monitoring.StatisticsBean;
import org.jboss.soa.esb.monitoring.StatisticsData;
@@ -66,20 +67,16 @@
public DataCollector() {
try {
context = new InitialContext();
- server = (MBeanServerConnection) context.lookup("jmx/invoker/RMIAdaptor");
} catch (NamingException e) {
logger.error("", e);
}
+ server = MBeanServerLocator.locateJBoss();
data = new StatisticsData();
}
public DataCollector(Context f_context) {
context = f_context;
- try {
- server = (MBeanServerConnection) context.lookup("jmx/invoker/RMIAdaptor");
- } catch (NamingException e) {
- logger.error("", e);
- }
+ server = MBeanServerLocator.locateJBoss();
data = new StatisticsData();
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/client/Invoker.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/client/Invoker.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/client/Invoker.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -13,20 +13,15 @@
import javax.naming.NamingException;
import org.apache.log4j.Logger;
+import org.jboss.mx.util.MBeanServerLocator;
import org.jboss.soa.esb.message.body.content.ServiceControlCommand;
public class Invoker {
Logger logger = Logger.getLogger(Invoker.class);
- private Context context;
private MBeanServerConnection server;
public Invoker() {
- try {
- context = new InitialContext();
- server = (MBeanServerConnection) context.lookup("jmx/invoker/RMIAdaptor");
- } catch (NamingException e) {
- logger.error("", e);
- }
+ server = MBeanServerLocator.locateJBoss();
}
public Object invoke(ServiceControlCommand obean) {
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/client/OperationsCollector.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/client/OperationsCollector.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/client/OperationsCollector.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -22,6 +22,7 @@
import org.apache.log4j.Logger;
import org.hibernate.Session;
+import org.jboss.mx.util.MBeanServerLocator;
import org.jboss.soa.esb.message.body.content.ServiceControlCommand;
import org.jboss.soa.esb.monitoring.MonitoringSessionFactory;
import org.jboss.soa.esb.monitoring.OperationsData;
@@ -37,20 +38,16 @@
public OperationsCollector() {
try {
context = new InitialContext();
- server = (MBeanServerConnection) context.lookup("jmx/invoker/RMIAdaptor");
} catch (NamingException e) {
logger.error("", e);
}
+ server = MBeanServerLocator.locateJBoss();
data = new OperationsData();
}
public OperationsCollector(Context f_context) {
context = f_context;
- try {
- server = (MBeanServerConnection) context.lookup("jmx/invoker/RMIAdaptor");
- } catch (NamingException e) {
- logger.error("", e);
- }
+ server = MBeanServerLocator.locateJBoss();
data = new OperationsData();
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/build.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/build.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/build.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -9,6 +9,7 @@
message="JBoss ESB requires jdk1.5 to build."/>
<property name="product.dir" location="../product"/>
+ <property name="build.location" location="build"/>
<import file="${product.dir}/esb-config.xml"/>
@@ -73,14 +74,18 @@
<target name="clean" description="Clean the QA env">
<echo message="Cleaning..."/>
- <delete dir="${basedir}/build" />
+ <delete dir="${build.location}" />
<ant dir="quickstarts" target="ci-clean" />
</target>
<target name="start-server" depends="esb.setup-esb">
<echo>server ${org.jboss.esb.server.home} ${org.jboss.esb.test.server.config}</echo>
<start-server serverHome="${org.jboss.esb.server.home}"
- serverConfig="${org.jboss.esb.test.server.config}"/>
+ serverConfig="${org.jboss.esb.test.server.config}">
+ <sysproperty key="build.dir" value="${build.location}"/>
+ <jvmarg value="-Xmx512m"/>
+ <jvmarg value="-Xms512m"/>
+ </start-server>
<wait-on-server/>
</target>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/build.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/build.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/build.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -18,7 +18,7 @@
<property name="qa.quickstarts.build" location="${qa.build}/quickstarts"/>
<property name="qa.quickstarts.build.lib" location="${qa.quickstarts.build}/lib"/>
<property name="qa.quickstarts.classes" location="${qa.quickstarts.build}/classes"/>
- <property name="qa.junit.resources" location="resources"/>
+ <property name="qa.quickstarts.resources" location="resources"/>
<property name="qa.quickstarts.report" location="${qa.quickstarts.build}/report"/>
<property name="qa.quickstarts.memory" value="128m"/>
@@ -55,6 +55,9 @@
</path>
<path id="qa.quickstarts.cp">
+ <fileset dir="${product.dir}/services/jbossesb/build">
+ <include name="**/*.jar"/>
+ </fileset>
<!-- include qs specific jars -->
<fileset dir="${org.jboss.esb.test.quickstarts.dir}">
<include name="bpm_orchestration1/lib/**/*.jar"/>
@@ -68,6 +71,9 @@
<include name="recipient_list/lib/**/*.jar"/>
<include name="scripting_groovy/lib/**/*.jar"/>
<include name="simple_cbr/lib/**/*.jar"/>
+ <include name="spring_aop/lib/**/*.jar"/>
+ <include name="spring_helloworld/lib/**/*.jar"/>
+ <include name="spring_jpetstore/lib/**/*.jar"/>
<include name="static_router/lib/**/*.jar"/>
<include name="transform_CSV2XML/lib/**/*.jar"/>
<include name="transform_EDI2XML_Groovy_XSLT/lib/**/*.jar"/>
@@ -80,28 +86,46 @@
<!-- include qs specific classes -->
<dirset dir="${org.jboss.esb.test.quickstarts.dir}">
<include name="bpm_orchestration1/build/classes"/>
+ <include name="bpm_orchestration2/build/classes"/>
+ <include name="bpm_orchestration3/build/classes"/>
+ <include name="business_rules_service/build/classes"/>
+ <include name="deadletter/build/classes"/>
<include name="dynamic_router/build/classes"/>
- <include name="fun_cbr/build/classes"/>
+ <include name="exceptions_faults/build/classes"/>
+ <include name="fun_cbr/build/classes"/>
<include name="helloworld/build/classes"/>
<include name="helloworld_action/build/classes"/>
<include name="helloworld_db_registration/build/classes"/>
<include name="helloworld_file_action/build/classes"/>
+ <include name="helloworld_file_notifier/build/classes"/>
<include name="helloworld_sql_action/build/classes"/>
+ <include name="jms_topic/build/classes"/>
+ <include name="load_generator/build/classes"/>
+ <include name="load_generator/load_generator_classes"/>
+ <include name="messagefilter/build/classes"/>
+ <include name="messagestore/build/classes"/>
<include name="recipient_list/build/classes"/>
- <include name="scripting_groovy/build/classes"/>
+ <include name="scheduled_services/build/classes"/>
+ <include name="scripting_groovy/build/classes"/>
<include name="simple_cbr/build/classes"/>
+ <include name="spring_aop/build/classes"/>
+ <include name="spring_helloworld/build/classes"/>
+ <include name="spring_jpetstore/build/classes"/>
<include name="static_router/build/classes"/>
<include name="transform_CSV2XML/build/classes"/>
<include name="transform_EDI2XML_Groovy_XSLT/build/classes"/>
<include name="transform_XML2POJO/build/classes"/>
<include name="transform_XML2XML_date_manipulation/build/classes"/>
<include name="transform_XML2XML_simple/build/classes"/>
+ <include name="webservice_consumer1/build/classes"/>
+ <include name="webservice_consumer2/build/classes"/>
+ <include name="webservice_producer/build/classes"/>
<include name="wiretap/build/classes"/>
</dirset>
<fileset dir="${product.lib.ext}" includes="*.jar"/>
<fileset dir="${product.lib}" includes="*.jar"/>
- <pathelement location="${qa.junit.resources}"/>
+ <pathelement location="${qa.quickstarts.resources}"/>
<path refid="base.cp"/>
</path>
@@ -156,21 +180,39 @@
<mkdir dir="${qa.quickstarts.classes}"/>
<javac srcdir="${qa.quickstarts.src}" destdir="${qa.quickstarts.classes}" classpathref="qa.quickstarts.cp" debug="on"/>
-
+ <jar jarfile="${qa.quickstarts.build.lib}/QuickstartMessageStoreServer.sar">
+ <fileset dir="${qa.quickstarts.classes}">
+ <include name="org/jboss/soa/esb/server/*.class"/>
+ </fileset>
+ <fileset dir="${qa.quickstarts.resources}/server"/>
+ </jar>
</target>
<target name="clean-esb" if="quickstarts.exist">
<exec-quickstart quickstart="bpm_orchestration1" target="clean"/>
+ <exec-quickstart quickstart="bpm_orchestration2" target="clean"/>
+ <exec-quickstart quickstart="bpm_orchestration3" target="clean"/>
+ <exec-quickstart quickstart="business_rules_service" target="clean"/>
+ <exec-quickstart quickstart="deadletter" target="clean"/>
<exec-quickstart quickstart="dynamic_router" target="clean"/>
+ <exec-quickstart quickstart="exceptions_faults" target="clean"/>
<exec-quickstart quickstart="fun_cbr" target="clean"/>
<exec-quickstart quickstart="helloworld" target="clean"/>
<exec-quickstart quickstart="helloworld_action" target="clean"/>
<exec-quickstart quickstart="helloworld_db_registration" target="clean"/>
<exec-quickstart quickstart="helloworld_file_action" target="clean"/>
+ <exec-quickstart quickstart="helloworld_file_notifier" target="clean"/>
<exec-quickstart quickstart="helloworld_sql_action" target="clean"/>
+ <exec-quickstart quickstart="load_generator" target="clean"/>
+ <exec-quickstart quickstart="messagefilter" target="clean"/>
+ <exec-quickstart quickstart="messagestore" target="clean"/>
<exec-quickstart quickstart="recipient_list" target="clean"/>
+ <exec-quickstart quickstart="scheduled_services" target="clean"/>
<exec-quickstart quickstart="scripting_groovy" target="clean"/>
<exec-quickstart quickstart="simple_cbr" target="clean"/>
+ <exec-quickstart quickstart="spring_aop" target="clean"/>
+ <exec-quickstart quickstart="spring_helloworld" target="clean"/>
+ <exec-quickstart quickstart="spring_jpetstore" target="clean"/>
<exec-quickstart quickstart="static_router" target="clean"/>
<exec-quickstart quickstart="transform_CSV2XML" target="clean"/>
<exec-quickstart quickstart="transform_EDI2XML_Groovy_XSLT" target="clean"/>
@@ -178,48 +220,88 @@
<exec-quickstart quickstart="transform_XML2XML_date_manipulation" target="clean"/>
<exec-quickstart quickstart="transform_XML2XML_simple" target="clean"/>
<exec-quickstart quickstart="wiretap" target="clean"/>
+ <exec-quickstart quickstart="webservice_consumer1" target="clean"/>
+ <exec-quickstart quickstart="webservice_consumer2" target="clean"/>
+ <exec-quickstart quickstart="webservice_producer" target="clean"/>
</target>
<target name="compile-esb">
<echo>Compile ESB Packages</echo>
<exec-quickstart quickstart="bpm_orchestration1" target="prepare-deployment"/>
+ <exec-quickstart quickstart="bpm_orchestration2" target="prepare-deployment"/>
+ <exec-quickstart quickstart="bpm_orchestration3" target="prepare-deployment"/>
+ <exec-quickstart quickstart="business_rules_service" target="prepare-deployment"/>
+
+ <exec-quickstart quickstart="deadletter" target="prepare-deployment"/>
<exec-quickstart quickstart="dynamic_router" target="prepare-deployment"/>
+ <exec-quickstart quickstart="exceptions_faults" target="prepare-deployment"/>
+
<exec-quickstart quickstart="fun_cbr" target="prepare-deployment"/>
<exec-quickstart quickstart="helloworld" target="prepare-deployment"/>
<exec-quickstart quickstart="helloworld_action" target="prepare-deployment"/>
<exec-quickstart quickstart="helloworld_db_registration" target="prepare-deployment"/>
<exec-quickstart quickstart="helloworld_file_action" target="prepare-deployment"/>
+ <exec-quickstart quickstart="helloworld_file_notifier" target="prepare-deployment"/>
<exec-quickstart quickstart="helloworld_sql_action" target="prepare-deployment"/>
+ <exec-quickstart quickstart="jms_topic" target="prepare-deployment"/>
+ <!--
+ <exec-quickstart quickstart="load_generator" target="prepare-deployment"/>
+ -->
+ <exec-quickstart quickstart="messagefilter" target="prepare-deployment"/>
+ <exec-quickstart quickstart="messagestore" target="prepare-deployment"/>
<exec-quickstart quickstart="recipient_list" target="prepare-deployment"/>
+ <exec-quickstart quickstart="scheduled_services" target="prepare-deployment"/>
<exec-quickstart quickstart="scripting_groovy" target="prepare-deployment"/>
<exec-quickstart quickstart="simple_cbr" target="prepare-deployment"/>
+ <exec-quickstart quickstart="spring_aop" target="prepare-deployment"/>
+ <exec-quickstart quickstart="spring_helloworld" target="prepare-deployment"/>
+ <exec-quickstart quickstart="spring_jpetstore" target="prepare-deployment"/>
<exec-quickstart quickstart="static_router" target="prepare-deployment"/>
<exec-quickstart quickstart="transform_CSV2XML" target="prepare-deployment"/>
<exec-quickstart quickstart="transform_EDI2XML_Groovy_XSLT" target="prepare-deployment"/>
<exec-quickstart quickstart="transform_XML2POJO" target="prepare-deployment"/>
<exec-quickstart quickstart="transform_XML2XML_date_manipulation" target="prepare-deployment"/>
<exec-quickstart quickstart="transform_XML2XML_simple" target="prepare-deployment"/>
+ <exec-quickstart quickstart="webservice_consumer1" target="prepare-deployment"/>
+ <exec-quickstart quickstart="webservice_consumer2" target="prepare-deployment"/>
+ <exec-quickstart quickstart="webservice_producer" target="prepare-deployment"/>
<exec-quickstart quickstart="wiretap" target="prepare-deployment"/>
-
<copy todir="${qa.quickstarts.build.lib}" flatten="true">
<fileset dir="${org.jboss.esb.test.quickstarts.dir}">
<include name="bpm_orchestration1/build/*.esb"/>
+ <include name="bpm_orchestration2/build/*.esb"/>
+ <include name="bpm_orchestration3/build/*.esb"/>
+ <include name="business_rules_service/build/*.esb"/>
+ <include name="deadletter/build/*.esb"/>
<include name="dynamic_router/build/*.esb"/>
+ <include name="exceptions_faults/build/*.esb"/>
<include name="fun_cbr/build/*.esb"/>
<include name="helloworld/build/*.esb"/>
<include name="helloworld_action/build/*.esb"/>
<include name="helloworld_db_registration/build/*.esb"/>
<include name="helloworld_file_action/build/*.esb"/>
+ <include name="helloworld_file_notifier/build/*.esb"/>
<include name="helloworld_sql_action/build/*.esb"/>
+ <include name="jms_topic/build/*.esb"/>
+ <include name="load_generator/build/*.esb"/>
+ <include name="messagefilter/build/*.esb"/>
+ <include name="messagestore/build/*.esb"/>
<include name="recipient_list/build/*.esb"/>
<include name="scripting_groovy/build/*.esb"/>
+ <include name="scheduled_services/build/*.esb"/>
<include name="simple_cbr/build/*.esb"/>
+ <include name="spring_aop/build/*.esb"/>
+ <include name="spring_helloworld/build/*.esb"/>
+ <include name="spring_jpetstore/build/*.esb"/>
<include name="static_router/build/*.esb"/>
<include name="transform_CSV2XML/build/*.esb"/>
<include name="transform_EDI2XML_Groovy_XSLT/build/*.esb"/>
<include name="transform_XML2POJO/build/*.esb"/>
<include name="transform_XML2XML_date_manipulation/build/*.esb"/>
<include name="transform_XML2XML_simple/build/*.esb"/>
+ <include name="webservice_consumer1/build/*.esb"/>
+ <include name="webservice_consumer2/build/*.esb"/>
+ <include name="webservice_producer/build/*.esb"/>
<include name="wiretap/build/*.esb"/>
</fileset>
</copy>
@@ -261,16 +343,34 @@
<fileset dir="${qa.quickstarts.src}">
<include name="**/${tests.filter}Test.java"/>
<exclude name="${tests.exclude}"/>
+ <!-- SpringJPetStore requires additional configuration
+ files and hsqldb. The QS needs some work before
+ the CI test can run. -->
+ <exclude name="**/SpringJPetStoreTest.java"/>
<exclude name="**/HelloWorldSQLActionTest.java"/>
+ <exclude name="**/BPMOrchestration1Test.java"/>
+ <!-- The following quickstart is broken -->
+ <exclude name="**/BPMOrchestration3Test.java"/>
+ <exclude name="**/HelloWorldFileNotifierTest.java"/>
<exclude name="**/RecipientlistTest.java"/>
- <exclude name="**/FunCBRTest.java"/>
- <exclude name="**/BPMOrchestrationTest.java"/>
- <exclude name="**/SimpleCBRTest.java"/>
+ <exclude name="**/ExceptionsFaultsTest.java"/>
<exclude name="**/DynamicRouterTest.java"/>
+ <!-- The Groovy Gateway test requires testing UI -->
+ <exclude name="**/GroovyGatewayTest.java"/>
+ <exclude name="**/LoadGeneratorTest.java"/>
<exclude name="**/StaticRouterTest.java"/>
<exclude name="**/WebserviceAdapterTest.java"/>
<exclude name="**/HelloWorldDBRegistrationTest.java"/>
<exclude name="**/WebserviceBPELTest.java"/>
+ <!-- The WebService quickstarts require jbossws, which
+ requires jars that are not installed with
+ esb-server (jboss-client.jar for example) -->
+ <exclude name="**/WebServiceConsumer1Test.java"/>
+ <exclude name="**/WebServiceConsumer2Test.java"/>
+ <exclude name="**/WebServiceProducerTest.java"/>
+ <exclude name="**/WebServiceMTOMTest.java"/>
+ <exclude name="**/WebServiceWSAddressingTest.java"/>
+ <exclude name="**/WebServiceWSSecurityTest.java"/>
</fileset>
</batchtest>
<classpath>
@@ -291,8 +391,10 @@
value="${org.jboss.soa.esb.paramsRepository.file.root}"/>
<!-- Sys Props from the test.properties file... -->
+ <!--
<sysproperty key="org.jboss.soa.esb.jndi.server.type" value="${org.jboss.soa.esb.jndi.server.type}"/>
<sysproperty key="org.jboss.soa.esb.jndi.server.url" value="${org.jboss.soa.esb.jndi.server.url}"/>
+ -->
<!-- Sys Props from the deployment.properties file... -->
<sysproperty key="org.jboss.esb.test.ftp.hostname" value="${org.jboss.esb.test.ftp.hostname}"/>
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/resources/server (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/qa/quickstarts/resources/server)
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/resources/server/META-INF (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/qa/quickstarts/resources/server/META-INF)
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/resources/server/META-INF/jboss-service.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/qa/quickstarts/resources/server/META-INF/jboss-service.xml 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/resources/server/META-INF/jboss-service.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<server>
- <mbean code="org.jboss.soa.esb.server.QuickstartMessageStoreImpl"
- name="jboss.esb:test=QuickstartMessageStoreServer"/>
-</server>
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/resources/server/META-INF/jboss-service.xml (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/qa/quickstarts/resources/server/META-INF/jboss-service.xml)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/resources/server/META-INF/jboss-service.xml (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/resources/server/META-INF/jboss-service.xml 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<server>
+ <mbean code="org.jboss.soa.esb.server.QuickstartMessageStoreImpl"
+ name="jboss.esb:test=QuickstartMessageStoreServer"/>
+</server>
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/AbstractQuickstartTestCase.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/AbstractQuickstartTestCase.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/AbstractQuickstartTestCase.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/AbstractQuickstartTestCase.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,178 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2007,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.quickstart.test;
+
+import java.lang.reflect.UndeclaredThrowableException;
+
+import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
+
+import org.jboss.soa.esb.server.QuickstartMessageStore;
+import org.jboss.soa.esb.server.QuickstartMessageStoreImplMBean;
+import org.jboss.test.JBossTestCase;
+
+/**
+ * Abstract test case for Quickstart tests
+ *
+ * @author <a href="mailto:kconner at redhat.com">Kevin Conner</a>
+ */
+public abstract class AbstractQuickstartTestCase extends JBossTestCase
+{
+ /**
+ * Construct the test case with the specified name.
+ * @param name The test name.
+ */
+ protected AbstractQuickstartTestCase(final String name)
+ {
+ super(name) ;
+ }
+
+ /**
+ * Clear the messages in the sink.
+ * @throws Exception for unexpected errors.
+ */
+ protected void clearMessages()
+ throws Exception
+ {
+ getQuickstartMessageStore().clearMessages() ;
+ }
+
+ /**
+ * Wait for the specified count of messages.
+ * @param numberOfMessages The expected number of messages.
+ * @param maxDelay The maximum delay to wait for the messages.
+ * @return The message list if present, otherwise current contents.
+ * @throws Exception for unexpected errors.
+ */
+ protected String[] waitForMessages(final int numberOfMessages, final long maxDelay)
+ throws Exception
+ {
+ final String[] sinkMessages = getQuickstartMessageStore().waitForMessages(numberOfMessages, maxDelay) ;
+ final int numberOfSinkMessages = (sinkMessages == null ? 0 : sinkMessages.length) ;
+ assertEquals("Message count", numberOfMessages, numberOfSinkMessages) ;
+ return sinkMessages ;
+ }
+
+ /**
+ * Check the stored messages against the expected messages.
+ * @param maxDelay The maximum delay to wait for the messages.
+ * @param expectedMessages The expected messages.
+ * @throws Exception for unexpected errors.
+ */
+ protected void checkMessages(final long maxDelay, String ... expectedMessages)
+ throws Exception
+ {
+ final int numberOfMessages = (expectedMessages == null ? 0 : expectedMessages.length) ;
+ final String[] sinkMessages = waitForMessages(numberOfMessages, maxDelay) ;
+
+ for(int count = 0 ; count < numberOfMessages ; count++)
+ {
+ assertEquals("Message: " + count, expectedMessages[count],
+ sinkMessages[count]) ;
+ }
+ }
+
+ /**
+ * Check the stored messages against the expected patterns.
+ * @param maxDelay The maximum delay to wait for the messages.
+ * @param expectedPatterns The patterns of the expected messages.
+ * @throws Exception for unexpected errors.
+ */
+ protected void checkPatternMessages(final long maxDelay, String ... expectedPatterns)
+ throws Exception
+ {
+ final int numberOfMessages = (expectedPatterns == null ? 0 : expectedPatterns.length) ;
+ final String[] sinkMessages = waitForMessages(numberOfMessages, maxDelay) ;
+ for(int count = 0 ; count < numberOfMessages ; count++)
+ {
+ final String sinkMessage = sinkMessages[count] ;
+ assertTrue("Message: " + count, (sinkMessage != null) && sinkMessage.matches(expectedPatterns[count])) ;
+ }
+ }
+
+ /**
+ * Get a proxy to the quickstart message store MBean.
+ * @return The mbean proxy.
+ * @throws Exception for unexpected errors.
+ */
+ private QuickstartMessageStore getQuickstartMessageStore()
+ throws Exception
+ {
+ return new QuickstartMessageStoreProxy(getServer()) ;
+ }
+
+ /**
+ * Proxy class to simplify the interactions with the MBean.
+ * @author kevin
+ */
+ private static final class QuickstartMessageStoreProxy implements QuickstartMessageStore
+ {
+ private final MBeanServerConnection serverConnection ;
+
+ QuickstartMessageStoreProxy(final MBeanServerConnection serverConnection)
+ {
+ this.serverConnection = serverConnection ;
+ }
+
+ public void clearMessages()
+ {
+ try
+ {
+ serverConnection.invoke(new ObjectName(QuickstartMessageStoreImplMBean.objectName), "clearMessages",
+ null, null) ;
+ }
+ catch (final RuntimeException re)
+ {
+ throw re ;
+ }
+ catch (final Error error)
+ {
+ throw error ;
+ }
+ catch (final Throwable th)
+ {
+ throw new UndeclaredThrowableException(th) ;
+ }
+ }
+
+ public String[] waitForMessages(int numberOfMessages, long maxDelay)
+ {
+ try
+ {
+ return (String[])serverConnection.invoke(new ObjectName(QuickstartMessageStoreImplMBean.objectName), "waitForMessages",
+ new Object[] {Integer.valueOf(numberOfMessages), Long.valueOf(maxDelay)},
+ new String[] {Integer.TYPE.getName(), Long.TYPE.getName()}) ;
+ }
+ catch (final RuntimeException re)
+ {
+ throw re ;
+ }
+ catch (final Error error)
+ {
+ throw error ;
+ }
+ catch (final Throwable th)
+ {
+ throw new UndeclaredThrowableException(th) ;
+ }
+ }
+ }
+}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestration1Test.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestration1Test.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestration1Test.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestration1Test.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,63 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2007,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.quickstart.test;
+
+import junit.framework.Test;
+
+import org.jboss.soa.esb.samples.quickstarts.bpm_orchestration1.test.SendTestMessage;
+
+/**
+ * CI test for the bpmorchestration1 test.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ */
+public class BPMOrchestration1Test extends AbstractQuickstartTestCase {
+ private static final String DEPLOY_MESSAGE = "Go Deploy It";
+ private static final String START_MESSAGE = "Start It Up";
+
+ public BPMOrchestration1Test(String name) {
+ super(name);
+ }
+
+ public void testMessage() throws Exception {
+ clearMessages() ;
+ sendDeployMessage() ;
+ checkMessages(30000, DEPLOY_MESSAGE) ;
+
+ clearMessages() ;
+ sendStartMessage() ;
+ checkMessages(30000, START_MESSAGE) ;
+ }
+
+ public void sendDeployMessage() throws Exception {
+ SendTestMessage sm = new SendTestMessage();
+ sm.sendMessage(Helpers.getQuickstartLocation("bpm_orchestration1/build/inputdir"), ".deployProcessGW", DEPLOY_MESSAGE);
+ }
+
+ public void sendStartMessage() throws Exception {
+ SendTestMessage stm = new SendTestMessage();
+ stm.sendMessage(Helpers.getQuickstartLocation("bpm_orchestration1/build/inputdir"), ".startProcessGW", START_MESSAGE);
+ }
+
+ public static Test suite() throws Exception {
+ return getDeploySetup(BPMOrchestration1Test.class, "QuickstartMessageStoreServer.sar, Quickstart_bpm_orchestration1.esb");
+ }
+}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestration2Test.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestration2Test.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestration2Test.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestration2Test.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,81 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2007,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.quickstart.test;
+
+import junit.framework.Test;
+
+import org.jboss.soa.esb.samples.quickstarts.bpm_orchestration2.test.SendJMSMessageDeploy;
+import org.jboss.soa.esb.samples.quickstarts.bpm_orchestration2.test.SendJMSMessageStart;
+
+/**
+ * CI test for the bpmorchestration3 test.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ */
+public class BPMOrchestration2Test extends AbstractQuickstartTestCase {
+ private static final String DEPLOY_DEF_MESSAGE = "Hello World: Deploy the process def";
+
+ private static final String GETTING_STARTED_MESSAGE = "Getting Started";
+ private static final String RECEIVE_ORDER_MESSAGE = GETTING_STARTED_MESSAGE + " 'Receive Order' " ;
+ private static final String CREDIT_CHECK_MESSAGE = RECEIVE_ORDER_MESSAGE + " 'Credit Check' " ;
+ private static final String VALIDATE_ORDER_MESSAGE = CREDIT_CHECK_MESSAGE + " 'Validate Order' " ;
+ private static final String INVENTORY_CHECK_MESSAGE = VALIDATE_ORDER_MESSAGE + " 'Inventory Check' " ;
+ private static final String SHIPPED_MESSAGE = " 'Shipped' " ;
+
+ public BPMOrchestration2Test(String name) {
+ super(name);
+ }
+
+ public void testMessage() throws Exception {
+ clearMessages() ;
+ sendDeployMessage() ;
+ checkMessages(30000, DEPLOY_DEF_MESSAGE, "Success:" + DEPLOY_DEF_MESSAGE) ;
+
+ clearMessages() ;
+ sendStartMessage() ;
+
+ final String[] messages = waitForMessages(9, 30000) ;
+ assertEquals(GETTING_STARTED_MESSAGE, messages[0]) ;
+ assertEquals(RECEIVE_ORDER_MESSAGE, messages[1]) ;
+ assertEquals(CREDIT_CHECK_MESSAGE, messages[2]) ;
+ assertEquals(VALIDATE_ORDER_MESSAGE, messages[3]) ;
+ assertEquals(INVENTORY_CHECK_MESSAGE, messages[4]) ;
+ assertTrue("Shipped triggered", (messages[8] != null) && messages[8].endsWith(SHIPPED_MESSAGE)) ;
+ }
+
+ public void sendDeployMessage() throws Exception {
+ SendJMSMessageDeploy sd = new SendJMSMessageDeploy();
+ sd.setupConnection();
+ sd.sendAMessage(DEPLOY_DEF_MESSAGE);
+ sd.stop();
+ }
+
+ public void sendStartMessage() throws Exception {
+ SendJMSMessageStart sm = new SendJMSMessageStart();
+ sm.setupConnection();
+ sm.sendAMessage(GETTING_STARTED_MESSAGE);
+ sm.stop();
+ }
+
+ public static Test suite() throws Exception {
+ return getDeploySetup(BPMOrchestration2Test.class, "QuickstartMessageStoreServer.sar, Quickstart_bpm_orchestration2.esb");
+ }
+}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestration3Test.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestration3Test.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestration3Test.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestration3Test.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2007,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.quickstart.test;
+
+import junit.framework.Test;
+
+import org.jboss.soa.esb.samples.quickstarts.bpm_orchestration3.test.SendJMSMessage;
+
+/**
+ * CI test for the bpmorchestration3 test.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ */
+public class BPMOrchestration3Test extends AbstractQuickstartTestCase {
+ private static final String DEPLOY_MESSAGE = "Hello Deploy";
+ private static final String START_MESSAGE = "Hello start";
+ private static final String SERVICE_1_MESSAGE = START_MESSAGE + " 'Service 1' ";
+ private static final String SERVICE_2_MESSAGE = SERVICE_1_MESSAGE + " 'Service 2' ";
+ private static final String SERVICE_3_MESSAGE = SERVICE_2_MESSAGE + " 'Service 3' ";
+
+ public BPMOrchestration3Test(String name) {
+ super(name);
+ }
+
+ public void testMessage() throws Exception {
+ clearMessages() ;
+ sendDeployMessage() ;
+ checkMessages(30000, DEPLOY_MESSAGE, "Success:" + DEPLOY_MESSAGE) ;
+
+ clearMessages() ;
+ sendStartMessage() ;
+ checkMessages(30000, START_MESSAGE, SERVICE_1_MESSAGE,
+ SERVICE_2_MESSAGE, SERVICE_3_MESSAGE) ;
+ }
+
+ public void sendDeployMessage() throws Exception {
+ SendJMSMessage sdm = new SendJMSMessage();
+ sdm.setupConnection("queue/quickstart_bpm_orchestration3_deploy_Request_gw");
+ sdm.sendAMessage("Hello Deploy", null);
+ sdm.stop();
+ }
+
+ public void sendStartMessage() throws Exception {
+ SendJMSMessage ssm = new SendJMSMessage();
+ ssm.setupConnection("queue/quickstart_bpm_orchestration3_start_Request_gw");
+ ssm.sendAMessage("Hello start", "${token}");
+ ssm.stop();
+ }
+
+ public static Test suite() throws Exception {
+ return getDeploySetup(BPMOrchestration3Test.class, "QuickstartMessageStoreServer.sar, Quickstart_bpm_orchestration3.esb");
+ }
+}
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestrationTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestrationTest.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestrationTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -1,56 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.soa.esb.quickstart.test;
-
-import junit.framework.Test;
-
-import org.jboss.test.JBossTestCase;
-
-
-/**
- * Sample client for the jboss container.
- *
- * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
- */
-public class BPMOrchestrationTest
- extends JBossTestCase
-{
- public BPMOrchestrationTest(String name)
- {
- super(name);
- }
-
- public void testMessage() throws Exception
- {
- sendMessage();
- Thread.sleep(10000); // wait for message to post.
- }
-
- public void sendMessage() throws Exception
- {
- }
-
- public static Test suite() throws Exception
- {
- return getDeploySetup(BPMOrchestrationTest.class, "Quickstart_bpm_orchestration1.esb");
- }
-}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BusinessRulesServiceTest.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BusinessRulesServiceTest.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BusinessRulesServiceTest.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BusinessRulesServiceTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2007,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.quickstart.test;
+
+import junit.framework.Test;
+
+import org.jboss.soa.esb.samples.quickstart.businessrules.test.SendJMSMessage;
+
+/**
+ * CI test for the businessrulesservice quickstart.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ */
+public class BusinessRulesServiceTest extends AbstractQuickstartTestCase {
+ private static final String JMS_MESSAGE =
+ "<Order netAmount=\"59.97\" orderDate=\"Wed Nov 15 13:45:28 EST 2006\" orderId=\"1\" statusCode=\"0\" tax=\"4.95\" totalAmount=\"64.92\">" +
+ " <Customer firstName=\"Harry\" lastName=\"Fletcher\" state=\"SD\" userName=\"user1\"/>" +
+ " <OrderLines>" +
+ " <OrderLine position=\"1\" quantity=\"1\">" +
+ " <Product price=\"29.98\" productId=\"364\" title=\"The 40-Year-Old Virgin \"/>" +
+ " </OrderLine>" +
+ " <OrderLine position=\"2\" quantity=\"1\">" +
+ " <Product price=\"29.99\" productId=\"299\" title=\"Pulp Fiction\"/>" +
+ " </OrderLine>" +
+ " </OrderLines>" +
+ "</Order>" ;
+
+ public BusinessRulesServiceTest(String name) {
+ super(name);
+ }
+
+ public void testMessage() throws Exception {
+ clearMessages();
+ sendMessage();
+ final String[] messages = waitForMessages(1, 30000) ;
+ assertTrue("XML response message", Helpers.compareXMLContent(JMS_MESSAGE, messages[0])) ;
+ }
+
+ public void sendMessage() throws Exception {
+ SendJMSMessage sm = new SendJMSMessage();
+ sm.setupConnection();
+ String fileContent = sm.readAsciiFile(Helpers.getQuickstartLocation("business_rules_service/SampleOrder.xml"));
+ sm.sendAMessage(fileContent) ;
+ sm.stop();
+
+ }
+
+ public static Test suite() throws Exception {
+ return getDeploySetup(BusinessRulesServiceTest.class, "QuickstartMessageStoreServer.sar, Quickstart_business_rules_service.esb");
+ }
+}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/DeadLetterTest.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/DeadLetterTest.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/DeadLetterTest.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/DeadLetterTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2007,
+ * @author JBoss Inc.
+ */
+
+package org.jboss.soa.esb.quickstart.test;
+
+import junit.framework.Test;
+
+import org.jboss.soa.esb.samples.quickstart.deadletter.test.SendJMSMessage;
+
+
+/**
+ * CI test for the DeadLetter quickstart.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ */
+public class DeadLetterTest extends AbstractQuickstartTestCase {
+ private static final String JMS_MESSAGE = "DeadLetterTest message";
+
+ public DeadLetterTest(String name) {
+ super(name);
+ }
+
+ public void testMessage() throws Exception {
+ clearMessages() ;
+ sendMessage();
+ checkPatternMessages(30000, '^' + JMS_MESSAGE + ".*$") ;
+ } /* method */
+
+ public void sendMessage() throws Exception {
+ SendJMSMessage sm = new SendJMSMessage();
+ sm.setupConnection();
+ sm.sendAMessage(JMS_MESSAGE) ;
+ sm.stop();
+ }
+
+ public static Test suite() throws Exception {
+ return getDeploySetup(DeadLetterTest.class, "QuickstartMessageStoreServer.sar, Quickstart_deadletter.esb");
+ }
+} /* class */
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/DynamicRouterTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/DynamicRouterTest.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/DynamicRouterTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -21,29 +21,19 @@
*/
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
-import java.util.Hashtable;
-
import junit.framework.Test;
-import org.jboss.soa.esb.actions.StoreMessageToFile;
import org.jboss.soa.esb.samples.quickstart.dynamicRouter.test.ReceiveJMSMessage;
import org.jboss.soa.esb.samples.quickstart.dynamicRouter.test.SendJMSMessage;
-import org.jboss.test.JBossTestCase;
/**
- * Sample client for the jboss container.
+ * CI test for the dynamicouter QS.
*
- * @author <a href="mailto:"></a>
- * @version $Id: $
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
-
-public class DynamicRouterTest extends JBossTestCase
+public class DynamicRouterTest extends AbstractQuickstartTestCase
{
private static final String JMS_MESSAGE = "DynamicRouterTest message";
- private static final String FILE_NAME = "DynamicRouterTest.log";
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME) + FILE_NAME;
- private static final int EXPECTED_RECORD_COUNT = 3;
public DynamicRouterTest(String name)
{
@@ -52,35 +42,9 @@
public void testMessage() throws Exception
{
- sendMessage();
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail ("Event file " + LOG_FILE + " not created - test marked as failing");
- }
-
- /* Verify that the message file is complete */
- boolean fileComplete = Helpers.checkFileContent(LOG_FILE, EXPECTED_RECORD_COUNT);
- if (!fileComplete) {
- Hashtable<String, String> temp = Helpers.getMessageString(LOG_FILE);
- File target = new File(LOG_FILE);
- target.delete();
- fail ("Event file " + LOG_FILE + " not complete - expected " + EXPECTED_RECORD_COUNT
- + " records - found " + temp.size() + ", test marked as failing");
- }
-
- Hashtable<String, String> theTable = Helpers.getMessageString(LOG_FILE);
-
- String theMessage1 = (String) theTable.get("Message1");
- String theMessage2 = (String) theTable.get("Message2");
- String theMessage3 = (String) theTable.get("Message3");
-
- assertEquals("The strings1 should match", theMessage1, JMS_MESSAGE);
- assertEquals("The strings2 should match", theMessage2, JMS_MESSAGE);
- assertEquals("The strings3 should match", theMessage3, JMS_MESSAGE);
-
- File target = new File(LOG_FILE);
- target.delete();
+ clearMessages() ;
+ sendMessage();
+ checkMessages(30000, JMS_MESSAGE, JMS_MESSAGE, JMS_MESSAGE) ;
}
public void sendMessage() throws Exception
@@ -94,12 +58,12 @@
SendJMSMessage sm = new SendJMSMessage();
sm.setupConnection();
- sm.sendAMessage(JMS_MESSAGE + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_START + FILE_NAME + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_END);
+ sm.sendAMessage(JMS_MESSAGE);
sm.stop();
}
public static Test suite() throws Exception
{
- return getDeploySetup(DynamicRouterTest.class, "Quickstart_dynamic_router.esb");
+ return getDeploySetup(DynamicRouterTest.class, "QuickstartMessageStoreServer.sar, Quickstart_dynamic_router.esb");
}
}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/ExceptionsFaultsTest.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/ExceptionsFaultsTest.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/ExceptionsFaultsTest.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/ExceptionsFaultsTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb.quickstart.test;
+
+import junit.framework.Test;
+
+import org.jboss.soa.esb.samples.quickstart.exceptions.test.SendJMSMessage;
+
+/**
+ * CI test for the exceptionsfaults quickstart.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ * @author <a href="mailto:ldimaggi at redhat.com">Len Dimaggio</a>
+ */
+public class ExceptionsFaultsTest extends AbstractQuickstartTestCase {
+ private static final String JMS_MESSAGE = "HelloWorldTest message";
+
+ public ExceptionsFaultsTest(String name) {
+ super(name);
+ }
+
+ public void testMessage() throws Exception {
+ clearMessages() ;
+ sendMessage();
+ checkMessages(30000, JMS_MESSAGE, JMS_MESSAGE, "CHECK") ;
+ }
+
+ public void sendMessage() throws Exception {
+ SendJMSMessage sm = new SendJMSMessage();
+ sm.setupConnection("queue/quickstart_exceptions_faults_GW");
+ sm.sendAMessage("ExceptionCaughtService", "Via Gateway");
+ sm.stop();
+ }
+
+ public static Test suite() throws Exception {
+ return getDeploySetup(ExceptionsFaultsTest.class, "QuickstartMessageStoreServer.sar, Quickstart_exceptions_faults.esb");
+ }
+}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/FunCBRTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/FunCBRTest.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/FunCBRTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -23,35 +23,44 @@
import junit.framework.Test;
-import org.jboss.test.JBossTestCase;
+import org.jboss.soa.esb.samples.quickstart.funcbr.test.SendJMSMessage;
/**
- * Sample client for the jboss container.
+ * CI test for the funcbr quickstart.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ * @author <a href="mailto:ldimaggi at redhat.com">Len Dimaggio</a>
*/
+public class FunCBRTest
+ extends AbstractQuickstartTestCase {
-public class FunCBRTest
- extends JBossTestCase
-{
- public FunCBRTest(String name)
- {
+ private static String theXML = "<Order orderId=\"1\" "
+ + "orderDate=\"Wed Nov 15 13:45:28 EST 2006\" "
+ + "statusCode=\"0\" " + "netAmount=\"59.97\" "
+ + "totalAmount=\"64.92\" " + "tax=\"4.95\" "
+ + "junk=\"FunCBRTest message\"></Order>";
+
+ public FunCBRTest(String name) {
super(name);
- }
+ } /* method */
- public void testMessage() throws Exception
- {
- sendMessage();
- Thread.sleep(10000); // wait for message to post.
- }
+ public void testMessage() throws Exception {
+ clearMessages() ;
+ sendMessage() ;
+ final String[] messages = waitForMessages(1, 30000) ;
+ assertTrue("XML Content", Helpers.compareXMLContent(theXML, messages[0])) ;
+ } /* method */
- public void sendMessage() throws Exception
- {
- }
+ public void sendMessage() throws Exception {
+ SendJMSMessage sm = new SendJMSMessage();
+ sm.setupConnection();
+ sm.sendAMessage(theXML);
+ sm.stop();
+ } /* method */
- public static Test suite() throws Exception
- {
- return getDeploySetup(FunCBRTest.class, "Quickstart_fun_cbr.esb");
- }
-}
+ public static Test suite() throws Exception {
+ return getDeploySetup(FunCBRTest.class, "QuickstartMessageStoreServer.sar, Quickstart_fun_cbr.esb");
+ } /* method */
+
+} /* class */
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldActionTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldActionTest.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldActionTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -21,76 +21,39 @@
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
-import java.util.Hashtable;
-
import junit.framework.Test;
-import org.jboss.soa.esb.actions.StoreMessageToFile;
import org.jboss.soa.esb.samples.quickstart.helloworldaction.test.SendJMSMessage;
-import org.jboss.test.JBossTestCase;
/**
- * Sample client for the jboss container.
+ * CI test for the helloworldaction quickstart.
*
- * @author <a href="mailto:bill at burkecentral.com">Bill Burke</a>
- * @version $Id: BlobUnitTestCase.java 58110 2006-11-04 08:34:21Z
- * scott.stark at jboss.org $
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
-public class HelloWorldActionTest extends JBossTestCase {
+public class HelloWorldActionTest extends AbstractQuickstartTestCase {
private static final String JMS_MESSAGE = "HelloWorldActionTest message";
- private static final String RESPONSE_MESSAGE = "BEFORE**" + JMS_MESSAGE + "AFTER**" ;
- private static final String FILE_NAME = "HelloWorldActionTest.log";
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME) + FILE_NAME;
- private static final int EXPECTED_RECORD_COUNT = 1;
+ private static final String RESPONSE_MESSAGE = "\nBEFORE**\n" + JMS_MESSAGE + "\nAFTER**\n" ;
public HelloWorldActionTest(String name) {
super(name);
}
public void testMessage() throws Exception {
- final File logFile = new File(LOG_FILE) ;
- if (logFile.exists())
- {
- assertTrue("Deleting logfile", logFile.delete()) ;
- }
-
- sendMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
- /* Verify that the message file is complete */
- boolean fileComplete = Helpers.checkFileContent(LOG_FILE,
- EXPECTED_RECORD_COUNT);
- if (!fileComplete) {
- Hashtable<String, String> temp = Helpers.getMessageString(LOG_FILE);
- fail("Event file " + LOG_FILE + " not complete - expected "
- + EXPECTED_RECORD_COUNT + " records - found " + temp.size()
- + ", test marked as failing");
- }
-
- Hashtable<String, String> theTable = Helpers.getMessageString(LOG_FILE);
- String theMessage = (String) theTable.get("Message1");
- assertEquals("The strings should match", RESPONSE_MESSAGE, theMessage);
- assertTrue("Deleting logfile", logFile.delete()) ;
+ clearMessages() ;
+ sendMessage() ;
+ checkMessages(30000, RESPONSE_MESSAGE) ;
}
public void sendMessage() throws Exception {
SendJMSMessage sm = new SendJMSMessage();
sm.setupConnection();
- sm.sendAMessage(JMS_MESSAGE + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_START + FILE_NAME
- + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_END);
+ sm.sendAMessage(JMS_MESSAGE);
sm.stop();
}
public static Test suite() throws Exception {
return getDeploySetup(HelloWorldActionTest.class,
- "Quickstart_helloworld_action.esb");
+ "QuickstartMessageStoreServer.sar, Quickstart_helloworld_action.esb");
}
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldDBRegistrationTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldDBRegistrationTest.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldDBRegistrationTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -21,72 +21,37 @@
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
-import java.util.Hashtable;
-
import junit.framework.Test;
-import org.jboss.soa.esb.actions.StoreMessageToFile;
import org.jboss.soa.esb.samples.quickstart.helloworlddbregistration.test.SendJMSMessage;
-import org.jboss.test.JBossTestCase;
/**
- * Sample client for the jboss container.
+ * CI test for the helloworlddbregistration quickstart.
*
- * @author <a href="mailto:bill at burkecentral.com">Bill Burke</a>
- * @version $Id: BlobUnitTestCase.java 58110 2006-11-04 08:34:21Z
- * scott.stark at jboss.org $
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
-
-public class HelloWorldDBRegistrationTest extends JBossTestCase {
+public class HelloWorldDBRegistrationTest extends AbstractQuickstartTestCase {
private static final String JMS_MESSAGE = "HelloWorldDBRegistrationTest message";
- private static final String FILE_NAME = "HelloWorldDBRegistrationTest.log";
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME) + FILE_NAME;
- private static final int EXPECTED_RECORD_COUNT = 1;
public HelloWorldDBRegistrationTest(String name) {
super(name);
}
public void testMessage() throws Exception {
- sendMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
- /* Verify that the message file is complete */
- boolean fileComplete = Helpers.checkFileContent(LOG_FILE,
- EXPECTED_RECORD_COUNT);
- if (!fileComplete) {
- Hashtable<String, String> temp = Helpers.getMessageString(LOG_FILE);
- File target = new File(LOG_FILE);
- target.delete();
- fail("Event file " + LOG_FILE + " not complete - expected "
- + EXPECTED_RECORD_COUNT + " records - found " + temp.size()
- + ", test marked as failing");
- }
-
- Hashtable<String, String> theTable = Helpers.getMessageString(LOG_FILE);
- String theMessage = (String) theTable.get("Message1");
- assertEquals("The strings should match", theMessage, JMS_MESSAGE);
- File target = new File(LOG_FILE);
- target.delete();
+ clearMessages() ;
+ sendMessage() ;
+ checkMessages(30000, JMS_MESSAGE) ;
}
public void sendMessage() throws Exception {
SendJMSMessage sm = new SendJMSMessage();
sm.setupConnection();
- sm.sendAMessage(JMS_MESSAGE + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_START + FILE_NAME
- + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_END);
+ sm.sendAMessage(JMS_MESSAGE);
sm.stop();
}
public static Test suite() throws Exception {
return getDeploySetup(HelloWorldDBRegistrationTest.class,
- "Quickstart_db_registration.esb");
+ "QuickstartMessageStoreServer.sar, Quickstart_db_registration.esb");
}
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldFileActionTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldFileActionTest.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldFileActionTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -24,31 +24,21 @@
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
-import java.util.Hashtable;
import junit.framework.Test;
-import org.jboss.soa.esb.actions.StoreMessageToFile;
-import org.jboss.test.JBossTestCase;
-
/**
- * Sample client for the jboss container.
+ * CI test for the helloworldfileaction quickstart.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
-
public class HelloWorldFileActionTest
- extends JBossTestCase {
+ extends AbstractQuickstartTestCase {
- private static final String FILE_NAME = "HelloWorldFileActionTest.log";
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME) + FILE_NAME;
- private static final int EXPECTED_RECORD_COUNT = 1;
private static final String INPUT_DIRECTORY = "helloworld_file_action/build/dirs/input/";
private static final String INPUT_FILE_NAME = "MyInput.dat";
- private static final String OUTPUT_DIRECTORY = "helloworld_file_action/build/dirs/output/";
- private static final String OUTPUT_FILE_NAME = OUTPUT_DIRECTORY + "MyInput.dat.sentToEsb";
private static final String FILE_CONTENTS = "Hello World In A File";
- private static final String RESPONSE_CONTENTS = "BEFORE"+FILE_CONTENTS+"AFTER";
+ private static final String RESPONSE_CONTENTS = "\nBEFORE\n"+FILE_CONTENTS+"\nAFTER\n";
public HelloWorldFileActionTest(String name)
{
@@ -57,79 +47,23 @@
public void testMessage() throws Exception
{
- final File logFile = new File(LOG_FILE) ;
- if (logFile.exists())
- {
- assertTrue("Deleting logfile", logFile.delete()) ;
- }
- final String outputFileName = Helpers.getQuickstartLocation(OUTPUT_FILE_NAME) ;
-
- createFileAction();
-
- /* Verify that the output file is created */
- boolean fileExists = Helpers.checkForFile(outputFileName);
- if (!fileExists) {
- fail("File " + outputFileName
- + " not created - test marked as failing");
- }
-
- /* Verify that the message file is created */
- fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
- /* Verify that the log file is complete */
- boolean logFileComplete = Helpers.checkFileContent(LOG_FILE,
- EXPECTED_RECORD_COUNT);
- if (!logFileComplete) {
- Hashtable<String, String> temp = Helpers.getMessageString(LOG_FILE);
- fail("File Action Output file " + LOG_FILE + " not complete - expected "
- + EXPECTED_RECORD_COUNT + " records - found " + temp.size()
- + ", test marked as failing");
- }
-
- /* Check the log file */
- Hashtable<String, String> theTable = Helpers.getMessageString(LOG_FILE);
- String theMessage = (String) theTable.get("Message1");
- assertEquals("The strings in the log file should match", RESPONSE_CONTENTS, theMessage);
-
- /* Verify that the output file is complete */
- boolean fileComplete = Helpers.checkFileContent(outputFileName,
- EXPECTED_RECORD_COUNT);
- if (!fileComplete) {
- Hashtable<String, String> temp = Helpers.getMessageString(outputFileName);
- fail("File Action Output file " + outputFileName + " not complete - expected "
- + EXPECTED_RECORD_COUNT + " records - found " + temp.size()
- + ", test marked as failing");
- }
-
- theTable = Helpers.getMessageString(outputFileName);
- theMessage = (String) theTable.get("Message1");
- assertEquals("The strings in output file should match", FILE_CONTENTS, theMessage);
-
- assertTrue("Deleting logfile", logFile.delete()) ;
+ clearMessages() ;
+ createFileAction();
+ checkMessages(30000, RESPONSE_CONTENTS) ;
} /* method */
public void createFileAction() throws Exception
{
- String tempStr = FILE_CONTENTS + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_START + FILE_NAME + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_END;
final String inputDirectory = Helpers.getQuickstartLocation(INPUT_DIRECTORY) ;
File x = new File(inputDirectory, INPUT_FILE_NAME);
- try {
BufferedWriter out = new BufferedWriter(new FileWriter(x));
- out.write(tempStr.toCharArray());
+ out.write(FILE_CONTENTS);
out.close();
- } catch (Exception e) {
- System.out.println("Error while writing the file: " + x.getAbsolutePath());
- System.out.println(e.getMessage());
- }
} /* method */
public static Test suite() throws Exception
{
- return getDeploySetup(HelloWorldFileActionTest.class, "Quickstart_helloworld_file_action.esb");
+ return getDeploySetup(HelloWorldFileActionTest.class, "QuickstartMessageStoreServer.sar, Quickstart_helloworld_file_action.esb");
} /* method */
} /*/class */
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldFileNotifierTest.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldFileNotifierTest.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldFileNotifierTest.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldFileNotifierTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+
+package org.jboss.soa.esb.quickstart.test;
+
+import junit.framework.Test;
+
+import org.jboss.soa.esb.samples.quickstart.helloworldfilenotifier.test.SendJMSMessage;
+
+/**
+ * CI test for the helloworldfilenotifier quickstart.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ */
+public class HelloWorldFileNotifierTest extends AbstractQuickstartTestCase {
+ private static final String JMS_MESSAGE = "HelloWorldFileNotifierTest message";
+
+ public HelloWorldFileNotifierTest(String name) {
+ super(name);
+ }
+
+ public void testMessage() throws Exception {
+ clearMessages() ;
+ sendMessage();
+ checkMessages(30000, JMS_MESSAGE) ;
+ }
+
+ public void sendMessage() throws Exception {
+ SendJMSMessage sm = new SendJMSMessage();
+ sm.setupConnection();
+ sm.sendAMessage(JMS_MESSAGE);
+ sm.stop();
+ }
+
+ public static Test suite() throws Exception {
+ return getDeploySetup(HelloWorldFileNotifierTest.class, "QuickstartMessageStoreServer.sar, Quickstart_helloworld_file_notifier.esb");
+ }
+}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldSQLActionTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldSQLActionTest.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldSQLActionTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -21,32 +21,27 @@
*/
package org.jboss.soa.esb.quickstart.test;
-import junit.framework.Test;
-
-import org.jboss.soa.esb.actions.StoreMessageToFile;
-import org.jboss.test.JBossTestCase;
-
-import java.sql.*;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.sql.Statement;
import java.util.Vector;
+import junit.framework.Test;
+
/**
- * Sample client for the jboss container.
+ * CI test for the helloworldsqlaction quickstart.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
-public class HelloWorldSQLActionTest extends JBossTestCase {
+public class HelloWorldSQLActionTest extends AbstractQuickstartTestCase {
- private static final String FILE_NAME = "HelloWorldSQLActionTest.log";
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME)
- + FILE_NAME;
- private static final int EXPECTED_RECORD_COUNT = 1;
-
-
public HelloWorldSQLActionTest(String name) {
super(name);
}
public void testMessage() throws Exception {
+ fail("Not supported yet") ;
sendMessage();
// Commented out 20070824 - ldimaggi - the log file is not
@@ -102,22 +97,21 @@
// Could not connect to the database
}
- String loggingInfo = StoreMessageToFile.MESSAGE_CONTENT_FILENAME_START + LOG_FILE + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_END;
Vector<String> theRecords = new Vector<String>();
- String tempStr = "insert into gateway_table values(0,'data 111111 " + loggingInfo + " ','p')";
+ String tempStr = "insert into gateway_table values(0,'data 111111','p')";
theRecords.add(tempStr);
- tempStr = "insert into gateway_table values(0,'data 22 " + loggingInfo + " ','p')";
+ tempStr = "insert into gateway_table values(0,'data 22','p')";
theRecords.add(tempStr);
- tempStr = "insert into gateway_table values(0,'data 333333333333111111 " + loggingInfo + " ','p')";
+ tempStr = "insert into gateway_table values(0,'data 333333333333111111','p')";
theRecords.add(tempStr);
- tempStr = "insert into gateway_table values(0,'data d d d d " + loggingInfo + " ','p')";
+ tempStr = "insert into gateway_table values(0,'data d d d d','p')";
theRecords.add(tempStr);
- tempStr = "insert into gateway_table values(0,'data data last record " + loggingInfo + " ','p')";
+ tempStr = "insert into gateway_table values(0,'data data last record','p')";
theRecords.add(tempStr);
for (int i = 0; i < theRecords.size(); i++) {
@@ -134,7 +128,7 @@
public static Test suite() throws Exception {
return getDeploySetup(HelloWorldSQLActionTest.class,
- "Quickstart_helloworld_SQL_action.esb");
+ "QuickstartMessageStoreServer.sar, Quickstart_helloworld_SQL_action.esb");
}/* method */
} /* class */
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldTest.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -21,78 +21,36 @@
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
-import java.util.Hashtable;
-
import junit.framework.Test;
-import org.jboss.soa.esb.actions.StoreMessageToFile;
import org.jboss.soa.esb.samples.quickstart.helloworld.test.SendJMSMessage;
-import org.jboss.test.JBossTestCase;
/**
- * Sample client for the jboss container.
+ * CI test for the helloworld quickstart.
*
- * @author <a href="mailto:bill at burkecentral.com">Bill Burke</a>
- * @version $Id: BlobUnitTestCase.java 58110 2006-11-04 08:34:21Z
- * scott.stark at jboss.org $
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
-
-public class HelloWorldTest extends JBossTestCase {
+public class HelloWorldTest extends AbstractQuickstartTestCase {
private static final String JMS_MESSAGE = "HelloWorldTest message";
- private static final String FILE_NAME = "HelloWorldTest.log";
-
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME)
- + FILE_NAME;
-
- private static final int EXPECTED_RECORD_COUNT = 1;
-
public HelloWorldTest(String name) {
super(name);
}
public void testMessage() throws Exception {
- final File logFile = new File(LOG_FILE) ;
- if (logFile.exists())
- {
- assertTrue("Deleting logfile", logFile.delete()) ;
- }
-
- sendMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
- /* Verify that the message file is complete */
- boolean fileComplete = Helpers.checkFileContent(LOG_FILE,
- EXPECTED_RECORD_COUNT);
- if (!fileComplete) {
- Hashtable<String, String> temp = Helpers.getMessageString(LOG_FILE);
- fail("Event file " + LOG_FILE + " not complete - expected "
- + EXPECTED_RECORD_COUNT + " records - found " + temp.size()
- + ", test marked as failing");
- }
-
- Hashtable<String, String> theTable = Helpers.getMessageString(LOG_FILE);
- String theMessage = (String) theTable.get("Message1");
- assertEquals("The strings should match", JMS_MESSAGE, theMessage);
- assertTrue("Deleting logfile", logFile.delete()) ;
+ clearMessages() ;
+ sendMessage() ;
+ checkMessages(30000, JMS_MESSAGE) ;
}
public void sendMessage() throws Exception {
SendJMSMessage sm = new SendJMSMessage();
sm.setupConnection();
- sm.sendAMessage(JMS_MESSAGE + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_START + FILE_NAME
- + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_END) ;
+ sm.sendAMessage(JMS_MESSAGE) ;
sm.stop();
}
public static Test suite() throws Exception {
- return getDeploySetup(HelloWorldTest.class, "Quickstart_helloworld.esb");
+ return getDeploySetup(HelloWorldTest.class, "QuickstartMessageStoreServer.sar, Quickstart_helloworld.esb");
}
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/Helpers.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/Helpers.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/Helpers.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -23,134 +23,26 @@
import java.io.BufferedReader;
import java.io.File;
-import java.io.FileReader;
import java.io.IOException;
import java.io.StringReader;
-import java.util.Hashtable;
-import java.util.List;
import java.util.ArrayList;
+import java.util.List;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
-import org.jboss.soa.esb.actions.StoreMessageToFile;
import org.jboss.soa.esb.quickstart.test.util.IdentitySAXHandler;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
-import junit.framework.Assert;
-
/**
* Helper class for quickstart tests
*
*/
public class Helpers {
- public static final int FILE_TIMER = 3000;
- public static final int FILE_COUNTER = 5;
- /* Read the message files into a hash */
- public static Hashtable<String, String> getMessageString(String fileName) {
- Hashtable<String,String> returnTable = new Hashtable<String,String>();
- int theCounter = 1;
- try {
- BufferedReader in = new BufferedReader(new FileReader(fileName));
- String str;
- while ((str = in.readLine()) != null) {
- final int startTag = str.indexOf(StoreMessageToFile.MESSAGE_CONTENT_FILENAME_START);
- if (startTag == -1) {
- break ;
- }
- final int endTag = str.indexOf(StoreMessageToFile.MESSAGE_CONTENT_FILENAME_END) ;
- final String returnString ;
- if (endTag > startTag) {
- final int endIndex = endTag + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_END.length() ;
- if (endIndex < str.length()-1) {
- returnString = str.substring(0, startTag) + str.substring(endIndex) ;
- } else {
- returnString = str.substring(0, startTag) ;
- }
- } else {
- returnString = str ;
- }
- returnTable.put("Message" + theCounter++, returnString);
- }
- in.close();
- } catch (IOException e) {
- Assert.fail("Cannot read file: " + fileName);
- }
- return returnTable;
- } /* method */
-
- /* Read the message files into a hash- used by HelloWorldFileActionTest */
- public static Hashtable<String, String> getFileActionMessageString(String fileName) {
- Hashtable<String,String> returnTable = new Hashtable<String,String>();
- int theCounter = 1;
- try {
- BufferedReader in = new BufferedReader(new FileReader(fileName));
- String str;
- while ((str = in.readLine()) != null) {
- returnTable.put("Message" + theCounter++, str);
- }
- in.close();
- } catch (IOException e) {
- Assert.fail("Cannot read file: " + fileName);
- }
- return returnTable;
- } /* method */
-
- /* Determine if the event file has been written */
- public static boolean checkForFile(String fileName) throws Exception {
- boolean wasFileFound = false;
- /* Look for file, if it's there, set the boolean and return, if it's
- * not, wait and try again */
- final File file = new File(fileName) ;
- for (int i = 0; i < FILE_COUNTER; i++) {
- boolean exists = file.exists();
- if (exists) {
- wasFileFound = true;
- break;
- }
- else {
- Thread.sleep(FILE_TIMER);
- }
- }
- return wasFileFound;
- } /* method */
-
- /* Determine if the event file has the correct # of entries written to it - this is probably
- * only needed for tests that write the same message to multiple queues - for example,
- * the RecipientlistTest */
- public static boolean checkFileContent(String fileName, int recordCount) throws Exception {
- boolean correctFileSize = false;
-
- /* Determine the number of records in the file, if it's not correct
- * wait and try again */
- for (int i = 0; i < FILE_COUNTER; i++) {
- Hashtable<String, String> theTable = getMessageString(fileName);
- int theKeys = theTable.size();
- if (theKeys == recordCount){
- correctFileSize = true;
- break;
- }
- else {
- Thread.sleep(FILE_TIMER);
- }
- }
- return correctFileSize;
- } /* method */
-
-
- public static String getTempDir(String filename)
- {
- String tmpDir="";
- if (!filename.startsWith(File.separator)) {
- tmpDir = System.getProperty("java.io.tmpdir") + File.separator;
- }
- return tmpDir;
- }
-
public static String getQuickstartLocation(final String location)
throws IOException
{
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/JMSTopicTest.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/JMSTopicTest.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/JMSTopicTest.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/JMSTopicTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb.quickstart.test;
+
+import junit.framework.Test;
+
+import org.jboss.soa.esb.samples.quickstart.jmstopic.SendJMSMessage;
+
+/**
+ * CI test for the jmstopic quickstart.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ */
+public class JMSTopicTest extends AbstractQuickstartTestCase {
+ private static final String JMS_MESSAGE = "JMSTopic message";
+
+ public JMSTopicTest(String name) {
+ super(name);
+ }
+
+ public void testMessage() throws Exception {
+ clearMessages() ;
+ sendMessage() ;
+ checkMessages(30000, JMS_MESSAGE, JMS_MESSAGE) ;
+ }
+
+ public void sendMessage() throws Exception {
+ SendJMSMessage sm = new SendJMSMessage();
+ sm.setupConnection();
+ sm.sendAMessage(JMS_MESSAGE);
+ sm.stop();
+ }
+
+ public static Test suite() throws Exception {
+ return getDeploySetup(JMSTopicTest.class, "QuickstartMessageStoreServer.sar, Quickstart_jms_topic.esb");
+ }
+}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/LoadGeneratorTest.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/LoadGeneratorTest.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/LoadGeneratorTest.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/LoadGeneratorTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.quickstart.test;
+
+import junit.framework.Test;
+
+/**
+ * CI test for the loadgenerator quickstart.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ */
+public class LoadGeneratorTest extends AbstractQuickstartTestCase {
+ private static final String JMS_MESSAGE = "HelloWorldTest message";
+
+ public LoadGeneratorTest(String name) {
+ super(name);
+ }
+
+ public void testMessage() throws Exception {
+ fail("Not yet implemented") ;
+ sendMessage();
+ }
+
+ public void sendMessage() throws Exception {
+ // The groovy classes below need to be compiled intot the esb
+
+ //JMSLoadAgent jmsla = new JMSLoadAgent("load_generator_classes/load.xml");
+ //jmsla.generateLoad();
+ //LoadReport reporter = new LoadReport("load_generator_classes/load.xml");
+ //reporter.generateMetrics();
+
+ }
+
+ public static Test suite() throws Exception {
+ return getDeploySetup(LoadGeneratorTest.class, "QuickstartMessageStoreServer.sar, Quickstart_load_generator.esb");
+ }
+}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/MessageFilterTest.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/MessageFilterTest.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/MessageFilterTest.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/MessageFilterTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.quickstart.test;
+
+import junit.framework.Test;
+
+import org.jboss.soa.esb.samples.quickstart.messagefilter.Order;
+import org.jboss.soa.esb.samples.quickstart.messagefilter.test.SendJMSMessage;
+
+/**
+ * CI test for the messagefilter quickstart.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ */
+public class MessageFilterTest extends AbstractQuickstartTestCase {
+ private static final String JMS_MESSAGE = "10";
+ private static final String RESULT_PATTERN = "org.jboss.soa.esb.samples.quickstart.messagefilter.Order.*";
+
+ public MessageFilterTest(String name) {
+ super(name);
+ }
+
+ public void testMessage() throws Exception {
+ clearMessages() ;
+ sendMessage() ;
+ checkPatternMessages(30000, RESULT_PATTERN) ;
+ }
+
+ public void sendMessage() throws Exception {
+ Order order = new Order();
+ order.setQuantity(Integer.valueOf(JMS_MESSAGE));
+ SendJMSMessage sm = new SendJMSMessage();
+ sm.setupConnection();
+ sm.sendAMessage(order);
+ sm.stop();
+ }
+
+ public static Test suite() throws Exception {
+ return getDeploySetup(MessageFilterTest.class, "QuickstartMessageStoreServer.sar, Quickstart_messagefilter.esb");
+ }
+}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/MessageStoreTest.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/MessageStoreTest.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/MessageStoreTest.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/MessageStoreTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.quickstart.test;
+
+import junit.framework.Test;
+
+import org.jboss.soa.esb.samples.quickstart.messagestore.test.SendJMSMessage;
+
+/**
+ * CI test for the messagestore quickstart.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ */
+public class MessageStoreTest extends AbstractQuickstartTestCase {
+ private static final String JMS_MESSAGE = "MessageStoreTest message";
+
+ public MessageStoreTest(String name) {
+ super(name);
+ }
+
+ public void testMessage() throws Exception {
+ clearMessages() ;
+ sendMessage() ;
+ checkMessages(30000, JMS_MESSAGE, "Success:" + JMS_MESSAGE) ;
+ }
+
+ public void sendMessage() throws Exception {
+ SendJMSMessage sm = new SendJMSMessage();
+ sm.setupConnection();
+ sm.sendAMessage(JMS_MESSAGE);
+ sm.stop();
+ }
+
+ public static Test suite() throws Exception {
+ return getDeploySetup(MessageStoreTest.class, "QuickstartMessageStoreServer.sar, Quickstart_messagestore.esb");
+ }
+}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/RecipientlistTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/RecipientlistTest.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/RecipientlistTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -21,29 +21,20 @@
*/
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
-import java.util.Hashtable;
import junit.framework.Test;
-import org.jboss.soa.esb.actions.StoreMessageToFile;
import org.jboss.soa.esb.samples.quickstart.recipientList.test.SendCBRJMSMessage;
import org.jboss.soa.esb.samples.quickstart.recipientList.test.SendStaticRouterJMSMessage;
-import org.jboss.test.JBossTestCase;
/**
- * Sample client for the jboss container.
+ * CI test for the recipientlist quickstart.
*
- * @author <a href="mailto:"></a>
- * @version $Id: $
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
-
-public class RecipientlistTest extends JBossTestCase {
+public class RecipientlistTest extends AbstractQuickstartTestCase {
private static final String JMS_MESSAGE = "RecipientlistTest message";
- private static final String FILE_NAME = "RecipientlistTest.log";
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME) + FILE_NAME;
private static final String JMS_CBR_MESSAGE = "<Order sampleData=\"CBR test\" testDate=\"20070518\" routeToFollow=\"both\"><Customer userName=\"user1\" firstName=\"Harry\" lastName=\"Fletcher\" state=\"SD\"/></Order>";
- private static final int EXPECTED_RECORD_COUNT = 3;
public RecipientlistTest(String name) {
super(name);
@@ -58,56 +49,27 @@
}
public void testStaticMessage() throws Exception {
- sendStaticRouterJMSMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail ("Event file " + LOG_FILE + " not created - test marked as failing");
- }
-
- /* Verify that the message file is complete */
- boolean fileComplete = Helpers.checkFileContent(LOG_FILE, EXPECTED_RECORD_COUNT);
- if (!fileComplete) {
- Hashtable<String, String> temp = Helpers.getMessageString(LOG_FILE);
- File target = new File(LOG_FILE);
- target.delete();
- fail ("Event file " + LOG_FILE + " not complete - expected " + EXPECTED_RECORD_COUNT
- + " records - found " + temp.size() + ", test marked as failing");
- }
-
- Hashtable<String, String> theTable = Helpers.getMessageString(LOG_FILE);
-
- String theMessage1 = (String) theTable.get("Message1");
- String theMessage2 = (String) theTable.get("Message2");
- String theMessage3 = (String) theTable.get("Message3");
-
- assertEquals("The strings should match1", theMessage1, JMS_MESSAGE);
- assertEquals("The strings should match2", theMessage2, JMS_MESSAGE);
- assertEquals("The strings should match3", theMessage3, JMS_MESSAGE);
-
- File target = new File(LOG_FILE);
- target.delete();
+ clearMessages() ;
+ sendStaticRouterJMSMessage() ;
+ checkMessages(30000, JMS_MESSAGE, JMS_MESSAGE, JMS_MESSAGE) ;
}
public void sendCBRJMSMessage() throws Exception {
SendCBRJMSMessage sm = new SendCBRJMSMessage();
sm.setupConnection();
- sm.sendAMessage(JMS_CBR_MESSAGE + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_START + FILE_NAME
- + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_END);
+ sm.sendAMessage(JMS_CBR_MESSAGE);
sm.stop();
}
public void sendStaticRouterJMSMessage() throws Exception {
SendStaticRouterJMSMessage sm = new SendStaticRouterJMSMessage();
sm.setupConnection();
- sm.sendAMessage(JMS_MESSAGE + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_START + FILE_NAME
- + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_END);
+ sm.sendAMessage(JMS_MESSAGE);
sm.stop();
}
public static Test suite() throws Exception {
return getDeploySetup(RecipientlistTest.class,
- "Quickstart_recipient_list.esb");
+ "QuickstartMessageStoreServer.sar, Quickstart_recipient_list.esb");
}
}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/ScheduledServicesTest.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/ScheduledServicesTest.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/ScheduledServicesTest.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/ScheduledServicesTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.quickstart.test;
+
+import junit.framework.Test;
+
+/**
+ * CI test for the scheduledservices quickstart.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ */
+public class ScheduledServicesTest extends AbstractQuickstartTestCase {
+ private static final String RESULT = "Hello Scheduled World .*";
+
+ public ScheduledServicesTest(String name) {
+ super(name);
+ }
+
+ public void testMessage() throws Exception {
+ // No clear or send on this
+ checkPatternMessages(30000, RESULT, RESULT) ;
+ }
+
+ public static Test suite() throws Exception {
+ return getDeploySetup(ScheduledServicesTest.class, "QuickstartMessageStoreServer.sar, Quickstart_scheduled_services.esb");
+ }
+}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/ScriptingGroovyTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/ScriptingGroovyTest.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/ScriptingGroovyTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -22,76 +22,37 @@
package org.jboss.soa.esb.quickstart.test;
import junit.framework.Test;
-import org.jboss.soa.esb.actions.StoreMessageToFile;
+
import org.jboss.soa.esb.samples.quickstart.scriptinggroovy.test.SendJMSMessage;
-import org.jboss.test.JBossTestCase;
-import java.io.File;
-import java.util.Hashtable;
-
/**
- * Sample client for the jboss container.
+ * CI test for the scriptinggroovy quickstart.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
-
public class ScriptingGroovyTest
- extends JBossTestCase {
+ extends AbstractQuickstartTestCase {
private static final String JMS_MESSAGE = "ScriptingGroovyTest message";
- private static final String FILE_NAME = "ScriptingGroovyTest.log";
-
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME)
- + FILE_NAME;
-
- private static final int EXPECTED_RECORD_COUNT = 1;
-
public ScriptingGroovyTest(String name) {
super(name);
}
public void testMessage() throws Exception {
- final File logFile = new File(LOG_FILE);
- if (logFile.exists()) {
- assertTrue("Deleting logfile", logFile.delete());
- }
-
+ clearMessages() ;
sendMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
- /* Verify that the message file is complete */
- boolean fileComplete = Helpers.checkFileContent(LOG_FILE,
- EXPECTED_RECORD_COUNT);
- if (!fileComplete) {
- Hashtable<String, String> temp = Helpers.getMessageString(LOG_FILE);
- fail("Event file " + LOG_FILE + " not complete - expected "
- + EXPECTED_RECORD_COUNT + " records - found " + temp.size()
- + ", test marked as failing");
- }
-
- Hashtable<String, String> theTable = Helpers.getMessageString(LOG_FILE);
- String theMessage = theTable.get("Message1");
-
- assertEquals("The strings should match", JMS_MESSAGE, theMessage);
- assertTrue("Deleting logfile", logFile.delete());
+ checkMessages(30000, JMS_MESSAGE) ;
}
public void sendMessage() throws Exception {
SendJMSMessage sm = new SendJMSMessage();
sm.setupConnection();
- sm.sendAMessage(JMS_MESSAGE + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_START + FILE_NAME
- + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_END);
+ sm.sendAMessage(JMS_MESSAGE);
sm.stop();
}
public static Test suite() throws Exception {
- return getDeploySetup(ScriptingGroovyTest.class, "scripting-groovy-quickstart.esb");
+ return getDeploySetup(ScriptingGroovyTest.class, "QuickstartMessageStoreServer.sar, scripting-groovy-quickstart.esb");
}
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SimpleCBRTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SimpleCBRTest.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SimpleCBRTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -23,34 +23,43 @@
import junit.framework.Test;
-import org.jboss.test.JBossTestCase;
+import org.jboss.soa.esb.samples.quickstart.simplecbr.test.SendJMSMessage;
/**
- * Sample client for the jboss container.
+ * CI test for the simplecbr quickstart.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ * @author <a href="mailto:ldimaggi at redhat.com">Len Dimaggio</a>
*/
public class SimpleCBRTest
- extends JBossTestCase
-{
- public SimpleCBRTest(String name)
- {
+ extends AbstractQuickstartTestCase {
+
+ private static String theXML = "<Order orderId=\"1\" "
+ + "orderDate=\"Wed Nov 15 13:45:28 EST 2006\" "
+ + "statusCode=\"0\" " + "netAmount=\"59.97\" "
+ + "totalAmount=\"64.92\" " + "tax=\"4.95\" "
+ + "junk=\"SimpleCBRTest message\"></Order>";
+
+ public SimpleCBRTest(String name) {
super(name);
- }
+ } /* method */
- public void testMessage() throws Exception
- {
- sendMessage();
- Thread.sleep(10000); // wait for message to post.
- }
+ public void testMessage() throws Exception {
+ clearMessages() ;
+ sendMessage() ;
+ checkMessages(30000, theXML) ;
+ } /* method */
- public void sendMessage() throws Exception
- {
- }
+ public void sendMessage() throws Exception {
+ SendJMSMessage sm = new SendJMSMessage();
+ sm.setupConnection();
+ sm.sendAMessage(theXML);
+ sm.stop();
+ } /* method */
- public static Test suite() throws Exception
- {
- return getDeploySetup(SimpleCBRTest.class, "Quickstart_simple_cbr.esb");
- }
-}
+ public static Test suite() throws Exception {
+ return getDeploySetup(SimpleCBRTest.class, "QuickstartMessageStoreServer.sar, Quickstart_simple_cbr.esb");
+ } /* method */
+
+} /* class */
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SpringAOPTest.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SpringAOPTest.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SpringAOPTest.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SpringAOPTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+
+package org.jboss.soa.esb.quickstart.test;
+
+import junit.framework.Test;
+
+import org.jboss.soa.esb.samples.quickstart.spring_aop.test.SendJMSMessage;
+
+/**
+ * CI test for the springAOP quickstart.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ */
+
+public class SpringAOPTest extends AbstractQuickstartTestCase {
+ private static final String JMS_MESSAGE = "SpringAOPTest message";
+ private static final String RESULT_MESSAGE = "I used AOP to change the greeting! JMS has got nothin on me!";
+
+ public SpringAOPTest(String name) {
+ super(name);
+ }
+
+ public void testMessage() throws Exception {
+ clearMessages() ;
+ sendMessage() ;
+ checkMessages(30000, RESULT_MESSAGE) ;
+ }
+
+ public void sendMessage() throws Exception {
+ SendJMSMessage sm = new SendJMSMessage();
+ sm.setupConnection();
+ sm.sendAMessage(JMS_MESSAGE) ;
+ sm.stop();
+ }
+
+ public static Test suite() throws Exception {
+ return getDeploySetup(SpringAOPTest.class, "QuickstartMessageStoreServer.sar, Quickstart_spring_aop.esb");
+ }
+}
+
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SpringHelloWorldTest.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SpringHelloWorldTest.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SpringHelloWorldTest.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SpringHelloWorldTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+
+package org.jboss.soa.esb.quickstart.test;
+
+import junit.framework.Test;
+
+import org.jboss.soa.esb.samples.quickstart.spring_helloworld.test.SendJMSMessage;
+
+/**
+ * CI test for the SpringHelloWorld quickstart.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ */
+
+public class SpringHelloWorldTest extends AbstractQuickstartTestCase {
+ private static final String JMS_MESSAGE = "SpringHelloWorldTest message";
+ private static final String RESULT_MESSAGE = "SpringHelloWorldTest message\nhello from Spring\ngoodbye from Spring\nhello from Spring\ngoodbye from Spring";
+
+ public SpringHelloWorldTest(String name) {
+ super(name);
+ }
+
+ public void testMessage() throws Exception {
+ clearMessages() ;
+ sendMessage() ;
+ checkMessages(30000, RESULT_MESSAGE) ;
+ }
+
+ public void sendMessage() throws Exception {
+ SendJMSMessage sm = new SendJMSMessage();
+ sm.setupConnection();
+ sm.sendAMessage(JMS_MESSAGE) ;
+ sm.stop();
+ }
+
+ public static Test suite() throws Exception {
+ return getDeploySetup(SpringHelloWorldTest.class, "QuickstartMessageStoreServer.sar, spring_helloworld.esb");
+ }
+}
+
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SpringJPetStoreTest.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SpringJPetStoreTest.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SpringJPetStoreTest.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SpringJPetStoreTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,65 @@
+
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+
+package org.jboss.soa.esb.quickstart.test;
+
+import java.io.File;
+
+import junit.framework.Test;
+
+import org.jboss.soa.esb.samples.quickstart.spring_jpetstore.test.SendJMSMessage;
+import org.jboss.soa.esb.util.FileUtil;
+
+/**
+ * CI test for the SpringJPetStore quickstart.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ */
+
+public class SpringJPetStoreTest extends AbstractQuickstartTestCase {
+ private static final String JMS_MESSAGE = "SpringJPetStoreTest message";
+
+ public SpringJPetStoreTest(String name) {
+ super(name);
+ }
+
+ public void testMessage() throws Exception {
+ clearMessages() ;
+ sendMessage() ;
+ checkMessages(30000, JMS_MESSAGE) ;
+ }
+
+ public void sendMessage() throws Exception {
+ SendJMSMessage sm = new SendJMSMessage();
+ sm.setupConnection();
+ String orderFile = Helpers.getQuickstartLocation("spring_jpetstore/sample-order.xml");
+ File target = new File(orderFile);
+ String targetString = FileUtil.readTextFile(target);
+ sm.sendAMessage(targetString);
+ sm.stop();
+ }
+
+ public static Test suite() throws Exception {
+ return getDeploySetup(SpringJPetStoreTest.class, "QuickstartMessageStoreServer.sar, spring_jpetstore.esb");
+ }
+}
+
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/StaticRouterTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/StaticRouterTest.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/StaticRouterTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -23,16 +23,14 @@
import junit.framework.Test;
-import org.jboss.test.JBossTestCase;
-
/**
* Sample client for the jboss container.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
public class StaticRouterTest
- extends JBossTestCase
+ extends AbstractQuickstartTestCase
{
public StaticRouterTest(String name)
{
@@ -41,6 +39,7 @@
public void testMessage() throws Exception
{
+ fail("Not yet implemented") ;
sendMessage();
Thread.sleep(10000); // wait for message to post.
}
@@ -51,6 +50,6 @@
public static Test suite() throws Exception
{
- return getDeploySetup(StaticRouterTest.class, "Quickstart_static_router.esb");
+ return getDeploySetup(StaticRouterTest.class, "QuickstartMessageStoreServer.sar, Quickstart_static_router.esb");
}
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformCSV2XMLTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformCSV2XMLTest.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformCSV2XMLTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -21,25 +21,21 @@
*/
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
import java.io.InputStream;
import junit.framework.Test;
-import org.jboss.test.JBossTestCase;
import org.jboss.soa.esb.samples.quickstart.transformcsv2xml.SendJMSMessage;
import org.jboss.soa.esb.testutils.FileUtil;
/**
- * Sample client for the jboss container.
+ * CI test for the transformCSV2XML quickstart.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
public class TransformCSV2XMLTest
- extends JBossTestCase {
+ extends AbstractQuickstartTestCase {
private static final String FILE_NAME = "transformedmessageCSV2XML.log";
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME)
- + FILE_NAME;
public TransformCSV2XMLTest(String name)
@@ -49,30 +45,22 @@
public void testMessage() throws Exception
{
- final File logFile = new File(LOG_FILE) ;
- if (logFile.exists())
- {
- assertTrue("Deleting logfile", logFile.delete()) ;
- }
-
- sendMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
+ clearMessages() ;
+ sendMessage() ;
+ final String[] messages = waitForMessages(1, 30000) ;
// Make sure the file matches expected output
final InputStream is = getClass().getClassLoader().getResourceAsStream(FILE_NAME) ;
- File target = new File(LOG_FILE);
- String targetString = FileUtil.readTextFile(target);
- String expectedString = FileUtil.readStream(is);
- final boolean match = Helpers.compareXMLContent(expectedString, targetString) ;
- assertTrue("Unexpected response: " + targetString, match) ;
-
- assertTrue("Deleting logfile", logFile.delete()) ;
+ final String expectedString ;
+ try
+ {
+ expectedString = FileUtil.readStream(is);
+ }
+ finally
+ {
+ is.close() ;
+ }
+ final boolean match = Helpers.compareXMLContent(expectedString, messages[0]) ;
+ assertTrue("Unexpected response: " + messages[0], match) ;
}
public void sendMessage() throws Exception
@@ -85,6 +73,6 @@
public static Test suite() throws Exception
{
- return getDeploySetup(TransformCSV2XMLTest.class, "transformation-CSV2XML-quickstart.esb");
+ return getDeploySetup(TransformCSV2XMLTest.class, "QuickstartMessageStoreServer.sar, transformation-CSV2XML-quickstart.esb");
}
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformDateManipulationTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformDateManipulationTest.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformDateManipulationTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -21,27 +21,23 @@
*/
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
import java.io.InputStream;
import junit.framework.Test;
import org.jboss.soa.esb.samples.quickstart.transformxml2xmldatemanipulation.test.SendJMSMessage;
import org.jboss.soa.esb.testutils.FileUtil;
-import org.jboss.test.JBossTestCase;
/**
- * Sample client for the jboss container.
+ * CI test for the transformdatemanipulation quickstart.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
public class TransformDateManipulationTest
- extends JBossTestCase
+ extends AbstractQuickstartTestCase
{
private static final String FILE_NAME = "transformedmessageDateManipulation.log";
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME)
- + FILE_NAME;
public TransformDateManipulationTest(String name)
{
@@ -50,30 +46,22 @@
public void testMessage() throws Exception
{
- final File logFile = new File(LOG_FILE) ;
- if (logFile.exists())
- {
- assertTrue("Deleting logfile", logFile.delete()) ;
- }
-
- sendMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
+ clearMessages() ;
+ sendMessage() ;
+ final String[] messages = waitForMessages(1, 30000) ;
// Make sure the file matches expected output
final InputStream is = getClass().getClassLoader().getResourceAsStream(FILE_NAME) ;
- File target = new File(LOG_FILE);
- String targetString = FileUtil.readTextFile(target);
- String expectedString = FileUtil.readStream(is);
- final boolean match = Helpers.compareXMLContent(expectedString, targetString) ;
- assertTrue("Unexpected response: " + targetString, match) ;
-
- assertTrue("Deleting logfile", logFile.delete()) ;
+ final String expectedString ;
+ try
+ {
+ expectedString = FileUtil.readStream(is);
+ }
+ finally
+ {
+ is.close() ;
+ }
+ final boolean match = Helpers.compareXMLContent(expectedString, messages[0]) ;
+ assertTrue("Unexpected response: " + messages[0], match) ;
}
public void sendMessage() throws Exception
@@ -86,6 +74,6 @@
public static Test suite() throws Exception
{
- return getDeploySetup(TransformDateManipulationTest.class, "transformation-date-manipulation-quickstart.esb");
+ return getDeploySetup(TransformDateManipulationTest.class, "QuickstartMessageStoreServer.sar, transformation-date-manipulation-quickstart.esb");
}
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformEDI2XMLGroovyXSLTTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformEDI2XMLGroovyXSLTTest.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformEDI2XMLGroovyXSLTTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -21,29 +21,24 @@
*/
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
import java.io.InputStream;
import junit.framework.Test;
import org.jboss.soa.esb.samples.quickstart.transformedi2xmlgroovyxslt.test.SendJMSMessage;
import org.jboss.soa.esb.testutils.FileUtil;
-import org.jboss.test.JBossTestCase;
/**
- * Sample client for the jboss container.
+ * CI test for the transformEDI2XMLGroovyXSLT quickstart.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
public class TransformEDI2XMLGroovyXSLTTest
- extends JBossTestCase
+ extends AbstractQuickstartTestCase
{
private static final String FILE_NAME = "transformedmessageEDI2XMLGroovyXSL.log";
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME)
- + FILE_NAME;
-
public TransformEDI2XMLGroovyXSLTTest(String name)
{
super(name);
@@ -51,42 +46,36 @@
public void testMessage() throws Exception
{
- final File logFile = new File(LOG_FILE) ;
- if (logFile.exists())
- {
- assertTrue("Deleting logfile", logFile.delete()) ;
- }
-
- sendMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
+ clearMessages() ;
+ sendMessage() ;
+ // For some reason the smooks action is taking a long time
+ // on Windows, 45 seconds in one instance
+ final String[] messages = waitForMessages(1, 60000) ;
// Make sure the file matches expected output
final InputStream is = getClass().getClassLoader().getResourceAsStream(FILE_NAME) ;
- File target = new File(LOG_FILE);
- String targetString = FileUtil.readTextFile(target);
- String expectedString = FileUtil.readStream(is);
- final boolean match = Helpers.compareXMLContent(expectedString, targetString) ;
- assertTrue("Unexpected response: " + targetString, match) ;
-
- assertTrue("Deleting logfile", logFile.delete()) ;
+ final String expectedString ;
+ try
+ {
+ expectedString = FileUtil.readStream(is);
+ }
+ finally
+ {
+ is.close() ;
+ }
+ final boolean match = Helpers.compareXMLContent(expectedString, messages[0]) ;
+ assertTrue("Unexpected response: " + messages[0], match) ;
}
public void sendMessage() throws Exception
{
SendJMSMessage sm = new SendJMSMessage();
- sm.setupConnection();
- sm.sendAMessage(Helpers.getQuickstartLocation("transform_EDI2XML_Groovy_XSLT/SampleOrder.edi"));
- sm.stop();
+ sm.setupConnection();
+ sm.sendAMessage(Helpers.getQuickstartLocation("transform_EDI2XML_Groovy_XSLT/SampleOrder.edi"));
+ sm.stop();
}
public static Test suite() throws Exception
{
- return getDeploySetup(TransformEDI2XMLGroovyXSLTTest.class, "transformation-edi2xml_groovy-quickstart.esb");
+ return getDeploySetup(TransformEDI2XMLGroovyXSLTTest.class, "QuickstartMessageStoreServer.sar, transformation-edi2xml_groovy-quickstart.esb");
}
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformXML2PojoTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformXML2PojoTest.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformXML2PojoTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -1,27 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
import java.io.InputStream;
import junit.framework.Test;
import org.jboss.soa.esb.samples.quickstart.transformxml2pojo.test.SendJMSMessage;
import org.jboss.soa.esb.testutils.FileUtil;
-import org.jboss.test.JBossTestCase;
/**
- * Sample client for the jboss container.
+ * CI test for the transformXML2POJO quickstart.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
public class TransformXML2PojoTest
- extends JBossTestCase
+ extends AbstractQuickstartTestCase
{
private static final String FILE_NAME = "transformedmessageXML2POJO.log";
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME)
- + FILE_NAME;
-
public TransformXML2PojoTest(String name)
{
@@ -30,30 +45,22 @@
public void testMessage() throws Exception
{
- final File logFile = new File(LOG_FILE) ;
- if (logFile.exists())
+ clearMessages() ;
+ sendMessage() ;
+ final String[] messages = waitForMessages(1, 30000) ;
+ // Make sure the file matches expected output
+ final InputStream is = getClass().getClassLoader().getResourceAsStream(FILE_NAME) ;
+ final String expectedString ;
+ try
{
- assertTrue("Deleting logfile", logFile.delete()) ;
+ expectedString = FileUtil.readStream(is);
}
-
- sendMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
- // Make sure the file matches expected output
- final InputStream is = getClass().getClassLoader().getResourceAsStream(FILE_NAME) ;
- File target = new File(LOG_FILE);
- String targetString = FileUtil.readTextFile(target);
- String expectedString = FileUtil.readStream(is);
- final boolean match = Helpers.compareNonXMLContent(expectedString, targetString, true);
- assertTrue("Unexpected response: " + targetString, match) ;
-
- assertTrue("Deleting logfile", logFile.delete()) ;
+ finally
+ {
+ is.close() ;
+ }
+ final boolean match = Helpers.compareNonXMLContent(expectedString, messages[0], true);
+ assertTrue("Unexpected response: " + messages[0], match) ;
}
public void sendMessage() throws Exception
@@ -68,6 +75,6 @@
public static Test suite() throws Exception
{
- return getDeploySetup(TransformXML2PojoTest.class, "transformation-pojo-quickstart.esb");
+ return getDeploySetup(TransformXML2PojoTest.class, "QuickstartMessageStoreServer.sar, transformation-pojo-quickstart.esb");
}
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformXMLSimpleTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformXMLSimpleTest.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformXMLSimpleTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -21,26 +21,22 @@
*/
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
import java.io.InputStream;
import junit.framework.Test;
-import org.jboss.soa.esb.testutils.FileUtil;
-import org.jboss.test.JBossTestCase;
import org.jboss.soa.esb.samples.quickstart.transformxml2xmlsimple.test.SendJMSMessage;
+import org.jboss.soa.esb.testutils.FileUtil;
/**
- * Sample client for the jboss container.
+ * CI test for the transformXMLSimple quickstart.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
public class TransformXMLSimpleTest
- extends JBossTestCase
+ extends AbstractQuickstartTestCase
{
private static final String FILE_NAME = "transformedmessageXML2Simple.log";
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME)
- + FILE_NAME;
public TransformXMLSimpleTest(String name)
{
@@ -49,30 +45,22 @@
public void testMessage() throws Exception
{
- final File logFile = new File(LOG_FILE) ;
- if (logFile.exists())
- {
- assertTrue("Deleting logfile", logFile.delete()) ;
- }
-
- sendMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
+ clearMessages() ;
+ sendMessage() ;
+ final String[] messages = waitForMessages(1, 30000) ;
// Make sure the file matches expected output
final InputStream is = getClass().getClassLoader().getResourceAsStream(FILE_NAME) ;
- File target = new File(LOG_FILE);
- String targetString = FileUtil.readTextFile(target);
- String expectedString = FileUtil.readStream(is);
- final boolean match = Helpers.compareXMLContent(expectedString, targetString) ;
- assertTrue("Unexpected response: " + targetString, match) ;
-
- assertTrue("Deleting logfile", logFile.delete()) ;
+ final String expectedString ;
+ try
+ {
+ expectedString = FileUtil.readStream(is);
+ }
+ finally
+ {
+ is.close() ;
+ }
+ final boolean match = Helpers.compareXMLContent(expectedString, messages[0]) ;
+ assertTrue("Unexpected response: " + messages[0], match) ;
}
public void sendMessage() throws Exception
@@ -85,6 +73,6 @@
public static Test suite() throws Exception
{
- return getDeploySetup(TransformXMLSimpleTest.class, "transformation-simple-quickstart.esb");
+ return getDeploySetup(TransformXMLSimpleTest.class, "QuickstartMessageStoreServer.sar, transformation-simple-quickstart.esb");
}
}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebServiceConsumer1Test.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebServiceConsumer1Test.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebServiceConsumer1Test.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebServiceConsumer1Test.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb.quickstart.test;
+
+import junit.framework.Test;
+
+import org.jboss.soa.esb.samples.quickstart.webservice_consumer1.test.SendJMSMessage;
+
+/**
+ * CI test for the webservice_consumer1 quickstart.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ */
+public class WebServiceConsumer1Test extends AbstractQuickstartTestCase {
+ private static final String JMS_MESSAGE = "WebServiceConsumer1Test message";
+
+ public WebServiceConsumer1Test(String name) {
+ super(name);
+ }
+
+ public void testMessage() throws Exception {
+ clearMessages() ;
+ sendMessage() ;
+ checkMessages(30000, JMS_MESSAGE) ;
+ }
+
+ public void sendMessage() throws Exception {
+ SendJMSMessage sm = new SendJMSMessage();
+ sm.sendAMessage("Jimbo");
+ sm.stop();
+ }
+
+ public static Test suite() throws Exception {
+ return getDeploySetup(WebServiceConsumer1Test.class, "QuickstartMessageStoreServer.sar, Quickstart_webservice_consumer1.esb");
+ }
+}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebServiceConsumer2Test.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebServiceConsumer2Test.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebServiceConsumer2Test.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebServiceConsumer2Test.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb.quickstart.test;
+
+import junit.framework.Test;
+
+import org.jboss.soa.esb.samples.quickstart.helloworld.test.SendJMSMessage;
+
+/**
+ * CI test for the webservice_consumer2 quickstart.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ */
+public class WebServiceConsumer2Test extends AbstractQuickstartTestCase {
+ private static final String JMS_MESSAGE = "WebServiceConsumer2Test message";
+
+ public WebServiceConsumer2Test(String name) {
+ super(name);
+ }
+
+ public void testMessage() throws Exception {
+ clearMessages() ;
+ sendMessage() ;
+ checkMessages(30000, JMS_MESSAGE) ;
+ }
+
+ public void sendMessage() throws Exception {
+ SendJMSMessage sm = new SendJMSMessage();
+ sm.setupConnection();
+ sm.sendAMessage(JMS_MESSAGE);
+ sm.stop();
+ }
+
+ public static Test suite() throws Exception {
+ return getDeploySetup(WebServiceConsumer2Test.class, "QuickstartMessageStoreServer.sar, Quickstart_webservice_consumer2.esb");
+ }
+}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebServiceProducerTest.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebServiceProducerTest.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebServiceProducerTest.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebServiceProducerTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,39 @@
+package org.jboss.soa.esb.quickstart.test;
+
+import java.io.File;
+
+import junit.framework.Test;
+
+import org.jboss.soa.esb.samples.quickstart.webserviceproducer.test.SendMessage;
+import org.jboss.soa.esb.testutils.FileUtil;
+
+/**
+ * CI test for the webservice_producer quickstart.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ */
+public class WebServiceProducerTest extends AbstractQuickstartTestCase {
+ private static final String JMS_MESSAGE = "WebServiceProducerTest message";
+
+ public WebServiceProducerTest(String name) {
+ super(name);
+ }
+
+ public void testMessage() throws Exception {
+ clearMessages() ;
+ sendMessage() ;
+ checkMessages(30000, JMS_MESSAGE) ;
+ }
+
+ public void sendMessage() throws Exception {
+ SendMessage sm = new SendMessage();
+ String location = Helpers.getQuickstartLocation("webservice_producer/src/org/jboss/soa/esb/samples/quickstart/webserviceproducer/test/soap_message_01.xml");
+ File file = new File(location);
+ String targetString = FileUtil.readTextFile(file);
+ sm.sendMessageOverJMS(targetString);
+ }
+
+ public static Test suite() throws Exception {
+ return getDeploySetup(WebServiceProducerTest.class, "QuickstartMessageStoreServer.sar, Quickstart_webservice_producer.esb");
+ }
+}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebserviceAdapterTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebserviceAdapterTest.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebserviceAdapterTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -23,16 +23,14 @@
import junit.framework.Test;
-import org.jboss.test.JBossTestCase;
-
/**
* Sample client for the jboss container.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
public class WebserviceAdapterTest
- extends JBossTestCase
+ extends AbstractQuickstartTestCase
{
public WebserviceAdapterTest(String name)
{
@@ -41,6 +39,7 @@
public void testMessage() throws Exception
{
+ fail("Not yet implemented") ;
sendMessage();
Thread.sleep(10000); // wait for message to post.
}
@@ -51,6 +50,6 @@
public static Test suite() throws Exception
{
- return getDeploySetup(WebserviceAdapterTest.class, "transformation-simple-quickstart.esb");
+ return getDeploySetup(WebserviceAdapterTest.class, "QuickstartMessageStoreServer.sar, transformation-simple-quickstart.esb");
}
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebserviceBPELTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebserviceBPELTest.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebserviceBPELTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -23,16 +23,14 @@
import junit.framework.Test;
-import org.jboss.test.JBossTestCase;
-
/**
* Sample client for the jboss container.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
public class WebserviceBPELTest
- extends JBossTestCase
+ extends AbstractQuickstartTestCase
{
public WebserviceBPELTest(String name)
{
@@ -41,6 +39,7 @@
public void testMessage() throws Exception
{
+ fail("Not yet implemented") ;
sendMessage();
Thread.sleep(10000); // wait for message to post.
}
@@ -51,6 +50,6 @@
public static Test suite() throws Exception
{
- return getDeploySetup(WebserviceBPELTest.class, "transformation-simple-quickstart.esb");
+ return getDeploySetup(WebserviceBPELTest.class, "QuickstartMessageStoreServer.sar, transformation-simple-quickstart.esb");
}
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WiretapTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WiretapTest.java 2007-11-30 13:49:56 UTC (rev 16944)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WiretapTest.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -21,14 +21,9 @@
*/
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
-import java.util.Hashtable;
-
import junit.framework.Test;
-import org.jboss.soa.esb.actions.StoreMessageToFile;
import org.jboss.soa.esb.samples.quickstart.wiretap.test.SendStaticRouterJMSMessage;
-import org.jboss.test.JBossTestCase;
/**
* Sample client for the jboss container.
@@ -37,59 +32,28 @@
* @version $Id: $
*/
-public class WiretapTest extends JBossTestCase {
+public class WiretapTest extends AbstractQuickstartTestCase {
private static final String JMS_MESSAGE = "Wiretap Message";
- private static final String FILE_NAME = "Wiretap.log";
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME) + FILE_NAME;
- private static final int EXPECTED_RECORD_COUNT = 2;
public WiretapTest(String name) {
super(name);
} /* method */
public void testStaticRouterMessage() throws Exception {
- final File logFile = new File(LOG_FILE) ;
- if (logFile.exists())
- {
- assertTrue("Deleting logfile", logFile.delete()) ;
- }
-
- sendStaticRouterJMSMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail ("Event file " + LOG_FILE + " not created - test marked as failing");
- }
-
- /* Verify that the message file is complete */
- boolean fileComplete = Helpers.checkFileContent(LOG_FILE, EXPECTED_RECORD_COUNT);
- if (!fileComplete) {
- Hashtable<String, String> temp = Helpers.getMessageString(LOG_FILE);
- fail ("Event file " + LOG_FILE + " not complete - expected " + EXPECTED_RECORD_COUNT
- + " records - found " + temp.size() + ", test marked as failing");
- }
-
- Hashtable<String, String> theTable = Helpers.getMessageString(LOG_FILE);
-
- String theMessage1 = (String) theTable.get("Message1");
- String theMessage2 = (String) theTable.get("Message2");
-
- assertEquals("The strings1 should match", theMessage1, JMS_MESSAGE);
- assertEquals("The strings2 should match", theMessage2, JMS_MESSAGE);
-
- assertTrue("Deleting logfile", logFile.delete()) ;
+ clearMessages() ;
+ sendStaticRouterJMSMessage() ;
+ checkMessages(30000, JMS_MESSAGE, JMS_MESSAGE) ;
} /* method */
public void sendStaticRouterJMSMessage() throws Exception {
SendStaticRouterJMSMessage sm = new SendStaticRouterJMSMessage();
sm.setupConnection();
- sm.sendAMessage(JMS_MESSAGE + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_START + FILE_NAME + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_END);
+ sm.sendAMessage(JMS_MESSAGE);
sm.stop();
} /* method */
public static Test suite() throws Exception {
- return getDeploySetup(WiretapTest.class, "Quickstart_wiretap.esb");
+ return getDeploySetup(WiretapTest.class, "QuickstartMessageStoreServer.sar, Quickstart_wiretap.esb");
} /* method */
} /* class */
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/server/QuickstartMessageStore.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/qa/quickstarts/src/org/jboss/soa/esb/server/QuickstartMessageStore.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/server/QuickstartMessageStore.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/server/QuickstartMessageStore.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,34 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.soa.esb.server;
+
+/**
+ * Interface to monitor message flow in quickstart tests.
+ *
+ * @author <a href="kevin.conner at jboss.com">Kevin Conner</a>
+ */
+public interface QuickstartMessageStore
+{
+ public String[] waitForMessages(final int numberOfMessages, final long maxDelay) ;
+
+ public void clearMessages() ;
+}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/server/QuickstartMessageStoreImpl.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/qa/quickstarts/src/org/jboss/soa/esb/server/QuickstartMessageStoreImpl.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/server/QuickstartMessageStoreImpl.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/server/QuickstartMessageStoreImpl.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,62 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.soa.esb.server;
+
+import org.jboss.soa.esb.actions.TestMessageStore;
+import org.jboss.soa.esb.actions.TestMessageStoreSink;
+import org.jboss.system.ServiceMBeanSupport;
+
+/**
+ * MBean to monitor message flow in quickstart tests.
+ *
+ * @author <a href="kevin.conner at jboss.com">Kevin Conner</a>
+ */
+public class QuickstartMessageStoreImpl extends ServiceMBeanSupport implements QuickstartMessageStoreImplMBean
+{
+ private TestMessageStoreSink sink = new TestMessageStoreSink() ;
+
+ @Override
+ protected void startService() throws Exception
+ {
+ System.out.println("Starting service " + QuickstartMessageStoreImplMBean.objectName) ;
+ super.startService();
+ TestMessageStore.setMessageStoreSink(sink) ;
+ }
+
+ @Override
+ protected void stopService() throws Exception
+ {
+ System.out.println("Stopping service " + QuickstartMessageStoreImplMBean.objectName) ;
+ TestMessageStore.setMessageStoreSink(null) ;
+ super.stopService();
+ }
+
+ public String[] waitForMessages(final int numberOfMessages, final long maxDelay)
+ {
+ return sink.waitForMessages(numberOfMessages, maxDelay) ;
+ }
+
+ public void clearMessages()
+ {
+ sink.clearMessages() ;
+ }
+}
Copied: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/server/QuickstartMessageStoreImplMBean.java (from rev 16944, labs/jbossesb/tags/JBESB_4_2_1_GA_CP_IR3/qa/quickstarts/src/org/jboss/soa/esb/server/QuickstartMessageStoreImplMBean.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/server/QuickstartMessageStoreImplMBean.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/server/QuickstartMessageStoreImplMBean.java 2007-11-30 15:43:56 UTC (rev 16945)
@@ -0,0 +1,34 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.soa.esb.server;
+
+import org.jboss.system.ServiceMBean;
+
+/**
+ * MBean to monitor message flow in quickstart tests.
+ *
+ * @author <a href="kevin.conner at jboss.com">Kevin Conner</a>
+ */
+public interface QuickstartMessageStoreImplMBean extends ServiceMBean, QuickstartMessageStore
+{
+ public static final String objectName = "jboss.esb:test=QuickstartMessageStoreServer";
+}
More information about the jboss-svn-commits
mailing list