View Javadoc

1   /*
2    * $Id: InOutOutOnlyMessageCopyMule3007TestCase.java 22450 2011-07-19 08:20:41Z dirk.olmes $
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.issues;
12  
13  import org.mule.api.MuleException;
14  import org.mule.api.MuleMessage;
15  import org.mule.module.client.MuleClient;
16  import org.mule.tck.AbstractServiceAndFlowTestCase;
17  import org.mule.tck.junit4.rule.DynamicPort;
18  
19  import java.util.Arrays;
20  import java.util.Collection;
21  
22  import org.junit.Rule;
23  import org.junit.Test;
24  import org.junit.runners.Parameterized.Parameters;
25  
26  import static org.junit.Assert.assertNull;
27  
28  public class InOutOutOnlyMessageCopyMule3007TestCase extends AbstractServiceAndFlowTestCase
29  {
30      @Rule
31      public DynamicPort port1 = new DynamicPort("port1");
32  
33      @Parameters
34      public static Collection<Object[]> parameters()
35      {
36          return Arrays.asList(new Object[][]{
37              {ConfigVariant.SERVICE, "org/mule/issues/inout-outonly-message-copy-mule3007-test-service.xml"},
38              {ConfigVariant.FLOW, "org/mule/issues/inout-outonly-message-copy-mule3007-test-flow.xml"}
39          });
40      }
41  
42      public InOutOutOnlyMessageCopyMule3007TestCase(ConfigVariant variant, String configResources)
43      {
44          super(variant, configResources);
45      }
46  
47      @Test
48      public void testStreamMessage() throws MuleException
49      {
50          MuleClient client = new MuleClient(muleContext);
51          String url = String.format("http://localhost:%1d/services", port1.getNumber());
52          System.out.println(url);
53          MuleMessage response = client.send(url, "test", null);
54          assertNull(response.getExceptionPayload());
55      }
56  }