use of com.axway.ats.agent.core.threading.patterns.RampUpPattern in project ats-framework by Axway.
the class DisabledTest_MultiThreadedActionHandler method waitUntilAllQueuesFinishPositive.
@Test
public void waitUntilAllQueuesFinishPositive() throws Exception {
RampUpPattern pattern = new RampUpPattern(3, false, 3, 1000, 200, 2);
//then start the queue
QueueExecutionStatistics.getInstance().initActionExecutionResults(QUEUE_1);
actionHandler.executeActions("IP", QUEUE_1, -1, actionRequests, pattern, new LoaderDataConfig());
QueueExecutionStatistics.getInstance().initActionExecutionResults(QUEUE_2);
actionHandler.executeActions("IP", QUEUE_2, -1, actionRequests, pattern, new LoaderDataConfig());
//wait until the queue finishes
actionHandler.waitUntilAllQueuesFinish();
expectedNumExecutions = 18;
}
use of com.axway.ats.agent.core.threading.patterns.RampUpPattern in project ats-framework by Axway.
the class DisabledTest_MultiThreadedActionHandler method executeActionsRampUpPatternBlockingPositive.
@Test
public void executeActionsRampUpPatternBlockingPositive() throws Exception {
RampUpPattern pattern = new RampUpPattern(10, true);
QueueExecutionStatistics.getInstance().initActionExecutionResults(QUEUE_1);
actionHandler.executeActions("IP", QUEUE_1, -1, actionRequests, pattern, new LoaderDataConfig());
//check that all were executed
expectedNumExecutions = 10;
}
use of com.axway.ats.agent.core.threading.patterns.RampUpPattern in project ats-framework by Axway.
the class DisabledTest_RampUpLoaderMultipleInvocations method cancelTasksPositive.
@Test
public void cancelTasksPositive() throws Exception {
RampUpPattern pattern = new RampUpPattern(3, false, 10, 3000);
loader = LoadQueueFactory.createLoadQueue(QUEUE_NAME, actionRequests, pattern, new ArrayList<ParameterDataProvider>(), null);
//first schedule the threads
loader.scheduleThreads("IP", false);
Thread.sleep(1);
assertEquals(0, LoadTestActionClass.numExecutions);
QueueExecutionStatistics.getInstance().initActionExecutionResults(QUEUE_NAME);
//then start the loader
loader.start();
//sleep until the first and second iterations are executed
Thread.sleep(3500);
assertEquals(6, LoadTestActionClass.numExecutions);
loader.cancel();
}
use of com.axway.ats.agent.core.threading.patterns.RampUpPattern in project ats-framework by Axway.
the class DisabledTest_RampUpLoaderMultipleInvocations method cancelFinishedTasksPositive.
@Test
public void cancelFinishedTasksPositive() throws Exception {
RampUpPattern pattern = new RampUpPattern(3, false, 3, 0);
loader = LoadQueueFactory.createLoadQueue(QUEUE_NAME, actionRequests, pattern, new ArrayList<ParameterDataProvider>(), null);
//first schedule the threads
loader.scheduleThreads("IP", false);
Thread.sleep(1);
assertEquals(0, LoadTestActionClass.numExecutions);
QueueExecutionStatistics.getInstance().initActionExecutionResults(QUEUE_NAME);
//then start the loader
loader.start();
//sleep until the first and second iterations are executed
Thread.sleep(1000);
assertEquals(9, LoadTestActionClass.numExecutions);
loader.cancel();
}
use of com.axway.ats.agent.core.threading.patterns.RampUpPattern in project ats-framework by Axway.
the class DisabledTest_RampUpLoaderMultipleInvocations method rampUpPatternBlockingVerifyNoDelayIfNoRampUp.
@Test
public void rampUpPatternBlockingVerifyNoDelayIfNoRampUp() throws Exception {
RampUpPattern pattern = new RampUpPattern(5, true);
loader = LoadQueueFactory.createLoadQueue(QUEUE_NAME, 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_NAME);
loader.start();
long endTime = Calendar.getInstance().getTimeInMillis();
assertTrue(endTime - startTime < 2000);
}
Aggregations