tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edward...@apache.org
Subject svn commit: r544398 - in /incubator/tuscany/sandbox/implementation-spring2/src/test: java/org/apache/tuscany/implementation/spring/itests/helloworld/ java/org/apache/tuscany/implementation/spring/itests/mock/ resources/META-INF/sca/
Date Tue, 05 Jun 2007 06:11:43 GMT
Author: edwardsmj
Date: Mon Jun  4 23:11:42 2007
New Revision: 544398

URL: http://svn.apache.org/viewvc?view=rev&rev=544398
Log:
First working version of Spring implementation - services supported, but not references

Added:
    incubator/tuscany/sandbox/implementation-spring2/src/test/java/org/apache/tuscany/implementation/spring/itests/mock/TestHelloWorldBean.java
  (with props)
Modified:
    incubator/tuscany/sandbox/implementation-spring2/src/test/java/org/apache/tuscany/implementation/spring/itests/helloworld/HelloWorldProxy.java
    incubator/tuscany/sandbox/implementation-spring2/src/test/java/org/apache/tuscany/implementation/spring/itests/helloworld/SpringHelloWorldTestCase.java
    incubator/tuscany/sandbox/implementation-spring2/src/test/resources/META-INF/sca/application-context.xml

Modified: incubator/tuscany/sandbox/implementation-spring2/src/test/java/org/apache/tuscany/implementation/spring/itests/helloworld/HelloWorldProxy.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/implementation-spring2/src/test/java/org/apache/tuscany/implementation/spring/itests/helloworld/HelloWorldProxy.java?view=diff&rev=544398&r1=544397&r2=544398
==============================================================================
--- incubator/tuscany/sandbox/implementation-spring2/src/test/java/org/apache/tuscany/implementation/spring/itests/helloworld/HelloWorldProxy.java
(original)
+++ incubator/tuscany/sandbox/implementation-spring2/src/test/java/org/apache/tuscany/implementation/spring/itests/helloworld/HelloWorldProxy.java
Mon Jun  4 23:11:42 2007
@@ -22,16 +22,20 @@
 import org.osoa.sca.annotations.Reference;
 
 /**
- * A simple proxy Java class which implements the HelloWorld interface
+ * A simple proxy Java class which implements the HelloWorld interface but which uses
+ * a reference "delegate" to actually provide the HelloWorld service
  * @author MikeEdwards
  *
  */
 public class HelloWorldProxy implements HelloWorld {
 
+	// Here is the reference "delegate" - it implements the HelloWorld interface...
     @Reference
     public HelloWorld delegate;
     
     public String sayHello(String s) {
+    	// Simply call the reference to satisfy the service request...
+    	System.out.println("HelloWorldProxy - calling sayHello");
         return delegate.sayHello(s);
     }
 

Modified: incubator/tuscany/sandbox/implementation-spring2/src/test/java/org/apache/tuscany/implementation/spring/itests/helloworld/SpringHelloWorldTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/implementation-spring2/src/test/java/org/apache/tuscany/implementation/spring/itests/helloworld/SpringHelloWorldTestCase.java?view=diff&rev=544398&r1=544397&r2=544398
==============================================================================
--- incubator/tuscany/sandbox/implementation-spring2/src/test/java/org/apache/tuscany/implementation/spring/itests/helloworld/SpringHelloWorldTestCase.java
(original)
+++ incubator/tuscany/sandbox/implementation-spring2/src/test/java/org/apache/tuscany/implementation/spring/itests/helloworld/SpringHelloWorldTestCase.java
Mon Jun  4 23:11:42 2007
@@ -19,7 +19,14 @@
 
 package org.apache.tuscany.implementation.spring.itests.helloworld;
 
-
+/**
+ * A basic test case of:
+ * 1) A composite containing a component with a Spring implementation
+ * 2) The composite has a component with a Java POJO implementation which uses the
+ * Spring implementation to satisfy a reference
+ * 
+ * @author MikeEdwards
+ */
 public class SpringHelloWorldTestCase extends AbstractHelloWorldTestCase {
     // super class does it all getting composite based on this class name
 }

Added: incubator/tuscany/sandbox/implementation-spring2/src/test/java/org/apache/tuscany/implementation/spring/itests/mock/TestHelloWorldBean.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/implementation-spring2/src/test/java/org/apache/tuscany/implementation/spring/itests/mock/TestHelloWorldBean.java?view=auto&rev=544398
==============================================================================
--- incubator/tuscany/sandbox/implementation-spring2/src/test/java/org/apache/tuscany/implementation/spring/itests/mock/TestHelloWorldBean.java
(added)
+++ incubator/tuscany/sandbox/implementation-spring2/src/test/java/org/apache/tuscany/implementation/spring/itests/mock/TestHelloWorldBean.java
Mon Jun  4 23:11:42 2007
@@ -0,0 +1,21 @@
+package org.apache.tuscany.implementation.spring.itests.mock;
+
+/**
+ * A simple test Spring bean which provides the HelloWorld service
+ * @author MikeEdwards
+ *
+ */
+
+import org.apache.tuscany.implementation.spring.itests.helloworld.HelloWorld;
+
+public class TestHelloWorldBean implements HelloWorld {
+	
+	static String hello = "Hello ";
+	
+	// Classic "Hello xxx" response to any input message
+	public String sayHello( String message ) {
+		System.out.println("TestHelloWorldBean - sayHello called");
+		return( hello + message );
+	}
+
+} // end class TestHelloWorldBean

Propchange: incubator/tuscany/sandbox/implementation-spring2/src/test/java/org/apache/tuscany/implementation/spring/itests/mock/TestHelloWorldBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/sandbox/implementation-spring2/src/test/java/org/apache/tuscany/implementation/spring/itests/mock/TestHelloWorldBean.java
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Modified: incubator/tuscany/sandbox/implementation-spring2/src/test/resources/META-INF/sca/application-context.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/implementation-spring2/src/test/resources/META-INF/sca/application-context.xml?view=diff&rev=544398&r1=544397&r2=544398
==============================================================================
--- incubator/tuscany/sandbox/implementation-spring2/src/test/resources/META-INF/sca/application-context.xml
(original)
+++ incubator/tuscany/sandbox/implementation-spring2/src/test/resources/META-INF/sca/application-context.xml
Mon Jun  4 23:11:42 2007
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<!-- Application context for the SpringHelloWorld testcase -->
 <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:sca="http://www.springframework.org/schema/sca"
@@ -6,9 +7,7 @@
 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
 http://www.springframework.org/schema/sca http://www.springframework.org/schema/sca/spring-sca.xsd">
 
-    <bean id="testBean" class="org.apache.tuscany.implementation.spring.itests.mock.TestBeanImpl"
lazy-init="true">
-        <property name="bean" ref="testReference"/>
+    <bean id="testBean" class="org.apache.tuscany.implementation.spring.itests.mock.TestHelloWorldBean"
lazy-init="true">
     </bean>
-    <!-- <sca:reference name="testReference" type="org.apache.tuscany.implementation.spring.itests.mock.TestReference"/>
-->
 
 </beans>



---------------------------------------------------------------------
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