From a4056aa210a2474b88ca9fc064182bea0b00bbe0 Mon Sep 17 00:00:00 2001 From: bdaniel Date: Wed, 8 Sep 2010 16:35:01 +0000 Subject: BJM_3034 Fix validation check. The previous fix causes some other tests to fail since the destination name field will be set from the URI git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@995123 13f79535-47bb-0310-9956-ffa450edef68 --- .../main/java/org/apache/tuscany/sca/binding/jms/JMSBinding.java | 9 +++++++++ .../org/apache/tuscany/sca/binding/jms/JMSBindingProcessor.java | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) 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 fcd022dfea..bac262ce60 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 @@ -161,6 +161,7 @@ public class JMSBinding implements Binding, PolicySubject, OperationsConfigurato private final Integer defaultPriority = Integer.valueOf(4); private final Boolean defaultDeliveryMode = true; private final Long defaultJMSTimeToLive =Long.valueOf(0); + private boolean isDestinationSpecified = false; public JMSBinding() { super(); @@ -1068,5 +1069,13 @@ public class JMSBinding implements Binding, PolicySubject, OperationsConfigurato public Integer getDefaultJMSPriority() { return this.defaultPriority; } + + public void setIsDestinationSpecified(boolean b) { + this.isDestinationSpecified = b; + } + + public boolean isDestinationSpecified() { + return this.isDestinationSpecified ; + } } 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 9d98d33216..51bf974bd9 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 @@ -425,6 +425,7 @@ public class JMSBindingProcessor extends BaseStAXArtifactProcessor implements St } private void parseDestination(XMLStreamReader reader, JMSBinding jmsBinding, Monitor monitor) throws XMLStreamException { + jmsBinding.setIsDestinationSpecified(true); String name = getURIString(reader, "jndiName"); if (name != null && name.length() > 0) { jmsBinding.setDestinationName(name); @@ -993,7 +994,7 @@ 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)) { + (jmsBinding.isDestinationSpecified())) { error(monitor, "DestinationURIContradiction", jmsBinding, jmsBinding.getJMSURI(), jmsBinding.getDestinationName()); } -- cgit v1.2.3