View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.transport.tcp.integration;
8   
9   import org.mule.tck.junit4.rule.DynamicPort;
10  import org.mule.util.SystemUtils;
11  
12  import org.junit.Rule;
13  
14  /**
15   * Tests a model for which synchonous=true for environment (was "and connector", but that is
16   * no longer possible).
17   * 
18   * Not the same as issue MULE-1687.
19   *
20   * This will happily send 1GB while running in significantly less memory, but it takes some time.
21   * Since I'd like this to run in CI I will set at 100MB and test memory delta.  But since memory usage
22   * could be around that anyway, this is may be a little unreliable.  And there's no way to
23   * measure memory use directly in 1.4.  We'll see...
24   *
25   * IMPORTANT - DO NOT RUN THIS TEST IN AN IDE WITH LOG LEVEL OF DEBUG.  USE INFO TO SEE
26   * DIAGNOSTICS.  OTHERWISE THE CONSOLE OUTPUT WILL BE SIMILAR SIZE TO DATA TRANSFERRED,
27   * CAUSING CONFUSNG AND PROBABLY FATAL MEMORY USE.
28   */
29  public class StreamingSynchCapacityTestCase extends AbstractStreamingCapacityTestCase
30  {
31  
32      @Rule
33      public DynamicPort dynamicPort1 = new DynamicPort("port1");
34  
35      @Rule
36      public DynamicPort dynamicPort2 = new DynamicPort("port2");
37  
38      public StreamingSynchCapacityTestCase()
39      {
40          super(100 * ONE_MB);
41      }
42  
43      @Override
44      protected String getConfigResources()
45      {
46          return "tcp-streaming2-test.xml";
47      }
48  
49      @Override
50      protected boolean isDisabledInThisEnvironment()
51      {
52          // MULE-4713
53          return (SystemUtils.isIbmJDK() && SystemUtils.isJavaVersionAtLeast(160));
54      }
55  
56  }