01: package org.objectweb.celtix.bus.jaxws;
02:
03: import java.util.Properties;
04:
05: import javax.xml.ws.Endpoint;
06: import javax.xml.ws.soap.SOAPBinding;
07: import javax.xml.ws.spi.Provider;
08:
09: import junit.framework.TestCase;
10:
11: import org.objectweb.celtix.Bus;
12: import org.objectweb.celtix.bus.jaxws.spi.ProviderImpl;
13: import org.objectweb.hello_world_soap_http.AnnotatedGreeterImpl;
14: import org.objectweb.hello_world_soap_http.NotAnnotatedGreeterImpl;
15:
16: public class EndpointFactoryImplTest extends TestCase {
17:
18: private Bus bus;
19: private String epfClassName;
20:
21: protected void setUp() throws Exception {
22: super .setUp();
23: epfClassName = System
24: .getProperty(Provider.JAXWSPROVIDER_PROPERTY);
25: System.setProperty(Provider.JAXWSPROVIDER_PROPERTY,
26: ProviderImpl.JAXWS_PROVIDER);
27: bus = Bus.init();
28: }
29:
30: protected void tearDown() throws Exception {
31: bus.shutdown(true);
32: if (null == epfClassName) {
33: Properties properties = System.getProperties();
34: properties.remove(Provider.JAXWSPROVIDER_PROPERTY);
35: System.setProperties(properties);
36: } else {
37: System.setProperty(Provider.JAXWSPROVIDER_PROPERTY,
38: epfClassName);
39: }
40:
41: super .tearDown();
42: }
43:
44: public void testCreateWithNotAnnotatedImplementor()
45: throws Exception {
46: Object implementor = new NotAnnotatedGreeterImpl();
47: Endpoint ep = Endpoint.create(SOAPBinding.SOAP11HTTP_BINDING,
48: implementor);
49: assertNotNull(ep);
50: }
51:
52: public void testCreateWithCorrectlyAnnotatedImplementor()
53: throws Exception {
54: Object implementor = new AnnotatedGreeterImpl();
55: Endpoint ep = Endpoint.create(SOAPBinding.SOAP11HTTP_BINDING,
56: implementor);
57: assertNotNull(ep);
58: }
59:
60: }
|