use of com.axway.ats.agent.core.threading.data.config.LoaderDataConfig in project ats-framework by Axway.
the class DisabledTest_MultiThreadedActionHandler method executeActionsRampUpPatternBlockingWithRampUpPositive.
@Test
public void executeActionsRampUpPatternBlockingWithRampUpPositive() throws Exception {
RampUpPattern pattern = new RampUpPattern(10, true, 1, 0, 1000, 2);
//then start the queue
long startTime = Calendar.getInstance().getTimeInMillis();
QueueExecutionStatistics.getInstance().initActionExecutionResults(QUEUE_1);
actionHandler.executeActions("IP", QUEUE_1, -1, actionRequests, pattern, new LoaderDataConfig());
long executionTime = Calendar.getInstance().getTimeInMillis() - startTime;
assertTrue(executionTime >= 4000);
assertTrue(executionTime < 6000);
expectedNumExecutions = 10;
}
use of com.axway.ats.agent.core.threading.data.config.LoaderDataConfig in project ats-framework by Axway.
the class DisabledTest_MultiThreadedActionHandler method cancelAllQueuesPositive.
@Test
public void cancelAllQueuesPositive() throws Exception {
RampUpPattern pattern = new RampUpPattern(3, false, 10, 3000);
QueueExecutionStatistics.getInstance().initActionExecutionResults(QUEUE_1);
//then start the queue
actionHandler.executeActions("IP", QUEUE_1, -1, actionRequests, pattern, new LoaderDataConfig());
//sleep until the first and second iterations are executed
Thread.sleep(3500);
assertEquals(6, LoadTestActionClass.numExecutions);
actionHandler.cancelAllQueues();
//assert nothing else was executed
Thread.sleep(3500);
assertEquals(6, LoadTestActionClass.numExecutions);
}
use of com.axway.ats.agent.core.threading.data.config.LoaderDataConfig in project ats-framework by Axway.
the class DisabledTest_MultiThreadedActionHandler method executeActionsRampUpPatternNonBlockingPositive.
@Test
public void executeActionsRampUpPatternNonBlockingPositive() throws Exception {
RampUpPattern pattern = new RampUpPattern(3, false, 10, 10000, 2000, 1);
//then start the queue
long startTime = Calendar.getInstance().getTimeInMillis();
QueueExecutionStatistics.getInstance().initActionExecutionResults(QUEUE_1);
actionHandler.executeActions("IP", QUEUE_1, -1, actionRequests, pattern, new LoaderDataConfig());
long executionTime = Calendar.getInstance().getTimeInMillis() - startTime;
// as the pattern is not blocking, we will get here right away
assertTrue(executionTime < 1000);
}
use of com.axway.ats.agent.core.threading.data.config.LoaderDataConfig 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.data.config.LoaderDataConfig 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;
}
Aggregations