use of com.axway.ats.agent.core.threading.data.config.LoaderDataConfig in project ats-framework by Axway.
the class DisabledTest_MultiThreadedActionHandlerWithParameterizedInputData method paramPresentOnlyOnceInDataProvidersTwoThreads.
@Test
public void paramPresentOnlyOnceInDataProvidersTwoThreads() 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[0]);
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"));
}
use of com.axway.ats.agent.core.threading.data.config.LoaderDataConfig in project ats-framework by Axway.
the class DisabledTest_MultiThreadedActionHandlerWithParameterizedInputData method paremterizedIntegerWithWrapUp.
@Test
public void paremterizedIntegerWithWrapUp() throws Exception {
LoaderDataConfig loaderDataConfig = new LoaderDataConfig();
loaderDataConfig.addParameterConfig(new RangeDataConfig("milliseconds", 1, 4));
AllAtOncePattern pattern = new AllAtOncePattern(5, true);
QueueExecutionStatistics.getInstance().initActionExecutionResults("test 1");
actionHandler.executeActions("IP", "test 1", -1, actionRequests, pattern, loaderDataConfig);
assertEquals(4, ParameterizedInputActionClass.addedLongs.size());
for (int i = 1; i < 5; i++) {
assertTrue(ParameterizedInputActionClass.addedLongs.contains(new Long(i)));
}
}
use of com.axway.ats.agent.core.threading.data.config.LoaderDataConfig in project ats-framework by Axway.
the class DisabledTest_MultiThreadedActionHandlerWithParameterizedInputData method threeThreadsWithThreeInvocations.
@Test
public void threeThreadsWithThreeInvocations() throws Exception {
int nThreads = 3;
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"));
assertEquals(1, (int) ParameterizedInputActionClass.addedStrings.get("X3.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 oneThreadWithThreeInvocations.
@Test
public void oneThreadWithThreeInvocations() 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[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"));
assertNull(ParameterizedInputActionClass.addedStrings.get("X2.txt"));
assertNull(ParameterizedInputActionClass.addedStrings.get("X3.txt"));
// assertEquals( 1, ( int ) ParameterizedInputActionClass.addedStrings.get( "Y1.txt" ) );
assertNull(ParameterizedInputActionClass.addedStrings.get("Y2.txt"));
// assertEquals( 1, ( int ) ParameterizedInputActionClass.addedStrings.get( "Z1.txt" ) );
assertNull(ParameterizedInputActionClass.addedStrings.get("Z2.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 paremterizedStringDataPositive.
@Test
public void paremterizedStringDataPositive() throws Exception {
LoaderDataConfig loaderDataConfig = new LoaderDataConfig();
loaderDataConfig.addParameterConfig(new RangeDataConfig("fileName", "file{0}.txt", 1, 300));
loaderDataConfig.addParameterConfig(new RangeDataConfig("fileName", "file{0}.txt", 1, 300));
AllAtOncePattern pattern = new AllAtOncePattern(5, true);
QueueExecutionStatistics.getInstance().initActionExecutionResults("test 1");
actionHandler.executeActions("IP", "test 1", -1, actionRequests, pattern, loaderDataConfig);
assertEquals(10, ParameterizedInputActionClass.getAddedStringsCount());
for (int i = 1; i < 6; i++) {
assertEquals(2, (int) ParameterizedInputActionClass.addedStrings.get("file" + i + ".txt"));
}
}
Aggregations