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();
}
Aggregations