1
2
3
4
5
6
7
8
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 import org.apache.ws.security.handler.WSHandlerConstants;
20
21 public class XfireSamlTestCase extends FunctionalTestCase
22 {
23
24
25
26 public void testBogus () throws Exception
27 {
28
29 }
30
31 public void _testGoodUnsignedSamlTokenAuthentication () throws Exception
32 {
33 MuleClient client = new MuleClient();
34 Properties props = new Properties();
35
36
37 props.setProperty(WSHandlerConstants.SAML_PROP_FILE, "saml.properties");
38
39 UMOMessage m = client.send("unsignedAddr", "Test", props);
40 assertNotNull(m);
41 assertTrue(m.getPayload() instanceof String);
42 assertTrue(m.getPayload().equals("Test"));
43 }
44
45 public void _testGoodSignedSamlTokenAuthentication () throws Exception
46 {
47 MuleClient client = new MuleClient();
48 Properties props = new Properties();
49
50
51 props.setProperty(WSHandlerConstants.SAML_PROP_FILE, "saml.properties");
52
53 UMOMessage m = client.send("signedAddr", "Test", props);
54 assertNotNull(m);
55 assertTrue(m.getPayload() instanceof String);
56 assertTrue(m.getPayload().equals("Test"));
57 }
58
59 protected String getConfigResources ()
60 {
61 return "wssecurity-mule-saml-config.xml";
62 }
63 }