TUSCANY-2513 Java intfs with @WebService should be treated like @Remotable intfs wrt calculation of services implemented by a Java implementation

o Test for the @WebService annotation on an implemented interface resulting in a service.

git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@689430 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
vamsic007 2008-08-27 09:57:53 +00:00
parent 072a14b149
commit 819ea724b3

View file

@ -22,6 +22,7 @@ import java.lang.reflect.Constructor;
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 @@ public class HeuristicPojoProcessorTestCase extends AbstractProcessorTest {
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 @@ public class HeuristicPojoProcessorTestCase extends AbstractProcessorTest {
}
@WebService
private interface SomeWebService {
void serviceOperation1();
}
@Service
private static class SomeWebServiceImpl implements SomeWebService {
public SomeWebServiceImpl() {
}
public void serviceOperation1() {
}
}
}