Search in sources :

Example 6 with FixedDurationAllAtOncePattern

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

the class DisabledTest_RampUpQueueLoaderFixedDuration method allAtOncePatternNonBlockingPositive.

@Test
public void allAtOncePatternNonBlockingPositive() throws Exception {
    FixedDurationAllAtOncePattern pattern = new FixedDurationAllAtOncePattern(2, false, 2, 500);
    loader = LoadQueueFactory.createLoadQueue(QUEUE_1, actionRequests, pattern, new ArrayList<ParameterDataProvider>(), null);
    //first schedule the threads
    loader.scheduleThreads("IP", false);
    Thread.sleep(1);
    //then start the loader
    long startTime = Calendar.getInstance().getTimeInMillis();
    QueueExecutionStatistics.getInstance().initActionExecutionResults(QUEUE_1);
    loader.start();
    long endTime = Calendar.getInstance().getTimeInMillis();
    assertTrue(endTime - startTime < 1000);
    loader.waitUntilFinished();
}
Also used : ArrayList(java.util.ArrayList) FixedDurationAllAtOncePattern(com.axway.ats.agent.core.threading.patterns.FixedDurationAllAtOncePattern) Test(org.junit.Test) BaseTest(com.axway.ats.agent.core.BaseTest)

Aggregations

FixedDurationAllAtOncePattern (com.axway.ats.agent.core.threading.patterns.FixedDurationAllAtOncePattern)6 Test (org.junit.Test)5 BaseTest (com.axway.ats.agent.core.BaseTest)4 ActionRequest (com.axway.ats.agent.core.action.ActionRequest)3 ArrayList (java.util.ArrayList)3 ParameterDataProvider (com.axway.ats.agent.core.threading.data.ParameterDataProvider)2 ThreadingPatternNotSupportedException (com.axway.ats.agent.core.threading.exceptions.ThreadingPatternNotSupportedException)1 QueueLoaderListener (com.axway.ats.agent.core.threading.listeners.QueueLoaderListener)1 AllAtOncePattern (com.axway.ats.agent.core.threading.patterns.AllAtOncePattern)1 FixedDurationRampUpPattern (com.axway.ats.agent.core.threading.patterns.FixedDurationRampUpPattern)1 RampUpPattern (com.axway.ats.agent.core.threading.patterns.RampUpPattern)1