1   /*
2    * $Id: AxisConnectorHttpFunctionalTestCase.java 7976 2007-08-21 14:26:13Z dirk.olmes $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.providers.soap.axis;
12  
13  import org.mule.config.ExceptionHelper;
14  import org.mule.config.builders.QuickConfigurationBuilder;
15  import org.mule.tck.providers.soap.AbstractSoapUrlEndpointFunctionalTestCase;
16  import org.mule.umo.UMOException;
17  import org.mule.umo.lifecycle.InitialisationException;
18  
19  public class AxisConnectorHttpFunctionalTestCase extends AbstractSoapUrlEndpointFunctionalTestCase
20  {
21  
22      public static class ComponentWithoutInterfaces
23      {
24          public String echo(String msg)
25          {
26              return msg;
27          }
28      }
29  
30      public String getConfigResources()
31      {
32          return "axis-" + getTransportProtocol() + "-mule-config.xml";
33      }
34  
35      protected String getTransportProtocol()
36      {
37          return "http";
38      }
39  
40      protected String getSoapProvider()
41      {
42          return "axis";
43      }
44  
45      /**
46       * The Axis service requires that the component implements at least one interface
47       * This just tests that we get the correct exception if no interfaces are
48       * implemented
49       * 
50       * @throws Throwable
51       */
52      public void testComponentWithoutInterfaces() throws Throwable
53      {
54          try
55          {
56              QuickConfigurationBuilder builder = new QuickConfigurationBuilder();
57              builder.registerComponent(ComponentWithoutInterfaces.class.getName(),
58                  "testComponentWithoutInterfaces", getComponentWithoutInterfacesEndpoint(), null, null);
59              fail();
60          }
61          catch (UMOException e)
62          {
63              e = ExceptionHelper.getRootMuleException(e);
64              assertTrue(e instanceof InitialisationException);
65          }
66      }
67  
68  }