use of com.axway.ats.agent.core.threading.data.config.LoaderDataConfig in project ats-framework by Axway.
the class DisabledTest_MultiThreadedActionHandler method cancelAllQueuesFinishedTasksPositive.
@Test
public void cancelAllQueuesFinishedTasksPositive() throws Exception {
RampUpPattern pattern = new RampUpPattern(3, false, 3, 0);
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(1000);
expectedNumExecutions = 9;
}
use of com.axway.ats.agent.core.threading.data.config.LoaderDataConfig in project ats-framework by Axway.
the class DisabledTest_MultiThreadedActionHandlerWithParameterizedInputData method twoThreadsWithThreeInvocations.
@Test
public void twoThreadsWithThreeInvocations() throws Exception {
int nThreads = 2;
int nInvocations = 3;
List<ActionRequest> actions = new ArrayList<ActionRequest>();
LoaderDataConfig loaderDataConfig = new LoaderDataConfig();
for (int i = 0; i < nInvocations; i++) {
actions.add(fileUploadActionRequest);
loaderDataConfig.addParameterConfig(parameterDataProviders[i]);
}
AllAtOncePattern pattern = new AllAtOncePattern(nThreads, true);
QueueExecutionStatistics.getInstance().initActionExecutionResults("test 1");
actionHandler.executeActions("IP", "test 1", -1, actions, pattern, loaderDataConfig);
assertEquals(nInvocations * nThreads, ParameterizedInputActionClass.getAddedStringsCount());
assertEquals(1, (int) ParameterizedInputActionClass.addedStrings.get("X1.txt"));
assertEquals(1, (int) ParameterizedInputActionClass.addedStrings.get("X2.txt"));
assertNull(ParameterizedInputActionClass.addedStrings.get("X3.txt"));
assertNull(ParameterizedInputActionClass.addedStrings.get("Z3.txt"));
assertNull(ParameterizedInputActionClass.addedStrings.get("Z4.txt"));
}
use of com.axway.ats.agent.core.threading.data.config.LoaderDataConfig in project ats-framework by Axway.
the class DisabledTest_MultiThreadedActionHandlerWithParameterizedInputData method fourThreadsWithThreeInvocations.
@Test
public void fourThreadsWithThreeInvocations() throws Exception {
int nThreads = 4;
int nInvocations = 3;
List<ActionRequest> actions = new ArrayList<ActionRequest>();
LoaderDataConfig loaderDataConfig = new LoaderDataConfig();
for (int i = 0; i < nInvocations; i++) {
actions.add(fileUploadActionRequest);
loaderDataConfig.addParameterConfig(parameterDataProviders[i]);
}
AllAtOncePattern pattern = new AllAtOncePattern(nThreads, true);
QueueExecutionStatistics.getInstance().initActionExecutionResults("test 1");
actionHandler.executeActions("IP", "test 1", -1, actions, pattern, loaderDataConfig);
assertEquals(nInvocations * nThreads, ParameterizedInputActionClass.getAddedStringsCount());
assertEquals(2, (int) ParameterizedInputActionClass.addedStrings.get("X1.txt"));
assertEquals(1, (int) ParameterizedInputActionClass.addedStrings.get("X2.txt"));
assertEquals(1, (int) ParameterizedInputActionClass.addedStrings.get("X3.txt"));
}
use of com.axway.ats.agent.core.threading.data.config.LoaderDataConfig in project ats-framework by Axway.
the class DisabledTest_MultiThreadedActionHandler method scheduleActionsNegativeQueueAlreadyExists.
@Test(expected = LoadQueueAlreadyExistsException.class)
public void scheduleActionsNegativeQueueAlreadyExists() throws Exception {
RampUpPattern pattern = new RampUpPattern(10, true, 1, 0, 5000, 2);
actionHandler.scheduleActions("IP", QUEUE_1, -1, actionRequests, pattern, new LoaderDataConfig(), false);
actionHandler.scheduleActions("IP", QUEUE_1, -1, actionRequests, pattern, new LoaderDataConfig(), false);
}
use of com.axway.ats.agent.core.threading.data.config.LoaderDataConfig in project ats-framework by Axway.
the class DisabledTest_MultiThreadedActionHandler method waitUntilAllQueuesFinishPositiveStateDifferentThanRunning.
@Test
public void waitUntilAllQueuesFinishPositiveStateDifferentThanRunning() throws Exception {
RampUpPattern pattern = new RampUpPattern(3, false, 3, 1000, 200, 2);
QueueExecutionStatistics.getInstance().initActionExecutionResults(QUEUE_1);
//first queue finished
actionHandler.executeActions("IP", QUEUE_1, -1, actionRequests, new AllAtOncePattern(1, true), new LoaderDataConfig());
QueueExecutionStatistics.getInstance().initActionExecutionResults(QUEUE_2);
//second queue running
actionHandler.executeActions("IP", QUEUE_2, -1, actionRequests, pattern, new LoaderDataConfig());
//third queue scheduled
actionHandler.scheduleActions("IP", "test 3", -1, actionRequests, pattern, new LoaderDataConfig(), false);
//wait until the queue finishes
actionHandler.waitUntilAllQueuesFinish();
expectedNumExecutions = 10;
}
Aggregations