summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbdaniel <bdaniel@13f79535-47bb-0310-9956-ffa450edef68>2010-09-08 15:59:10 +0000
committerbdaniel <bdaniel@13f79535-47bb-0310-9956-ffa450edef68>2010-09-08 15:59:10 +0000
commit67c6737195b9e096f426aa0acb203d142dae2c37 (patch)
treeb47bf2a659563494d0682232b3423b56a1245a15
parente513a8fb1a7360f56e788318d8e5521a4ac40a6d (diff)
BJM_3034 Add validation to check that a destination is not present when a uri is specified
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@995109 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--otest/newlayout/tuscany-jms-test-runner/src/test/resources/tuscany-oasis-sca-tests-errors.properties2
-rw-r--r--sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessor.java6
-rw-r--r--sca-java-2.x/trunk/modules/binding-jms/src/main/resources/binding-jms-validation-messages.properties1
3 files changed, 8 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 278b3ff15a..89683dc967 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
@@ -35,7 +35,7 @@ BJM_3021=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BJM_3021, Art
BJM_3022=*testClient.TestException_Exception: unknown
BJM_3023=org.apache.tuscany.sca.runtime.ActivationException: org.apache.tuscany.sca.runtime.ActivationException: org.apache.tuscany.sca.binding.jms.JMSBindingException: [BJM30023] response/activationSpec element MUST NOT be present when the binding is being used for an SCA service
BJM_3029=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BJM_3029, Artifact: Test_BJM_3029.composite] - XMLSchema validation error occured in: Test_BJM_3029.composite ,line = 37, column = 17, Message = cvc-complex-type.3.2.2: Attribute 'selectedOperation' is not allowed to appear in element 'operationProperties'.
-BJM_3034=*com.sun.xml.ws.client.ClientTransportException: HTTP transport error: java.net.ConnectException: Connection refused: connect
+BJM_3034=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BJM_3034, Artifact: Test_BJM_3034.composite] - Destination TEST_BJM_3034_Queue can not be specified when URI jms:jndi:TEST_BJM_3034_Queue is present
BJM_3036=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BJM_3036, Artifact: Test_BJM_3036.composite] - XMLSchema validation error occured in: Test_BJM_3036.composite ,line = 26, column = 13, Message = cvc-complex-type.3.2.2: Attribute 'invalidAttribute' is not allowed to appear in element 'binding.jms'
BJM_3037A=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BJM_3037A, Artifact: Test_BJM_3037A.composite] - A JNDI name must be specified when an ActivationSpec has a create mode of "always"
BJM_3037C=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BJM_3037C, Artifact: Test_BJM_3037C.composite] - Missing ConnectionFactory Name
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 b01f1b7e76..9d98d33216 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
@@ -991,6 +991,12 @@ public class JMSBindingProcessor extends BaseStAXArtifactProcessor implements St
}
}
+ // If URI is specified, destination should not be present
+ if ( ( jmsBinding.getJMSURI() != null ) && ( jmsBinding.getJMSURI().length() > 0) &&
+ (jmsBinding.getDestinationName() != null) && (jmsBinding.getDestinationName().length() > 0)) {
+ error(monitor, "DestinationURIContradiction", jmsBinding, jmsBinding.getJMSURI(), jmsBinding.getDestinationName());
+ }
+
// 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 ) ) {
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 73d7705927..527a7471c1 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
@@ -44,6 +44,7 @@ InvalidOPJMSDeliveryMode = Invalid OPJMSDeliveryMode: {0}
InvalidOPJMSPriority = Invalid OPJMSPriority: {0}
DestinationQueueContradiction = Destination type queue contradicts connection factory name: {0}
DestinationTopicContradiction = Destination type topic contradicts connection factory name: {0}
+DestinationURIContradiction = Destination {1} can not be specified when URI {0} is present
ConnectionFactoryActivationSpecContradiction = Connection factory \"{0}\" and activation specification \"{0}\" are mutually exclusive
ConnectionFactoryDestinationContradiction = When connection factory \"{0}\" element is present then a destination name must also be defined
ResponseAttrElement = Response connection \"{0}\" and response element \"{1}\" are mutually exclusive