View Javadoc

1   /*
2    * $Id: StreamingSynchCapacityTestCase.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.transport.tcp.integration;
12  
13  import org.mule.tck.junit4.rule.DynamicPort;
14  import org.mule.util.SystemUtils;
15  
16  import java.util.Arrays;
17  import java.util.Collection;
18  
19  import org.junit.Rule;
20  import org.junit.runners.Parameterized.Parameters;
21  
22  /**
23   * Tests a model for which synchonous=true for environment (was "and connector", but
24   * that is no longer possible). Not the same as issue MULE-1687. This will happily
25   * send 1GB while running in significantly less memory, but it takes some time. Since
26   * I'd like this to run in CI I will set at 100MB and test memory delta. But since
27   * memory usage could be around that anyway, this is may be a little unreliable. And
28   * there's no way to measure memory use directly in 1.4. We'll see... IMPORTANT - DO
29   * NOT RUN THIS TEST IN AN IDE WITH LOG LEVEL OF DEBUG. USE INFO TO SEE DIAGNOSTICS.
30   * OTHERWISE THE CONSOLE OUTPUT WILL BE SIMILAR SIZE TO DATA TRANSFERRED, CAUSING
31   * CONFUSNG AND PROBABLY FATAL MEMORY USE.
32   */
33  public class StreamingSynchCapacityTestCase extends AbstractStreamingCapacityTestCase
34  {
35      @Rule
36      public DynamicPort port1 = new DynamicPort("port1");
37  
38      @Rule
39      public DynamicPort port2 = new DynamicPort("port2");
40  
41      @Parameters
42      public static Collection<Object[]> parameters()
43      {
44          return Arrays.asList(new Object[][]{
45              {ConfigVariant.SERVICE, "tcp-streaming2-test-service.xml"},
46              {ConfigVariant.FLOW, "tcp-streaming2-test-flow.xml"}
47          });
48      }
49  
50      public StreamingSynchCapacityTestCase(ConfigVariant variant, String configResources)
51      {
52          super(variant, configResources, 100 * ONE_MB);
53      }
54  
55      @Override
56      protected boolean isDisabledInThisEnvironment()
57      {
58          // MULE-4713
59          return (SystemUtils.isIbmJDK() && SystemUtils.isJavaVersionAtLeast(160));
60      }
61  }