summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-10-05 15:01:49 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-10-05 15:01:49 +0000
commitf1066798d7017fb1b86d674ee14e927194918108 (patch)
tree0fa81601bb2a8171b317c0722cd28166c5d4dc16
parent73737fd137fc65e1217cb148b217ff7507eb30d0 (diff)
Validate bjm30029
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1004661 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBinding.java4
-rw-r--r--sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessor.java8
-rw-r--r--sca-java-2.x/trunk/modules/binding-jms/src/main/resources/binding-jms-validation-messages.properties1
3 files changed, 13 insertions, 0 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBinding.java b/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBinding.java
index cb957cc35c..4539ad2ac7 100644
--- a/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBinding.java
+++ b/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBinding.java
@@ -659,6 +659,10 @@ public class JMSBinding implements Binding, PolicySubject, OperationsConfigurato
public void setNativeOperationName(String opName, String nativeOpName) {
this.nativeOperationNames .put(opName, nativeOpName);
}
+
+ public Map<String, String> getNativeOperationNames() {
+ return nativeOperationNames;
+ }
public String getOperationJMSType(String opName) {
if (operationPropertiesBinding != null && operationPropertiesBinding.getOperationJMSType(opName) != null) {
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 c86f9a7f18..5cbfbefdb1 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
@@ -23,6 +23,7 @@ import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -1039,6 +1040,13 @@ public class JMSBindingProcessor extends BaseStAXArtifactProcessor implements St
}
}
+ // [BJM30029] The value of the operationProperties/@selectedOperation attribute MUST be unique across the containing binding.jms element
+ Set<String> ops = new HashSet<String>(jmsBinding.getNativeOperationNames().values());
+ if (ops.size() != jmsBinding.getNativeOperationNames().values().size()) {
+ error(monitor, "BJM30029", jmsBinding);
+ }
+
+
// Other jmsBinding model validation may be added here.
}
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 527a7471c1..6fe55f1c0f 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
@@ -58,3 +58,4 @@ MissingNameForCREATE_IF_NOT_EXIST = Must specify jndiName attribute when create
InvalidCreate = Attribute create {0} invalid, must be 'always', 'never', or 'ifNotExist'
ActivationSpecAndDestinationMismatch = Activation spec name {0} must match destination name {1}
ActivationSpecNameRequiredForCreateAlways = A JNDI name must be specified when an ActivationSpec has a create mode of "always"
+BJM30029 = the selectedOperation attribute MUST be unique across the containing binding.jms element