You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by gn...@apache.org on 2006/06/06 15:17:16 UTC

svn commit: r412114 - in /incubator/servicemix/trunk/servicemix-jsr181/src/test: java/org/apache/servicemix/jsr181/Jsr181SpringTest.java java/test/Echo.java java/test/EchoService2.java resources/org/apache/servicemix/jsr181/spring.xml

Author: gnodet
Date: Tue Jun  6 06:17:15 2006
New Revision: 412114

URL: http://svn.apache.org/viewvc?rev=412114&view=rev
Log:
Add a test and a snippet for Jsr181ProxyFactoryBean

Added:
    incubator/servicemix/trunk/servicemix-jsr181/src/test/java/test/Echo.java
Modified:
    incubator/servicemix/trunk/servicemix-jsr181/src/test/java/org/apache/servicemix/jsr181/Jsr181SpringTest.java
    incubator/servicemix/trunk/servicemix-jsr181/src/test/java/test/EchoService2.java
    incubator/servicemix/trunk/servicemix-jsr181/src/test/resources/org/apache/servicemix/jsr181/spring.xml

Modified: incubator/servicemix/trunk/servicemix-jsr181/src/test/java/org/apache/servicemix/jsr181/Jsr181SpringTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-jsr181/src/test/java/org/apache/servicemix/jsr181/Jsr181SpringTest.java?rev=412114&r1=412113&r2=412114&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-jsr181/src/test/java/org/apache/servicemix/jsr181/Jsr181SpringTest.java (original)
+++ incubator/servicemix/trunk/servicemix-jsr181/src/test/java/org/apache/servicemix/jsr181/Jsr181SpringTest.java Tue Jun  6 06:17:15 2006
@@ -28,6 +28,8 @@
 import org.springframework.context.support.AbstractXmlApplicationContext;
 import org.apache.xbean.spring.context.ClassPathXmlApplicationContext;
 
+import test.Echo;
+
 public class Jsr181SpringTest extends SpringTestSupport {
 
     private static Log logger =  LogFactory.getLog(Jsr181ComponentTest.class);
@@ -35,7 +37,7 @@
     public void test() throws Exception {
         DefaultServiceMixClient client = new DefaultServiceMixClient(jbi);
         InOut me = client.createInOutExchange();
-        me.setInterfaceName(new QName("http://test", "EchoService2PortType"));
+        me.setInterfaceName(new QName("http://test", "EchoPortType"));
         me.getInMessage().setContent(new StringSource("<echo xmlns='http://test'><echoin0>world</echoin0></echo>"));
         client.sendSync(me);
         if (me.getStatus() == ExchangeStatus.ERROR) {
@@ -49,6 +51,12 @@
         } else {
             logger.info(new SourceTransformer().toString(me.getOutMessage().getContent()));
         }
+    }
+    
+    public void testProxy() throws Exception {
+        Echo echo = (Echo) context.getBean("proxy");
+        String result = echo.echo("world");
+        assertEquals("world", result);
     }
     
     protected AbstractXmlApplicationContext createBeanFactory() {

Added: incubator/servicemix/trunk/servicemix-jsr181/src/test/java/test/Echo.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-jsr181/src/test/java/test/Echo.java?rev=412114&view=auto
==============================================================================
--- incubator/servicemix/trunk/servicemix-jsr181/src/test/java/test/Echo.java (added)
+++ incubator/servicemix/trunk/servicemix-jsr181/src/test/java/test/Echo.java Tue Jun  6 06:17:15 2006
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package test;
+
+public interface Echo {
+
+    public String echo(String input);
+    
+}

Modified: incubator/servicemix/trunk/servicemix-jsr181/src/test/java/test/EchoService2.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-jsr181/src/test/java/test/EchoService2.java?rev=412114&r1=412113&r2=412114&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-jsr181/src/test/java/test/EchoService2.java (original)
+++ incubator/servicemix/trunk/servicemix-jsr181/src/test/java/test/EchoService2.java Tue Jun  6 06:17:15 2006
@@ -15,7 +15,7 @@
  */
 package test;
 
-public class EchoService2 {
+public class EchoService2 implements Echo {
     
     public EchoService2() {
     }

Modified: incubator/servicemix/trunk/servicemix-jsr181/src/test/resources/org/apache/servicemix/jsr181/spring.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-jsr181/src/test/resources/org/apache/servicemix/jsr181/spring.xml?rev=412114&r1=412113&r2=412114&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-jsr181/src/test/resources/org/apache/servicemix/jsr181/spring.xml (original)
+++ incubator/servicemix/trunk/servicemix-jsr181/src/test/resources/org/apache/servicemix/jsr181/spring.xml Tue Jun  6 06:17:15 2006
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <beans xmlns:sm="http://servicemix.apache.org/config/1.0" 
-	   xmlns:jsr181="http://servicemix.apache.org/jsr181/1.0">
+	   xmlns:jsr181="http://servicemix.apache.org/jsr181/1.0"
+       xmlns:test="http://test">
 
   <!-- the JBI container -->
   
@@ -19,6 +20,7 @@
             <jsr181:component>
             	<jsr181:endpoints>
             		<jsr181:endpoint pojoClass="test.EchoService2"
+                                     serviceInterface="test.Echo"
   				   					 annotations="none" />
             	</jsr181:endpoints>
             </jsr181:component>
@@ -28,5 +30,12 @@
 
     </sm:activationSpecs>
   </sm:container>
+  
+  <!-- START SNIPPET: proxy -->
+  <jsr181:proxy id="proxy"
+                container="#jbi" 
+                interfaceName="test:EchoPortType"
+                type="test.Echo" />
+  <!-- END SNIPPET: proxy -->
 
 </beans>