tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject svn commit: r450848 - in /incubator/tuscany/java/sca/services/bindings/binding.rmi/src: main/java/org/apache/tuscany/binding/rmi/RMIService.java test/java/org/apache/tuscany/binding/rmi/BindingTestCase.java
Date Thu, 28 Sep 2006 13:23:06 GMT
Author: antelder
Date: Thu Sep 28 06:23:05 2006
New Revision: 450848

URL: http://svn.apache.org/viewvc?view=rev&rev=450848
Log:
Apply RMI fix from Venkat till his access is sortted out

Modified:
    incubator/tuscany/java/sca/services/bindings/binding.rmi/src/main/java/org/apache/tuscany/binding/rmi/RMIService.java
    incubator/tuscany/java/sca/services/bindings/binding.rmi/src/test/java/org/apache/tuscany/binding/rmi/BindingTestCase.java

Modified: incubator/tuscany/java/sca/services/bindings/binding.rmi/src/main/java/org/apache/tuscany/binding/rmi/RMIService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/bindings/binding.rmi/src/main/java/org/apache/tuscany/binding/rmi/RMIService.java?view=diff&rev=450848&r1=450847&r2=450848
==============================================================================
--- incubator/tuscany/java/sca/services/bindings/binding.rmi/src/main/java/org/apache/tuscany/binding/rmi/RMIService.java
(original)
+++ incubator/tuscany/java/sca/services/bindings/binding.rmi/src/main/java/org/apache/tuscany/binding/rmi/RMIService.java
Thu Sep 28 06:23:05 2006
@@ -97,7 +97,7 @@
         enhancer.setCallback(new RemoteMethodHandler(getHandler(), interfaze));
 
         if (!Remote.class.isAssignableFrom(serviceInterface)) {
-            RMIServiceClassLoader classloader = new RMIServiceClassLoader();
+            RMIServiceClassLoader classloader = new RMIServiceClassLoader(Thread.currentThread().getContextClassLoader());
             final byte[] byteCode = generateRemoteInterface(serviceInterface);
             serviceInterface = classloader.defineClass(byteCode);
             enhancer.setClassLoader(classloader);
@@ -149,6 +149,9 @@
     }
 
     private class RMIServiceClassLoader extends ClassLoader {
+        public RMIServiceClassLoader(ClassLoader parent) {
+            super(parent);
+        }
         public Class defineClass(byte[] byteArray) {
             return defineClass(null, byteArray, 0, byteArray.length);
         }

Modified: incubator/tuscany/java/sca/services/bindings/binding.rmi/src/test/java/org/apache/tuscany/binding/rmi/BindingTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/bindings/binding.rmi/src/test/java/org/apache/tuscany/binding/rmi/BindingTestCase.java?view=diff&rev=450848&r1=450847&r2=450848
==============================================================================
--- incubator/tuscany/java/sca/services/bindings/binding.rmi/src/test/java/org/apache/tuscany/binding/rmi/BindingTestCase.java
(original)
+++ incubator/tuscany/java/sca/services/bindings/binding.rmi/src/test/java/org/apache/tuscany/binding/rmi/BindingTestCase.java
Thu Sep 28 06:23:05 2006
@@ -1,37 +1,33 @@
 package org.apache.tuscany.binding.rmi;
 
 import helloworld.HelloWorldRmiService;
-import helloworld.HelloWorldService;
 
 import org.apache.tuscany.test.SCATestCase;
 import org.osoa.sca.CompositeContext;
 import org.osoa.sca.CurrentCompositeContext;
 
 public class BindingTestCase extends SCATestCase {
-    private HelloWorldService helloWorldService;
     private HelloWorldRmiService helloWorldRmiService;
 
     public void testRmiService() {
-        //System.out.println(helloWorldRmiService.sayRmiHello("Tuscany World!"));
+        assertEquals("Hello from the RMI Service to - Tuscany World! thro the RMI Reference",
+                helloWorldRmiService.sayRmiHello("Tuscany World!"));
     }
 
     protected void setUp() throws Exception {
-        //addExtension("rmi.binding",
-        //             getClass().getClassLoader().getResource("META-INF/sca/rmi_extension.scdl"));
+        addExtension("rmi.binding",
+                     getClass().getClassLoader().getResource("META-INF/sca/rmi_extension.scdl"));
 
-        //super.setUp();
-        //System.out.println("Hit Enter");
-        //System.in.read();
-
-        //CompositeContext context = CurrentCompositeContext.getContext();
-        //helloWorldRmiService = context.locateService(HelloWorldRmiService.class,
-        //                                             "HelloWorldRmiServiceComponent");
+        super.setUp();
 
+        CompositeContext context = CurrentCompositeContext.getContext();
+        helloWorldRmiService = context.locateService(HelloWorldRmiService.class,
+                                                     "HelloWorldRmiServiceComponent");
     }
 
 
     protected void tearDown() throws Exception {
-        //super.tearDown();
+        super.tearDown();
     }
 
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org


Mime
View raw message