1   /*
2    * $Id: AxisWsSecurityOnInboundTestCase.java 10165 2007-12-28 11:34:33Z marie.rizzo $
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.extras.wssecurity.testcases;
12  
13  import org.mule.extras.client.MuleClient;
14  import org.mule.tck.FunctionalTestCase;
15  import org.mule.umo.UMOMessage;
16  
17  import java.util.Properties;
18  
19  public class AxisWsSecurityOnInboundTestCase extends FunctionalTestCase
20  {
21      public void testGoodUserNameEncrypted () throws Exception
22      {
23          MuleClient client = new MuleClient(); 
24          Properties props = new Properties();
25  
26          UMOMessage m = client.send("Test1", "Test", props);
27          assertNotNull(m);
28          assertTrue(m.getPayload() instanceof String);
29          assertTrue(m.getPayload().equals("Test"));
30      }
31  
32      public void testBadUserNameEncrypted () throws Exception
33      {
34          MuleClient client = new MuleClient();
35          UMOMessage m = null;
36          try
37          {
38              m = client.send("Test2", "Test", null);
39          }
40          catch (Exception e)
41          {
42              assertNotNull(e);
43          }
44          assertNull(m);
45      }
46  
47      protected String getConfigResources ()
48      {
49          return "axis-wssecurity-mule-config.xml";
50      }
51  }