use of com.axway.ats.agent.core.threading.data.config.LoaderDataConfig in project ats-framework by Axway.
the class DisabledTest_MultiThreadedActionHandler method executeActionsRampUpPatternBlockingWithRampUpPositiveMultipleInvocations.
@Test
public void executeActionsRampUpPatternBlockingWithRampUpPositiveMultipleInvocations() throws Exception {
RampUpPattern pattern = new RampUpPattern(10, true, 2, 1000, 2000, 5);
//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 = 20;
}
use of com.axway.ats.agent.core.threading.data.config.LoaderDataConfig in project ats-framework by Axway.
the class DisabledTest_MultiThreadedActionHandler method startRampUpPatternBlockingWithRampUpPositive.
@Test
public void startRampUpPatternBlockingWithRampUpPositive() throws Exception {
RampUpPattern pattern = new RampUpPattern(10, true, 1, 0, 1000, 2);
actionHandler.scheduleActions("IP", QUEUE_1, -1, actionRequests, pattern, new LoaderDataConfig(), false);
//then start the queue
long startTime = Calendar.getInstance().getTimeInMillis();
actionHandler.startQueue(QUEUE_1);
long executionTime = Calendar.getInstance().getTimeInMillis() - startTime;
assertTrue(executionTime >= 4000);
assertTrue(executionTime < 7000);
expectedNumExecutions = 10;
}
use of com.axway.ats.agent.core.threading.data.config.LoaderDataConfig in project ats-framework by Axway.
the class DisabledTest_MultiThreadedActionHandler method getRunningQueuesCountPositive.
@Test
public void getRunningQueuesCountPositive() throws Exception {
RampUpPattern pattern = new RampUpPattern(3, false, 3, 1000, 200, 2);
assertEquals(0, actionHandler.getRunningQueuesCount());
QueueExecutionStatistics.getInstance().initActionExecutionResults(QUEUE_1);
//first queue finished
actionHandler.executeActions("IP", QUEUE_1, -1, actionRequests, pattern, new LoaderDataConfig());
assertEquals(1, actionHandler.getRunningQueuesCount());
QueueExecutionStatistics.getInstance().initActionExecutionResults(QUEUE_2);
//second queue running
actionHandler.executeActions("IP", QUEUE_2, -1, actionRequests, pattern, new LoaderDataConfig());
assertEquals(2, actionHandler.getRunningQueuesCount());
//third queue scheduled
actionHandler.scheduleActions("IP", "test 3", -1, actionRequests, pattern, new LoaderDataConfig(), false);
assertEquals(2, actionHandler.getRunningQueuesCount());
//wait until the queue finishes
actionHandler.waitUntilAllQueuesFinish();
assertEquals(0, actionHandler.getRunningQueuesCount());
}
use of com.axway.ats.agent.core.threading.data.config.LoaderDataConfig in project ats-framework by Axway.
the class DisabledTest_MultiThreadedActionHandler method startRampUpPatternNonBlockingPositive.
@Test
public void startRampUpPatternNonBlockingPositive() throws Exception {
RampUpPattern pattern = new RampUpPattern(3, false, 10, 10000, 2000, 1);
QueueExecutionStatistics.getInstance().initActionExecutionResults(QUEUE_1);
actionHandler.scheduleActions("IP", QUEUE_1, -1, actionRequests, pattern, new LoaderDataConfig(), false);
//then start the queue
long startTime = Calendar.getInstance().getTimeInMillis();
actionHandler.startQueue(QUEUE_1);
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 waitUntilAcitonQueueFinishesPositive.
@Test
public void waitUntilAcitonQueueFinishesPositive() throws Exception {
RampUpPattern pattern = new RampUpPattern(3, true, 3, 1000, 200, 2);
QueueExecutionStatistics.getInstance().initActionExecutionResults(QUEUE_1);
//then start the queue
actionHandler.executeActions("IP", QUEUE_1, -1, actionRequests, pattern, new LoaderDataConfig());
//wait until the queue finishes
actionHandler.waitUntilQueueFinish(QUEUE_1);
expectedNumExecutions = 9;
}
Aggregations