diff options
3 files changed, 10 insertions, 1 deletions
diff --git a/otest/newlayout/tuscany-jms-test-runner/src/test/resources/tuscany-oasis-sca-tests-errors.properties b/otest/newlayout/tuscany-jms-test-runner/src/test/resources/tuscany-oasis-sca-tests-errors.properties index 37ddeadf4c..e9af0a323e 100644 --- a/otest/newlayout/tuscany-jms-test-runner/src/test/resources/tuscany-oasis-sca-tests-errors.properties +++ b/otest/newlayout/tuscany-jms-test-runner/src/test/resources/tuscany-oasis-sca-tests-errors.properties @@ -23,7 +23,7 @@ BJM_3015Dc=org.apache.tuscany.sca.binding.jms.JMSBindingException: JMS Destinati BJM_3015Da=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BJM_3015Da, Artifact: Test_BJM_3015Da.composite] - Must specify jndiName attribute when create mode is "never"
BJM_3017=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BJM_3017, Artifact: Test_BJM_3017.composite] - XMLSchema validation error occured in: Test_BJM_3017.composite ,line = 36, column = 17, Message = cvc-complex-type.2.4.a: Invalid content was found starting with element 'activationSpec'. One of '{"http://docs.oasis-open.org/ns/opencsa/sca/200912":response, "http://docs.oasis-open.org/ns/opencsa/sca/200912":headers, "http://docs.oasis-open.org/ns/opencsa/sca/200912":messageSelection, "http://docs.oasis-open.org/ns/opencsa/sca/200912":resourceAdapter, "http://docs.oasis-open.org/ns/opencsa/sca/200912":operationProperties, "http://docs.oasis-open.org/ns/opencsa/sca/200912":extensions}' is expected.
BJM_3018=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BJM_3018, Artifact: Test_BJM_3018.composite] - When connection factory "TEST_BJM_3018_CF" element is present then a destination name must also be defined
-BJM_3019=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BJM_3019, Artifact: Test_BJM_3019.composite] - XMLSchema validation error occured in: Test_BJM_3019.composite ,line = 38, column = 17, Message = cvc-complex-type.2.4.a: Invalid content was found starting with element 'destination'. One of '{"http://docs.oasis-open.org/ns/opencsa/sca/200912":response, "http://docs.oasis-open.org/ns/opencsa/sca/200912":headers, "http://docs.oasis-open.org/ns/opencsa/sca/200912":messageSelection, "http://docs.oasis-open.org/ns/opencsa/sca/200912":resourceAdapter, "http://docs.oasis-open.org/ns/opencsa/sca/200912":operationProperties}' is expected.
+BJM_3019=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BJM_3019, Artifact: Test_BJM_3019.composite] - Activation spec name TEST_BJM_3019_AS must match destination name TEST_BJM_3019_Queue_XXX
BJM_3020=*testClient.TestException_Exception: unknown
BJM_3021=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BJM_3021, Artifact: Test_BJM_3021.composite] - XMLSchema validation error occured in: Test_BJM_3021.composite ,line = 44, column = 21, Message = cvc-complex-type.2.4.d: Invalid content was found starting with element 'activationSpec'. No child element is expected at this point.
BJM_3022=*testClient.TestException_Exception: unknown
diff --git a/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessor.java b/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessor.java index 8ddcd6a099..dfb3dd9412 100644 --- a/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessor.java +++ b/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessor.java @@ -987,6 +987,14 @@ public class JMSBindingProcessor extends BaseStAXArtifactProcessor implements St error(monitor, "ConnectionFactoryActivationSpecContradiction", jmsBinding, connectionFactoryName, activationSpecName ); } } + + // If activation spec and destination are both specified, they have to match + if ( ( jmsBinding.getActivationSpecName() != null ) && (jmsBinding.getActivationSpecName().length() > 0 ) && + (jmsBinding.getDestinationName() != null) && (jmsBinding.getDestinationName().length() > 0 ) ) { + if ( !jmsBinding.getActivationSpecName().equals(jmsBinding.getDestinationName())) { + error(monitor, "ActivationSpecAndDestinationMismatch", jmsBinding, jmsBinding.getActivationSpecName(), jmsBinding.getDestinationName()); + } + } // If Connection factory specified then destination name must also be if (( connectionFactoryName != null ) && ( connectionFactoryName.length() > 0 )) { diff --git a/sca-java-2.x/trunk/modules/binding-jms/src/main/resources/binding-jms-validation-messages.properties b/sca-java-2.x/trunk/modules/binding-jms/src/main/resources/binding-jms-validation-messages.properties index 147290b862..91b24bb1a2 100644 --- a/sca-java-2.x/trunk/modules/binding-jms/src/main/resources/binding-jms-validation-messages.properties +++ b/sca-java-2.x/trunk/modules/binding-jms/src/main/resources/binding-jms-validation-messages.properties @@ -55,3 +55,4 @@ ResponseWireformatAlreadyDefined = The response wireformat has already been defi MissingNameForCREATE_NEVER = Must specify jndiName attribute when create mode is "never" MissingNameForCREATE_IF_NOT_EXIST = Must specify jndiName attribute when create mode is "ifNotExist" InvalidCreate = Attribute create {0} invalid, must be 'always', 'never', or 'ifNotExist' +ActivationSpecAndDestinationMismatch = Activation spec name {0} must match destination name {1} |