summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-08-18 17:04:59 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-08-18 17:04:59 +0000
commit286e08fe4d7d7ca853e1384e18bdbfbeb84d2cd3 (patch)
tree763bf5e36a8ae2660091d51f0e5f8ef26f823af2
parentfd9e2c5c3d1e8112c129190082340ed728cda996 (diff)
Fix for ASM_4008
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@805498 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--java/sca/modules/assembly-xml/pom.xml2
-rw-r--r--java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/BaseAssemblyProcessor.java8
-rw-r--r--java/sca/modules/assembly/META-INF/MANIFEST.MF4
-rw-r--r--java/sca/modules/assembly/pom.xml7
-rw-r--r--java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/PropertyConfigurationUtil.java12
-rw-r--r--java/sca/modules/assembly/src/main/resources/assembly-validation-messages.properties2
6 files changed, 14 insertions, 21 deletions
diff --git a/java/sca/modules/assembly-xml/pom.xml b/java/sca/modules/assembly-xml/pom.xml
index dbefaf7292..adab44d15b 100644
--- a/java/sca/modules/assembly-xml/pom.xml
+++ b/java/sca/modules/assembly-xml/pom.xml
@@ -99,7 +99,7 @@
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-assembly-xsd</artifactId>
<version>2.0-SNAPSHOT</version>
- <scope>test</scope>
+ <scope>runtime</scope>
</dependency>
</dependencies>
diff --git a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/BaseAssemblyProcessor.java b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/BaseAssemblyProcessor.java
index 32ea875e90..bab3b94ba4 100644
--- a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/BaseAssemblyProcessor.java
+++ b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/BaseAssemblyProcessor.java
@@ -606,9 +606,11 @@ abstract class BaseAssemblyProcessor extends BaseStAXArtifactProcessor {
if (root.getChildNodes().getLength() == 0) {
// Add an text as an <value>
if (isTextForProperty){
- Element valueElement = document.createElementNS(SCA11_NS, VALUE);
- root.appendChild(valueElement);
- valueElement.setTextContent(text.toString());
+ if (text.length() > 0) {
+ Element valueElement = document.createElementNS(SCA11_NS, VALUE);
+ root.appendChild(valueElement);
+ valueElement.setTextContent(text.toString());
+ }
}
}
return document;
diff --git a/java/sca/modules/assembly/META-INF/MANIFEST.MF b/java/sca/modules/assembly/META-INF/MANIFEST.MF
index 51a858cda1..544337cd89 100644
--- a/java/sca/modules/assembly/META-INF/MANIFEST.MF
+++ b/java/sca/modules/assembly/META-INF/MANIFEST.MF
@@ -36,13 +36,11 @@ Import-Package: javax.xml.namespace,
org.apache.tuscany.sca.assembly;version="2.0.0",
org.apache.tuscany.sca.assembly.builder;version="2.0.0",
org.apache.tuscany.sca.assembly.impl;version="2.0.0",
- org.apache.tuscany.sca.assembly.xsd;version="2.0.0",
org.apache.tuscany.sca.core;version="2.0.0",
org.apache.tuscany.sca.definitions;version="2.0.0",
org.apache.tuscany.sca.extensibility;version="2.0.0",
org.apache.tuscany.sca.interfacedef;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.impl;version="2.0.0";
- resolution:=optional,
+ org.apache.tuscany.sca.interfacedef.impl;version="2.0.0";resolution:=optional,
org.apache.tuscany.sca.monitor;version="2.0.0",
org.apache.tuscany.sca.policy;version="2.0.0",
org.apache.tuscany.sca.policy.util;version="2.0.0",
diff --git a/java/sca/modules/assembly/pom.xml b/java/sca/modules/assembly/pom.xml
index c351aa698d..5e9fc08eec 100644
--- a/java/sca/modules/assembly/pom.xml
+++ b/java/sca/modules/assembly/pom.xml
@@ -29,12 +29,7 @@
<name>Apache Tuscany SCA Assembly Model</name>
<dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xsd</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
+
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-policy</artifactId>
diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/PropertyConfigurationUtil.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/PropertyConfigurationUtil.java
index abbcf5591d..b9da3301ea 100644
--- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/PropertyConfigurationUtil.java
+++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/PropertyConfigurationUtil.java
@@ -18,6 +18,8 @@
*/
package org.apache.tuscany.sca.assembly.builder.impl;
+import static org.apache.tuscany.sca.assembly.Base.SCA11_NS;
+
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
@@ -52,10 +54,6 @@ import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.xml.sax.InputSource;
-import static org.apache.tuscany.sca.assembly.xsd.Constants.PROPERTY;
-import static org.apache.tuscany.sca.assembly.xsd.Constants.SCA11_NS;
-import static org.apache.tuscany.sca.assembly.xsd.Constants.VALUE;
-
/**
* Utility class to deal with processing of component properties that are taking values from the parent
* composite's properties or an external file.
@@ -92,14 +90,14 @@ abstract class PropertyConfigurationUtil {
return (Document)result;
} else {
Document document = documentBuilderFactory.newDocumentBuilder().newDocument();
- Element newProperty = document.createElementNS(SCA11_NS, PROPERTY);
+ Element newProperty = document.createElementNS(SCA11_NS, "property");
- if( VALUE.equals(result.getLocalName()) ) {
+ if( "value".equals(result.getLocalName()) ) {
// If the result is a <value/> element, use it directly in the result
newProperty.appendChild(document.importNode(result, true));
} else {
// If the result is not a <value/> element, create a <value/> element to contain the result
- Element newValue = document.createElementNS(SCA11_NS, VALUE);
+ Element newValue = document.createElementNS(SCA11_NS, "value");
newValue.appendChild(document.importNode(result, true));
newProperty.appendChild(newValue);
} // end if
diff --git a/java/sca/modules/assembly/src/main/resources/assembly-validation-messages.properties b/java/sca/modules/assembly/src/main/resources/assembly-validation-messages.properties
index b4e987df02..d5915393f7 100644
--- a/java/sca/modules/assembly/src/main/resources/assembly-validation-messages.properties
+++ b/java/sca/modules/assembly/src/main/resources/assembly-validation-messages.properties
@@ -30,7 +30,7 @@ DuplicateImplementationServiceName = Duplicate service name: Component = {0} Ser
DuplicateImplementationReferenceName = Duplicate reference name: Component = {0} Reference = {1}
PropertyNotFound = Property not found for component property: Component = {0} Property = {1}
PropertyMustSupplyIncompatible = Component property mustSupply attribute incompatible with property: Component = {0} Property = {1}
-PropertyMustSupplyNull = No value configured on a mustSupply property: Component = {0} Property = {1}
+PropertyMustSupplyNull = [ASM_4008] No value configured on a mustSupply property: Component = {0} Property = {1}
PropertyOverrideManyAttribute = Component property many attribute incompatible with property: Component = {0} Property = {1}
ReferenceNotFound = Reference not found for component reference: Component = {0} Reference = {1}
ReferenceIncompatibleMultiplicity = Component reference multiplicity incompatible with reference multiplicity: Component = {0} Reference = {1}