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