1   /*
2    * $Id: AxisMessageDispatcherTestCase.java 7963 2007-08-21 08:53:15Z 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.impl.ImmutableMuleEndpoint;
14  import org.mule.tck.AbstractMuleTestCase;
15  import org.mule.umo.UMOEvent;
16  import org.mule.umo.UMOMessage;
17  import org.mule.umo.endpoint.UMOImmutableEndpoint;
18  
19  import java.util.List;
20  import java.util.Map;
21  
22  import org.apache.axis.client.Call;
23  import org.apache.axis.client.Service;
24  
25  public class AxisMessageDispatcherTestCase extends AbstractMuleTestCase
26  {
27  
28      public void testNullParametersInCallAllowed() throws Exception
29      {
30          UMOImmutableEndpoint ep = new ImmutableMuleEndpoint(
31              "axis:http://www.muleumo.org/services/myService?method=myTestMethod", false);
32          AxisMessageDispatcher dispatcher = new AxisMessageDispatcher(ep);
33          dispatcher.service = new Service();
34          UMOEvent event = getTestEvent("testPayload", ep);
35          // there should be no NullPointerException
36          Call call = dispatcher.getCall(event, new Object[]{null});
37  
38          assertNotNull(call);
39  
40          UMOMessage msg = event.getMessage();
41          assertNotNull(msg);
42          final Map soapMethods = (Map)msg.getProperty("soapMethods");
43          assertEquals(1, soapMethods.size());
44          final List values = (List)soapMethods.get("myTestMethod");
45          assertNotNull(values);
46          assertEquals(1, values.size());
47          assertEquals("value0;qname{:anyType:http://www.w3.org/2001/XMLSchema};in", values.get(0));
48      }
49  
50  }