Search in sources :

Example 6 with RangeDataConfig

use of com.axway.ats.agent.core.threading.data.config.RangeDataConfig 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"));
    }
}
Also used : RangeDataConfig(com.axway.ats.agent.core.threading.data.config.RangeDataConfig) AllAtOncePattern(com.axway.ats.agent.core.threading.patterns.AllAtOncePattern) LoaderDataConfig(com.axway.ats.agent.core.threading.data.config.LoaderDataConfig) Test(org.junit.Test)

Example 7 with RangeDataConfig

use of com.axway.ats.agent.core.threading.data.config.RangeDataConfig 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)));
    }
}
Also used : RangeDataConfig(com.axway.ats.agent.core.threading.data.config.RangeDataConfig) AllAtOncePattern(com.axway.ats.agent.core.threading.patterns.AllAtOncePattern) LoaderDataConfig(com.axway.ats.agent.core.threading.data.config.LoaderDataConfig) Test(org.junit.Test)

Example 8 with RangeDataConfig

use of com.axway.ats.agent.core.threading.data.config.RangeDataConfig 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"));
    }
}
Also used : RangeDataConfig(com.axway.ats.agent.core.threading.data.config.RangeDataConfig) AllAtOncePattern(com.axway.ats.agent.core.threading.patterns.AllAtOncePattern) LoaderDataConfig(com.axway.ats.agent.core.threading.data.config.LoaderDataConfig) Test(org.junit.Test)

Aggregations

RangeDataConfig (com.axway.ats.agent.core.threading.data.config.RangeDataConfig)8 Test (org.junit.Test)7 LoaderDataConfig (com.axway.ats.agent.core.threading.data.config.LoaderDataConfig)5 AllAtOncePattern (com.axway.ats.agent.core.threading.patterns.AllAtOncePattern)5 BaseTest (com.axway.ats.agent.core.BaseTest)2 ArgumentValue (com.axway.ats.agent.core.action.ArgumentValue)2 CustomParameterDataConfig (com.axway.ats.agent.core.threading.data.config.CustomParameterDataConfig)1 FileNamesDataConfig (com.axway.ats.agent.core.threading.data.config.FileNamesDataConfig)1 ListDataConfig (com.axway.ats.agent.core.threading.data.config.ListDataConfig)1 UsernameDataConfig (com.axway.ats.agent.core.threading.data.config.UsernameDataConfig)1 ParameterDataProviderInitalizationException (com.axway.ats.agent.core.threading.exceptions.ParameterDataProviderInitalizationException)1 ParameterDataProviderNotSupportedException (com.axway.ats.agent.core.threading.exceptions.ParameterDataProviderNotSupportedException)1