You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by sl...@apache.org on 2009/09/21 18:00:10 UTC

svn commit: r817304 - /tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentBuilderImpl.java

Author: slaws
Date: Mon Sep 21 16:00:10 2009
New Revision: 817304

URL: http://svn.apache.org/viewvc?rev=817304&view=rev
Log:
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.

Modified:
    tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentBuilderImpl.java

Modified: tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentBuilderImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentBuilderImpl.java?rev=817304&r1=817303&r2=817304&view=diff
==============================================================================
--- tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentBuilderImpl.java (original)
+++ tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentBuilderImpl.java Mon Sep 21 16:00:10 2009
@@ -187,7 +187,13 @@
         // 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 @@
         // 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 @@
                 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 @@
                 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) {