You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by jm...@apache.org on 2006/05/05 01:07:54 UTC

svn commit: r399879 - in /incubator/tuscany/java/sca/core/src: main/java/org/apache/tuscany/core/config/impl/ main/java/org/apache/tuscany/core/context/ main/java/org/apache/tuscany/core/context/impl/ test/java/org/apache/tuscany/core/context/ test/jav...

Author: jmarino
Date: Thu May  4 16:07:53 2006
New Revision: 399879

URL: http://svn.apache.org/viewcvs?rev=399879&view=rev
Log:
fix for TUSCANY-169

Modified:
    incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/config/impl/Java5ComponentTypeIntrospector.java
    incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/ServiceNotFoundException.java
    incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/impl/CompositeContextImpl.java
    incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/context/CompositeHierarchyTestCase.java
    incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/runtime/RuntimeContextImplTestCase.java

Modified: incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/config/impl/Java5ComponentTypeIntrospector.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/config/impl/Java5ComponentTypeIntrospector.java?rev=399879&r1=399878&r2=399879&view=diff
==============================================================================
--- incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/config/impl/Java5ComponentTypeIntrospector.java (original)
+++ incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/config/impl/Java5ComponentTypeIntrospector.java Thu May  4 16:07:53 2006
@@ -56,7 +56,6 @@
 
     @Autowire
     public void setFactory(SystemAssemblyFactory factory) {
-        System.out.println("setting "+factory);
         this.factory = factory;
         //FIXME JFM HACK
         List<ImplementationProcessor> processors = ProcessorUtils.createCoreProcessors(factory);
@@ -71,7 +70,6 @@
 
     @Init(eager = true)
     public void init(){
-        System.out.println("Eager init"+name);
     }
 
     public void registerProcessor(ImplementationProcessor processor) {

Modified: incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/ServiceNotFoundException.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/ServiceNotFoundException.java?rev=399879&r1=399878&r2=399879&view=diff
==============================================================================
--- incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/ServiceNotFoundException.java (original)
+++ incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/ServiceNotFoundException.java Thu May  4 16:07:53 2006
@@ -13,14 +13,14 @@
  */
 package org.apache.tuscany.core.context;
 
-import org.osoa.sca.ServiceUnavailableException;
+import org.osoa.sca.ServiceRuntimeException;
 
 /**
  * Denotes the specific case where a service was not found at runtime
- * 
+ *
  * @version $Rev$ $Date$
  */
-public class ServiceNotFoundException extends ServiceUnavailableException {
+public class ServiceNotFoundException extends ServiceRuntimeException {
 
     public ServiceNotFoundException() {
         super();

Modified: incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/impl/CompositeContextImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/impl/CompositeContextImpl.java?rev=399879&r1=399878&r2=399879&view=diff
==============================================================================
--- incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/impl/CompositeContextImpl.java (original)
+++ incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/impl/CompositeContextImpl.java Thu May  4 16:07:53 2006
@@ -20,6 +20,7 @@
 import org.osoa.sca.RequestContext;
 import org.osoa.sca.ServiceReference;
 import org.osoa.sca.ServiceUnavailableException;
+import org.osoa.sca.ServiceRuntimeException;
 
 import org.apache.tuscany.core.context.AutowireContext;
 import org.apache.tuscany.core.context.CompositeContext;
@@ -88,12 +89,12 @@
         try {
             Object o = ctx.getInstance(qName);
             if (o == null) {
-                throw new ServiceUnavailableException(qualifiedName);
+                throw new ServiceNotFoundException(qualifiedName);
             }
             return o;
         } catch (TargetException e) {
             e.addContextName(getName());
-            throw new ServiceUnavailableException(e);
+            throw new ServiceNotFoundException(e);
         }
     }
 

Modified: incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/context/CompositeHierarchyTestCase.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/context/CompositeHierarchyTestCase.java?rev=399879&r1=399878&r2=399879&view=diff
==============================================================================
--- incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/context/CompositeHierarchyTestCase.java (original)
+++ incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/context/CompositeHierarchyTestCase.java Thu May  4 16:07:53 2006
@@ -30,6 +30,7 @@
 import org.apache.tuscany.model.assembly.impl.AssemblyContextImpl;
 import org.osoa.sca.ModuleContext;
 import org.osoa.sca.ServiceUnavailableException;
+import org.osoa.sca.ServiceRuntimeException;
 
 import java.util.List;
 
@@ -59,7 +60,7 @@
             ((ModuleContext) parent).locateService("test.child/TestService1");
             fail("Expected " + ServiceUnavailableException.class.getName()
                     + " since [test.child/TestService1] is not an entry point");
-        } catch (ServiceUnavailableException e) {
+        } catch (ServiceRuntimeException e) {
             // should throw an exception since it is not an entry point
         }
 

Modified: incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/runtime/RuntimeContextImplTestCase.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/runtime/RuntimeContextImplTestCase.java?rev=399879&r1=399878&r2=399879&view=diff
==============================================================================
--- incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/runtime/RuntimeContextImplTestCase.java (original)
+++ incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/runtime/RuntimeContextImplTestCase.java Thu May  4 16:07:53 2006
@@ -15,16 +15,15 @@
 
 import junit.framework.Assert;
 import junit.framework.TestCase;
-import org.osoa.sca.ServiceUnavailableException;
-
-import org.apache.tuscany.common.monitor.impl.NullMonitorFactory;
 import org.apache.tuscany.common.monitor.MonitorFactory;
+import org.apache.tuscany.common.monitor.impl.NullMonitorFactory;
 import org.apache.tuscany.core.builder.ContextFactoryBuilder;
 import org.apache.tuscany.core.builder.ContextFactoryBuilderRegistry;
 import org.apache.tuscany.core.client.BootstrapHelper;
 import org.apache.tuscany.core.config.ConfigurationException;
 import org.apache.tuscany.core.context.CompositeContext;
 import org.apache.tuscany.core.context.Lifecycle;
+import org.apache.tuscany.core.context.ServiceNotFoundException;
 import org.apache.tuscany.core.context.event.ModuleStart;
 import org.apache.tuscany.core.context.event.ModuleStop;
 import org.apache.tuscany.core.context.impl.CompositeContextImpl;
@@ -43,7 +42,7 @@
 
 /**
  * Performs basic tests on the runtime context
- * 
+ *
  * @version $Rev$ $Date$
  */
 public class RuntimeContextImplTestCase extends TestCase {
@@ -57,8 +56,8 @@
     private RuntimeContext runtime;
 
     /**
-     * Tests explicit wiring of an external service to a system entry point that is wired to a child system module entry
-     * point
+     * Tests explicit wiring of an external service to a system entry point that is wired to a child system
+     * module entry point
      */
     public void testSystemExplicitWiring() throws Exception {
         CompositeContext root = runtime.getRootContext();
@@ -139,8 +138,8 @@
         moduleContext.publish(new ModuleStart(this));
         try {
             moduleContext.locateService("TestService");
-            fail("Expected " + ServiceUnavailableException.class.getName());
-        } catch (ServiceUnavailableException e) {
+            fail("Expected " + ServiceNotFoundException.class.getName());
+        } catch (ServiceNotFoundException e) {
             // expected
         }
         moduleContext.publish(new ModuleStop(this));
@@ -161,8 +160,8 @@
         moduleContext.publish(new ModuleStart(this));
         try {
             moduleContext.locateService("TestServiceES");
-            fail("Expected " + ServiceUnavailableException.class.getName());
-        } catch (ServiceUnavailableException e) {
+            fail("Expected " + ServiceNotFoundException.class.getName());
+        } catch (ServiceNotFoundException e) {
             // expected
         }
         moduleContext.publish(new ModuleStop(this));
@@ -184,8 +183,8 @@
         moduleContext.publish(new ModuleStart(this));
         try {
             moduleContext.locateService("TestServiceEP");
-            fail("Expected " + ServiceUnavailableException.class.getName());
-        } catch (ServiceUnavailableException e) {
+            fail("Expected " + ServiceNotFoundException.class.getName());
+        } catch (ServiceNotFoundException e) {
             // expected
         }
         moduleContext.publish(new ModuleStop(this));
@@ -225,8 +224,8 @@
     }
 
     /**
-     * Tests that a circular reference between an external service in one module and an entry point in another is caught
-     * as an error condition FIXME this must be implemented
+     * Tests that a circular reference between an external service in one module and an entry point in another
+     * is caught as an error condition FIXME this must be implemented
      */
     public void testInterModuleCircularReference() throws Exception {
         // create a test modules