1
2
3
4
5
6
7 package org.mule.module.cxf.employee;
8
9 import org.mule.tck.junit4.FunctionalTestCase;
10 import org.mule.tck.junit4.rule.DynamicPort;
11
12 import org.junit.Rule;
13 import org.junit.Test;
14
15 import static org.junit.Assert.assertEquals;
16 import static org.junit.Assert.assertTrue;
17
18 public class MtomClientTestCase extends FunctionalTestCase
19 {
20
21 @Rule
22 public DynamicPort dynamicPort = new DynamicPort("port1");
23
24 @Override
25 protected String getConfigResources()
26 {
27 return "mtom-client-conf.xml";
28 }
29
30 @Test
31 public void testEchoService() throws Exception
32 {
33 EmployeeDirectoryImpl svc = (EmployeeDirectoryImpl) getComponent("employeeDirectoryService");
34
35 int count = 0;
36 while (svc.getInvocationCount() == 0 && count < 5000) {
37 count += 500;
38 Thread.sleep(500);
39 }
40
41 assertEquals(1, svc.getInvocationCount());
42
43
44 assertTrue(AttachmentVerifyInterceptor.HasAttachments);
45 }
46
47 }
48