View Javadoc

1   /*
2    * $Id: MtomClientTestCase.java 20320 2010-11-24 15:03:31Z dfeist $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.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.module.cxf.employee;
12  
13  import org.mule.tck.FunctionalTestCase;
14  
15  public class MtomClientTestCase extends FunctionalTestCase
16  {
17  
18      public void testEchoService() throws Exception
19      {
20          EmployeeDirectoryImpl svc = (EmployeeDirectoryImpl) getComponent("employeeDirectoryService");
21          
22          int count = 0;
23          while (svc.getInvocationCount() == 0 && count < 5000) {
24              count += 500;
25              Thread.sleep(500);
26          }
27          
28          assertEquals(1, svc.getInvocationCount());
29          
30          // ensure that an attachment was actually sent.
31          assertTrue(AttachmentVerifyInterceptor.HasAttachments);
32      }
33  
34      protected String getConfigResources()
35      {
36          return "mtom-client-conf.xml";
37      }
38  
39  }
40