use of com.axway.ats.agent.core.action.ActionRequest in project ats-framework by Axway.
the class Test_LoadQueueFactory method createQueueFixedDurationRampUpPatternPositive.
@Test
public void createQueueFixedDurationRampUpPatternPositive() throws Exception {
FixedDurationRampUpPattern pattern = new FixedDurationRampUpPattern(100, false, 3600);
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.action.ActionRequest in project ats-framework by Axway.
the class DisabledTest_RampUpLoaderMultipleInvocations method cancelTasksDuringExecutionPositive.
@Test
public void cancelTasksDuringExecutionPositive() throws Exception {
ActionRequest actionRequest = new ActionRequest(TEST_COMPONENT_NAME, "sleep action", new Object[] { "10000" });
ArrayList<ActionRequest> newActionRequests = new ArrayList<ActionRequest>();
newActionRequests.add(actionRequest);
RampUpPattern pattern = new RampUpPattern(3, false, 10, 0);
loader = LoadQueueFactory.createLoadQueue(QUEUE_NAME, newActionRequests, 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();
Thread.sleep(1000);
loader.cancel();
//assert that only the first execution took place
assertEquals(3, LoadTestActionClass.numExecutions);
}
use of com.axway.ats.agent.core.action.ActionRequest in project ats-framework by Axway.
the class DisabledTest_RampUpLoaderMultipleInvocations method allAtOnceExceptionThrownInAction.
@Test
public void allAtOnceExceptionThrownInAction() throws Exception {
AllAtOncePattern pattern = new AllAtOncePattern(50, true);
ActionRequest actionRequest = new ActionRequest(TEST_COMPONENT_NAME, "exception action", new Object[] {});
ArrayList<ActionRequest> newActionRequests = new ArrayList<ActionRequest>();
newActionRequests.add(actionRequest);
loader = LoadQueueFactory.createLoadQueue(QUEUE_NAME, newActionRequests, pattern, new ArrayList<ParameterDataProvider>(), null);
//first schedule the threads
loader.scheduleThreads("IP", false);
Thread.sleep(1);
QueueExecutionStatistics.getInstance().initActionExecutionResults(QUEUE_NAME);
//then start the loader
loader.start();
assertEquals(0, LoadTestActionClass.numExecutions);
}
use of com.axway.ats.agent.core.action.ActionRequest in project ats-framework by Axway.
the class Test_LoadQueueFactory method createQueueAllAtOncePatternPositive.
@Test
public void createQueueAllAtOncePatternPositive() throws Exception {
AllAtOncePattern pattern = new AllAtOncePattern(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.action.ActionRequest in project ats-framework by Axway.
the class Test_LocalExecutor method executeActionPositive.
@Test
public void executeActionPositive() throws Exception {
LocalExecutor localExecutor = new LocalExecutor();
localExecutor.executeAction(new ActionRequest(TEST_COMPONENT_NAME, "action 1", new Object[] { 1 }));
assertEquals(1, ActionClassOne.ACTION_VALUE);
}
Aggregations