use of com.axway.ats.agent.core.threading.patterns.RampUpPattern in project ats-framework by Axway.
the class DisabledTest_RampUpLoaderMultipleInvocations method rampUpPatternNoRampUpNonBlockingPositive.
@Test
public void rampUpPatternNoRampUpNonBlockingPositive() throws Exception {
RampUpPattern pattern = new RampUpPattern(3, false, 10, 10000);
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);
//then start the loader
long startTime = Calendar.getInstance().getTimeInMillis();
QueueExecutionStatistics.getInstance().initActionExecutionResults(QUEUE_NAME);
loader.start();
long executionTime = Calendar.getInstance().getTimeInMillis() - startTime;
assertTrue(executionTime < 1000);
loader.cancel();
}
use of com.axway.ats.agent.core.threading.patterns.RampUpPattern in project ats-framework by Axway.
the class DisabledTest_RampUpLoaderMultipleInvocations method rampUpPatternNonBlockingPositive.
@Test
public void rampUpPatternNonBlockingPositive() throws Exception {
RampUpPattern pattern = new RampUpPattern(3, false, 10, 10000, 2000, 1);
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);
//then start the loader
long startTime = Calendar.getInstance().getTimeInMillis();
QueueExecutionStatistics.getInstance().initActionExecutionResults(QUEUE_NAME);
loader.start();
long executionTime = Calendar.getInstance().getTimeInMillis() - startTime;
// as the pattern is not blocking, we will get here right away
assertTrue(executionTime < 1000);
Thread.sleep(2000);
loader.cancel();
}
use of com.axway.ats.agent.core.threading.patterns.RampUpPattern in project ats-framework by Axway.
the class Test_LoadQueueFactory method createQueueRampUpPatternPositive.
@Test
public void createQueueRampUpPatternPositive() throws Exception {
RampUpPattern pattern = new RampUpPattern(100, false);
QueueLoader loader = LoadQueueFactory.createLoadQueue("test", new ArrayList<ActionRequest>(), pattern, new ArrayList<ParameterDataProvider>(), null);
assertEquals(RampUpQueueLoader.class, loader.getClass());
}
use of com.axway.ats.agent.core.threading.patterns.RampUpPattern in project ats-framework by Axway.
the class DisabledTest_RampUpLoaderMultipleInvocations method rampUpPatternBlockingMultipleInvocationsWithDelayPositive.
@Test
public void rampUpPatternBlockingMultipleInvocationsWithDelayPositive() throws Exception {
RampUpPattern pattern = new RampUpPattern(2, true, 4, 1000);
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);
//then start the loader
long startTime = Calendar.getInstance().getTimeInMillis();
QueueExecutionStatistics.getInstance().initActionExecutionResults(QUEUE_NAME);
loader.start();
long endTime = Calendar.getInstance().getTimeInMillis();
assertEquals(8, LoadTestActionClass.numExecutions);
assertTrue(endTime - startTime > 3000);
}
use of com.axway.ats.agent.core.threading.patterns.RampUpPattern in project ats-framework by Axway.
the class DisabledTest_RampUpLoaderMultipleInvocations method rampUpPatternBlockingWithRampUpPositive.
@Test
public void rampUpPatternBlockingWithRampUpPositive() throws Exception {
RampUpPattern pattern = new RampUpPattern(10, true, 1, 0, 1000, 2);
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);
//then start the loader
long startTime = Calendar.getInstance().getTimeInMillis();
QueueExecutionStatistics.getInstance().initActionExecutionResults(QUEUE_NAME);
loader.start();
long executionTime = Calendar.getInstance().getTimeInMillis() - startTime;
assertEquals(10, LoadTestActionClass.numExecutions);
assertTrue(executionTime > 4000);
assertTrue(executionTime < 6000);
}
Aggregations