Search in sources :

Example 6 with ListDataConfig

use of com.axway.ats.agent.core.threading.data.config.ListDataConfig in project ats-framework by Axway.

the class Test_QueueCanceling method allAtOnce_OneThreadRunning_OneThreadPaused.

/**
     * We cancel 1 thread while running its 1st iteration and 2nd thread while waiting between its 1st and 2nd iterations
     */
@Test
public void allAtOnce_OneThreadRunning_OneThreadPaused() throws Exception {
    expectedNumExecutions = 2;
    ListDataConfig parameterData = new ListDataConfig("sleepTime", Arrays.asList(new String[] { "500", "2000" }), ParameterProviderLevel.PER_THREAD_STATIC);
    LoaderDataConfig loaderDataConfig = new LoaderDataConfig();
    loaderDataConfig.addParameterConfig(parameterData);
    actionRequests.add(new ActionRequest(TEST_COMPONENT_NAME, ACTION_SLEEP, new Object[] { "sleepTime" }));
    AllAtOncePattern pattern = new AllAtOncePattern(2, false, 2, 1000);
    QueueExecutionStatistics.getInstance().initActionExecutionResults(QUEUE_NAME);
    actionHandler.scheduleActions(HOST, QUEUE_NAME, -1, actionRequests, pattern, loaderDataConfig, false);
    actionHandler.startQueue(QUEUE_NAME);
    Thread.sleep(1000);
}
Also used : AllAtOncePattern(com.axway.ats.agent.core.threading.patterns.AllAtOncePattern) ActionRequest(com.axway.ats.agent.core.action.ActionRequest) ListDataConfig(com.axway.ats.agent.core.threading.data.config.ListDataConfig) LoaderDataConfig(com.axway.ats.agent.core.threading.data.config.LoaderDataConfig) Test(org.junit.Test)

Aggregations

ListDataConfig (com.axway.ats.agent.core.threading.data.config.ListDataConfig)6 ActionRequest (com.axway.ats.agent.core.action.ActionRequest)4 Test (org.junit.Test)4 LoaderDataConfig (com.axway.ats.agent.core.threading.data.config.LoaderDataConfig)3 AllAtOncePattern (com.axway.ats.agent.core.threading.patterns.AllAtOncePattern)3 BaseTest (com.axway.ats.agent.core.BaseTest)1 ArgumentValue (com.axway.ats.agent.core.action.ArgumentValue)1 CustomParameterDataConfig (com.axway.ats.agent.core.threading.data.config.CustomParameterDataConfig)1 FileNamesDataConfig (com.axway.ats.agent.core.threading.data.config.FileNamesDataConfig)1 RangeDataConfig (com.axway.ats.agent.core.threading.data.config.RangeDataConfig)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 BeforeClass (org.junit.BeforeClass)1