From 2cdbb96daaf9855fa07e7bd51bd72a756dd8a6fc Mon Sep 17 00:00:00 2001 From: slaws Date: Fri, 9 Oct 2009 13:39:33 +0000 Subject: 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 --- .../sca/assembly/builder/assembly-validation-messages.properties | 3 ++- .../org/apache/tuscany/sca/builder/impl/ComponentBuilderImpl.java | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'java/sca/modules') 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, -- cgit v1.2.3