summaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorramkumar <ramkumar@13f79535-47bb-0310-9956-ffa450edef68>2009-08-27 10:34:14 +0000
committerramkumar <ramkumar@13f79535-47bb-0310-9956-ffa450edef68>2009-08-27 10:34:14 +0000
commit7e638d75169c353993547709aeae52c3d262465b (patch)
treec109e4fa210ed98decbc56ab7f399960afb452aa /java
parentc752d35eb674b65b5e8bc3729c80f829a18fb66b (diff)
Fixes to generate proper exception for ASM_6029 and ASM_6030 otests
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@808356 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java')
-rw-r--r--java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java14
-rw-r--r--java/sca/modules/assembly-xml/src/main/resources/assembly-xml-validation-messages.properties1
2 files changed, 13 insertions, 2 deletions
diff --git a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java
index b20a788027..8c7b4117f4 100644
--- a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java
+++ b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java
@@ -948,8 +948,18 @@ public class CompositeProcessor extends BaseAssemblyProcessor implements StAXArt
for (int i = 0, n = composite.getIncludes().size(); i < n; i++) {
Composite include = composite.getIncludes().get(i);
if (include != null) {
- include = resolver.resolveModel(Composite.class, include);
- composite.getIncludes().set(i, include);
+ Composite resolved = resolver.resolveModel(Composite.class, include);
+ if (!resolved.isUnresolved()) {
+ if ((composite.isLocal() && resolved.isLocal()) || (!composite.isLocal() && !resolved.isLocal())) {
+ composite.getIncludes().set(i, resolved);
+ } else {
+ ContributionResolveException ce = new ContributionResolveException("Error: Composite "+ composite.getName() +" can only include another composite with the identical @local attribute value");
+ error("ContributionResolveException", include, ce);
+ }
+ } else {
+ ContributionResolveException ce = new ContributionResolveException("Error: Composite "+ include.getName() +" is not a valid composite within the domain");
+ error("ContributionResolveException", include, ce);
+ }
}
}
diff --git a/java/sca/modules/assembly-xml/src/main/resources/assembly-xml-validation-messages.properties b/java/sca/modules/assembly-xml/src/main/resources/assembly-xml-validation-messages.properties
index 5a633ff22e..fe29a3be28 100644
--- a/java/sca/modules/assembly-xml/src/main/resources/assembly-xml-validation-messages.properties
+++ b/java/sca/modules/assembly-xml/src/main/resources/assembly-xml-validation-messages.properties
@@ -25,6 +25,7 @@ UnexpectedImplementationElement = Unexpected <implementation> element found. It
PolicyImplValidationException = PolicyValidation exception when processing implementation of component {0} due to {1}.
PolicyServiceValidationException = PolicyValidation exceptions when processing service/reference {0} in {1}. Error is {2}
ContributionReadException = ContributionReadException occured due to : {0}
+ContributionResolveException = ContributionResolveException occured due to : {0}
ContributionWriteException = ContributionWriteException occured due to : {0}
XMLStreamException = XMLStreamException occured due to : {0}
DuplicateCompositeName = [ASM_6001] More than one composite with the same name {0} found in contribution {1}