1
2
3
4
5
6
7
8
9
10
11 package org.mule.transport.soap.axis;
12
13 import org.mule.api.MuleException;
14 import org.mule.api.endpoint.InboundEndpoint;
15 import org.mule.api.lifecycle.InitialisationException;
16 import org.mule.api.service.Service;
17 import org.mule.config.ExceptionHelper;
18 import org.mule.tck.MuleTestUtils;
19 import org.mule.tck.providers.soap.AbstractSoapUrlEndpointFunctionalTestCase;
20
21 public class AxisConnectorHttpFunctionalTestCase extends AbstractSoapUrlEndpointFunctionalTestCase
22 {
23 public static class ComponentWithoutInterfaces
24 {
25 public String echo(String msg)
26 {
27 return msg;
28 }
29 }
30
31 public String getConfigResources()
32 {
33 return "axis-" + getTransportProtocol() + "-mule-config.xml";
34 }
35
36 protected String getTransportProtocol()
37 {
38 return "http";
39 }
40
41 protected String getSoapProvider()
42 {
43 return "axis";
44 }
45
46
47
48
49
50
51
52
53 public void testComponentWithoutInterfaces() throws Throwable
54 {
55 try
56 {
57
58 Service c = MuleTestUtils.getTestService("testComponentWithoutInterfaces", ComponentWithoutInterfaces.class, null, muleContext, false);
59 InboundEndpoint ep = muleContext.getRegistry().lookupEndpointFactory().getInboundEndpoint(getComponentWithoutInterfacesEndpoint());
60 c.getInboundRouter().addEndpoint(ep);
61 muleContext.getRegistry().registerService(c);
62 fail("Expected exception");
63 }
64 catch (MuleException e)
65 {
66 e = ExceptionHelper.getRootMuleException(e);
67 assertTrue(e instanceof InitialisationException);
68 assertTrue(e.getMessage(), e.getMessage().indexOf("must implement at least one interface") > -1);
69 }
70 }
71 }