diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2009-09-21 16:00:10 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2009-09-21 16:00:10 +0000 |
commit | 2f3c1011e6029fa969c584709454063498c6d8d7 (patch) | |
tree | 294dde28d06f04fa97e81a717d4c85a361299c5e | |
parent | 1b07be8965648f2c5afc9637375b53e762e2450b (diff) |
Check for a few null cases that happen in assembly-xml unit tests. I don't think we should be testing the builders in assembly-xml.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@817304 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentBuilderImpl.java | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentBuilderImpl.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentBuilderImpl.java index 09e9d95724..760d5b7885 100644 --- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentBuilderImpl.java +++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentBuilderImpl.java @@ -187,7 +187,13 @@ public class ComponentBuilderImpl { // configuration based on OASIS rules for (ComponentService componentService : component.getServices()) { Service componentTypeService = componentService.getService(); - + + if (componentTypeService == null){ + // raise error? + // can be null in some of the assembly-xml unit tests + continue; + } + // interface contracts calculateInterfaceContract(componentService, componentTypeService); @@ -233,7 +239,13 @@ public class ComponentBuilderImpl { // configuration based on OASIS rules for (ComponentReference componentReference : component.getReferences()) { Reference componentTypeReference = componentReference.getReference(); - + + if (componentTypeReference == null){ + // raise error? + // can be null in some of the assembly-xml unit tests + continue; + } + // reference multiplicity reconcileReferenceMultiplicity(component, componentReference, @@ -385,6 +397,11 @@ public class ComponentBuilderImpl { continue; } + if (component.getImplementation() == null){ + // is null in some of our basic unit tests + continue; + } + Service service = component.getImplementation().getService(componentService.getName()); if (service != null) { @@ -408,6 +425,11 @@ public class ComponentBuilderImpl { continue; } + if (component.getImplementation() == null){ + // is null in some of our basic unit tests + continue; + } + Reference reference = component.getImplementation().getReference(componentReference.getName()); if (reference != null) { |