use of com.axway.ats.agent.core.threading.data.config.LoaderDataConfig in project ats-framework by Axway.
the class DisabledTest_MultiThreadedActionHandlerWithParameterizedInputData method paramPresentInDataProvidersLessTimeThanInTheInvokers.
@Test
public void paramPresentInDataProvidersLessTimeThanInTheInvokers() throws Exception {
int nThreads = 1;
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[0]);
loaderDataConfig.addParameterConfig(parameterDataProviders[1]);
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"));
assertNull(ParameterizedInputActionClass.addedStrings.get("X2.txt"));
assertNull(ParameterizedInputActionClass.addedStrings.get("X3.txt"));
assertNull(ParameterizedInputActionClass.addedStrings.get("Y2.txt"));
}
use of com.axway.ats.agent.core.threading.data.config.LoaderDataConfig in project ats-framework by Axway.
the class DisabledTest_MultiThreadedActionHandlerWithParameterizedInputData method threeThreadsWithTwoInvocations.
@Test
public void threeThreadsWithTwoInvocations() throws Exception {
int nThreads = 3;
int nInvocations = 2;
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"));
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_MultiThreadedActionHandlerWithParameterizedInputData method paremterizedStringWithWrapUp.
@Test
public void paremterizedStringWithWrapUp() throws Exception {
LoaderDataConfig loaderDataConfig = new LoaderDataConfig();
loaderDataConfig.addParameterConfig(new RangeDataConfig("fileName", "file{0}.txt", 1, 4));
loaderDataConfig.addParameterConfig(new RangeDataConfig("fileName", "file{0}.txt", 1, 4));
AllAtOncePattern pattern = new AllAtOncePattern(5, true);
QueueExecutionStatistics.getInstance().initActionExecutionResults("test 1");
actionHandler.executeActions("IP", "test 1", -1, actionRequests, pattern, loaderDataConfig);
assertEquals(10, ParameterizedInputActionClass.getAddedStringsCount());
//"file1.txt" one should be passed twice per method
assertEquals(4, (int) ParameterizedInputActionClass.addedStrings.get("file1.txt"));
for (int i = 2; i < 5; i++) {
assertEquals(2, (int) ParameterizedInputActionClass.addedStrings.get("file" + i + ".txt"));
}
}
use of com.axway.ats.agent.core.threading.data.config.LoaderDataConfig in project ats-framework by Axway.
the class DisabledTest_MultiThreadedActionHandlerWithParameterizedInputData method fourThreadsWithTwoInvocations.
@Test
public void fourThreadsWithTwoInvocations() throws Exception {
int nThreads = 4;
int nInvocations = 2;
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_MultiThreadedActionHandlerWithParameterizedInputData method paramPresentInDataProvidersButNotInActions.
@Test
public void paramPresentInDataProvidersButNotInActions() throws Exception {
List<ActionRequest> actions = new ArrayList<ActionRequest>();
actions.add(actionRequests.get(2));
LoaderDataConfig loaderDataConfig = new LoaderDataConfig();
loaderDataConfig.addParameterConfig(parameterDataProviders[0]);
AllAtOncePattern pattern = new AllAtOncePattern(1, true);
QueueExecutionStatistics.getInstance().initActionExecutionResults("test 1");
actionHandler.executeActions("IP", "test 1", -1, actions, pattern, loaderDataConfig);
assertEquals(0, ParameterizedInputActionClass.getAddedStringsCount());
}
Aggregations