tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rf...@apache.org
Subject svn commit: r695617 - in /tuscany/branches/sca-java-1.3.2: itest/validation/src/main/resources/impl/osgi/MissingComponentTypeFile/ itest/validation/src/main/resources/impl/osgi/PropertyShouldSpecifySR/ modules/implementation-java/ modules/implementatio...
Date Mon, 15 Sep 2008 20:47:38 GMT
Author: rfeng
Date: Mon Sep 15 13:47:37 2008
New Revision: 695617

URL: http://svn.apache.org/viewvc?rev=695617&view=rev
Log:
Merge the fix for TUSCANY-2513 from trunk

Modified:
    tuscany/branches/sca-java-1.3.2/itest/validation/src/main/resources/impl/osgi/MissingComponentTypeFile/OSGiTestService.jar
    tuscany/branches/sca-java-1.3.2/itest/validation/src/main/resources/impl/osgi/PropertyShouldSpecifySR/OSGiTestService.jar
    tuscany/branches/sca-java-1.3.2/modules/implementation-java/pom.xml
    tuscany/branches/sca-java-1.3.2/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicPojoProcessor.java
    tuscany/branches/sca-java-1.3.2/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessor.java
    tuscany/branches/sca-java-1.3.2/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicPojoProcessorTestCase.java
    tuscany/branches/sca-java-1.3.2/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessorTestCase.java

Modified: tuscany/branches/sca-java-1.3.2/itest/validation/src/main/resources/impl/osgi/MissingComponentTypeFile/OSGiTestService.jar
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.3.2/itest/validation/src/main/resources/impl/osgi/MissingComponentTypeFile/OSGiTestService.jar?rev=695617&r1=695616&r2=695617&view=diff
==============================================================================
Binary files - no diff available.

Modified: tuscany/branches/sca-java-1.3.2/itest/validation/src/main/resources/impl/osgi/PropertyShouldSpecifySR/OSGiTestService.jar
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.3.2/itest/validation/src/main/resources/impl/osgi/PropertyShouldSpecifySR/OSGiTestService.jar?rev=695617&r1=695616&r2=695617&view=diff
==============================================================================
Binary files - no diff available.

Modified: tuscany/branches/sca-java-1.3.2/modules/implementation-java/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.3.2/modules/implementation-java/pom.xml?rev=695617&r1=695616&r2=695617&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.3.2/modules/implementation-java/pom.xml (original)
+++ tuscany/branches/sca-java-1.3.2/modules/implementation-java/pom.xml Mon Sep 15 13:47:37
2008
@@ -46,6 +46,12 @@
             <artifactId>tuscany-sca-api</artifactId>
             <version>1.3.2-SNAPSHOT</version>
         </dependency>
+
+        <dependency>
+            <groupId>javax.jws</groupId>
+            <artifactId>jsr181-api</artifactId>
+            <version>1.0-MR1</version>
+        </dependency>
     </dependencies>
 
     <build>

Modified: tuscany/branches/sca-java-1.3.2/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicPojoProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.3.2/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicPojoProcessor.java?rev=695617&r1=695616&r2=695617&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.3.2/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicPojoProcessor.java
(original)
+++ tuscany/branches/sca-java-1.3.2/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicPojoProcessor.java
Mon Sep 15 13:47:37 2008
@@ -37,6 +37,8 @@
 import java.util.Map;
 import java.util.Set;
 
+import javax.jws.WebService;
+
 import org.apache.tuscany.sca.assembly.AssemblyFactory;
 import org.apache.tuscany.sca.assembly.Contract;
 import org.apache.tuscany.sca.assembly.Multiplicity;
@@ -96,7 +98,7 @@
              */
             Set<Class> interfaces = getAllInterfaces(clazz);
             for (Class<?> i : interfaces) {
-                if (i.isAnnotationPresent(Remotable.class)) {
+                if (i.isAnnotationPresent(Remotable.class) || i.isAnnotationPresent(WebService.class))
{
                     addService(type, i);
                 }
             }

Modified: tuscany/branches/sca-java-1.3.2/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.3.2/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessor.java?rev=695617&r1=695616&r2=695617&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.3.2/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessor.java
(original)
+++ tuscany/branches/sca-java-1.3.2/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessor.java
Mon Sep 15 13:47:37 2008
@@ -28,6 +28,8 @@
 import java.util.Set;
 import java.util.logging.Logger;
 
+import javax.jws.WebService;
+
 import org.apache.tuscany.sca.assembly.AssemblyFactory;
 import org.apache.tuscany.sca.assembly.Service;
 import org.apache.tuscany.sca.implementation.java.IntrospectionException;
@@ -64,7 +66,10 @@
             // scan interfaces for remotable
             Set<Class> interfaces = getAllInterfaces(clazz);
             for (Class<?> interfaze : interfaces) {
-                if (interfaze.isAnnotationPresent(Remotable.class) || interfaze.isAnnotationPresent(Callback.class))
{
+                if (interfaze.isAnnotationPresent(Remotable.class) 
+                    || interfaze.isAnnotationPresent(WebService.class)
+                    || interfaze.isAnnotationPresent(Callback.class)
+                    ) {
                     Service service;
                     try {
                         service = createService(interfaze);

Modified: tuscany/branches/sca-java-1.3.2/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicPojoProcessorTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.3.2/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicPojoProcessorTestCase.java?rev=695617&r1=695616&r2=695617&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.3.2/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicPojoProcessorTestCase.java
(original)
+++ tuscany/branches/sca-java-1.3.2/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicPojoProcessorTestCase.java
Mon Sep 15 13:47:37 2008
@@ -22,6 +22,7 @@
 import java.util.Collection;
 import java.util.List;
 
+import javax.jws.WebService;
 import javax.xml.namespace.QName;
 
 import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory;
@@ -268,6 +269,17 @@
         assertTrue(type.getPropertyMembers().containsKey("gen4"));
     }
 
+    /**
+     * Interfaces with "@WebService" annotation implemented by the class should result
+     * in a Service in the same manner as an "@Remotable" annotation would.
+     */
+    public void testInterfaceWithWebServiceAnnotation() throws Exception{
+        JavaImplementation type = javaImplementationFactory.createJavaImplementation();
+        visitEnd(SomeWebServiceImpl.class, type);
+        assertEquals(1, type.getServices().size());
+        assertEquals("SomeWebService", type.getServices().get(0).getName());
+    }
+    
     @Remotable
     private interface ReferenceRemotableInterface {
         void operation1(String param1);
@@ -532,4 +544,19 @@
 
     }
 
+    @WebService
+    private interface SomeWebService {
+        void serviceOperation1();
+    }
+    
+    @Service
+    private static class SomeWebServiceImpl implements SomeWebService {
+        public SomeWebServiceImpl() {
+            
+        }
+
+        public void serviceOperation1() {
+        }
+    }
+
 }

Modified: tuscany/branches/sca-java-1.3.2/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessorTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.3.2/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessorTestCase.java?rev=695617&r1=695616&r2=695617&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.3.2/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessorTestCase.java
(original)
+++ tuscany/branches/sca-java-1.3.2/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessorTestCase.java
Mon Sep 15 13:47:37 2008
@@ -18,6 +18,8 @@
  */
 package org.apache.tuscany.sca.implementation.java.introspect.impl;
 
+import javax.jws.WebService;
+
 import junit.framework.TestCase;
 
 import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory;
@@ -65,6 +67,12 @@
         assertEquals(1, type.getServices().size());
     }
 
+
+    public void testMultipleWithWebServiceAnnotation() throws Exception {
+        processor.visitClass(FooMultipleWithWebService.class, type);
+        assertEquals(2, type.getServices().size());
+    }
+    
     public void testRemotableNoService() throws Exception {
         processor.visitClass(FooRemotableNoService.class, type);
         assertEquals(1, type.getServices().size());
@@ -102,6 +110,10 @@
 
     private interface Bar2 {
     }
+    
+    @WebService
+    private interface Bar3 {
+    }
 
     @Remotable
     private interface BazRemotable {
@@ -124,7 +136,10 @@
     private class FooMultipleWithCalback implements Baz, Bar {
 
     }
-
+    
+    private class FooMultipleWithWebService implements BazRemotable, Bar3 {
+    }
+    
     private class FooRemotableNoService implements BazRemotable, Bar {
 
     }



Mime
View raw message