1
2
3
4
5
6
7
8
9
10
11 package org.mule.transport.cxf.wssec;
12 import org.mule.tck.FunctionalTestCase;
13
14 import org.apache.hello_world_soap_http.GreeterImpl;
15
16 public class UsernameTokenTestCase extends FunctionalTestCase
17 {
18 public void testUsernameToken() throws Exception
19 {
20 ClientPasswordCallback.setPassword("password");
21
22 GreeterImpl impl = getGreeter();
23
24 int i = 0;
25 while (i < 100)
26 {
27 if (impl.getInvocationCount() > 0)
28 {
29 break;
30 }
31 Thread.sleep(50);
32 }
33
34 assertEquals(1, impl.getInvocationCount());
35 }
36
37 private GreeterImpl getGreeter() throws Exception
38 {
39 Object instance = getComponent("greeterService");
40
41 return (GreeterImpl) instance;
42 }
43
44 protected String getConfigResources()
45 {
46 return "org/mule/transport/cxf/wssec/username-token-conf.xml";
47 }
48
49 }
50
51