Search in sources :

Example 36 with RampUpPattern

use of com.axway.ats.agent.core.threading.patterns.RampUpPattern in project ats-framework by Axway.

the class Test_QueueCanceling method ramUp_OneThreadPaused_OneThreadNotStartedYet.

/**
     * Cancel a ramp-up pattern while:
     * - 1th thread has executed its first iteration and is sleeping before start the second iteration
     * - the 2nd thread is waiting to start its first iteration
     */
@Test
public void ramUp_OneThreadPaused_OneThreadNotStartedYet() throws Exception {
    expectedNumExecutions = 1;
    actionRequests.add(new ActionRequest(TEST_COMPONENT_NAME, ACTION_SLEEP, new Object[] { "500" }));
    RampUpPattern pattern = new RampUpPattern(2, false, 2, 1000, 2000, 1);
    QueueExecutionStatistics.getInstance().initActionExecutionResults(QUEUE_NAME);
    actionHandler.scheduleActions(HOST, QUEUE_NAME, -1, actionRequests, pattern, new LoaderDataConfig(), false);
    actionHandler.startQueue(QUEUE_NAME);
    Thread.sleep(1000);
}
Also used : RampUpPattern(com.axway.ats.agent.core.threading.patterns.RampUpPattern) ActionRequest(com.axway.ats.agent.core.action.ActionRequest) LoaderDataConfig(com.axway.ats.agent.core.threading.data.config.LoaderDataConfig) Test(org.junit.Test)

Aggregations

RampUpPattern (com.axway.ats.agent.core.threading.patterns.RampUpPattern)36 Test (org.junit.Test)35 LoaderDataConfig (com.axway.ats.agent.core.threading.data.config.LoaderDataConfig)18 ArrayList (java.util.ArrayList)17 BaseTest (com.axway.ats.agent.core.BaseTest)16 ActionRequest (com.axway.ats.agent.core.action.ActionRequest)5 AllAtOncePattern (com.axway.ats.agent.core.threading.patterns.AllAtOncePattern)2 FixedDurationRampUpPattern (com.axway.ats.agent.core.threading.patterns.FixedDurationRampUpPattern)2 ParameterDataProvider (com.axway.ats.agent.core.threading.data.ParameterDataProvider)1 ThreadingPatternNotSupportedException (com.axway.ats.agent.core.threading.exceptions.ThreadingPatternNotSupportedException)1 QueueLoaderListener (com.axway.ats.agent.core.threading.listeners.QueueLoaderListener)1 FixedDurationAllAtOncePattern (com.axway.ats.agent.core.threading.patterns.FixedDurationAllAtOncePattern)1