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