summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2009-10-09 13:39:33 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2009-10-09 13:39:33 +0000
commit2cdbb96daaf9855fa07e7bd51bd72a756dd8a6fc (patch)
tree0ce3653496182f687ce7a0792bb3d84e148558b6
parent24e45a6f5fd47b94646276534f0377f1399ab3bb (diff)
Add warning when XPath expression for property doesn't return anything
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@823549 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--java/sca/modules/assembly/src/main/resources/org/apache/tuscany/sca/assembly/builder/assembly-validation-messages.properties3
-rw-r--r--java/sca/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/ComponentBuilderImpl.java8
2 files changed, 10 insertions, 1 deletions
diff --git a/java/sca/modules/assembly/src/main/resources/org/apache/tuscany/sca/assembly/builder/assembly-validation-messages.properties b/java/sca/modules/assembly/src/main/resources/org/apache/tuscany/sca/assembly/builder/assembly-validation-messages.properties
index c8ad3d9201..80bf4955f0 100644
--- a/java/sca/modules/assembly/src/main/resources/org/apache/tuscany/sca/assembly/builder/assembly-validation-messages.properties
+++ b/java/sca/modules/assembly/src/main/resources/org/apache/tuscany/sca/assembly/builder/assembly-validation-messages.properties
@@ -69,4 +69,5 @@ PropertySourceXPathInvalid = The property file {0} for property {1} in component
PolicyRelatedException = Policy Related Exception occured due to : {0}
IntentNotFound = Intent {0} is not defined in SCA definitions
PolicySetNotFound = PolicySet {0} is not defined in SCA definitions
-MutuallyExclusiveIntents = Intent {0} and {1} are mutually exclusive [POL40009] \ No newline at end of file
+MutuallyExclusiveIntents = [POL40009] Intent {0} and {1} are mutually exclusive
+PropertyXpathExpressionReturnedNull = The property XPath expression for component {0} property {1} expression {2} did not match anything in the source property \ No newline at end of file
diff --git a/java/sca/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/ComponentBuilderImpl.java b/java/sca/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/ComponentBuilderImpl.java
index f1048540ba..8ba5e98f68 100644
--- a/java/sca/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/ComponentBuilderImpl.java
+++ b/java/sca/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/ComponentBuilderImpl.java
@@ -65,6 +65,7 @@ import org.apache.tuscany.sca.monitor.MonitorFactory;
import org.apache.tuscany.sca.policy.ExtensionType;
import org.apache.tuscany.sca.policy.PolicySubject;
import org.w3c.dom.Document;
+import org.w3c.dom.DocumentFragment;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.xml.sax.InputSource;
@@ -644,6 +645,13 @@ public class ComponentBuilderImpl {
if (node != null) {
componentProperty.setValue(node);
+ } else {
+ Monitor.warning(monitor,
+ this,
+ Messages.ASSEMBLY_VALIDATION,
+ "PropertyXpathExpressionReturnedNull",
+ component.getName(),
+ componentProperty.getName());
}
} catch (Exception ex) {
Monitor.error(monitor,