summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentBuilderImpl.java26
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) {