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.api.source.CompositeMessageSource;
18 import org.mule.config.ExceptionHelper;
19 import org.mule.tck.MuleTestUtils;
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 @Override
32 public String getConfigResources()
33 {
34 return "axis-" + getTransportProtocol() + "-mule-config.xml";
35 }
36
37 @Override
38 protected String getTransportProtocol()
39 {
40 return "http";
41 }
42
43 @Override
44 protected String getSoapProvider()
45 {
46 return "axis";
47 }
48
49
50
51
52
53
54
55
56 public void testComponentWithoutInterfaces() throws Throwable
57 {
58 try
59 {
60
61 Service c = MuleTestUtils.getTestService("testComponentWithoutInterfaces", ComponentWithoutInterfaces.class, null, muleContext, false);
62 InboundEndpoint ep = muleContext.getRegistry().lookupEndpointFactory().getInboundEndpoint(getComponentWithoutInterfacesEndpoint());
63 ((CompositeMessageSource) c.getMessageSource()).addSource(ep);
64 muleContext.getRegistry().registerService(c);
65 fail("Expected exception");
66 }
67 catch (MuleException e)
68 {
69 e = ExceptionHelper.getRootMuleException(e);
70 assertTrue(e instanceof InitialisationException);
71 assertTrue(e.getMessage(), e.getMessage().indexOf("must implement at least one interface") > -1);
72 }
73 }
74
75 @Override
76 protected int getNumPortsToFind()
77 {
78 return 3;
79 }
80 }