Search in sources :

Example 1 with ParameterDataProvider

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

the class MultiThreadedActionHandler method scheduleActions.

/**
     * @param caller
     * @param queueName
     * @param actionRequests
     * @param threadingPattern
     * @throws NoSuchComponentException
     * @throws NoSuchActionException
     * @throws NoCompatibleMethodFoundException
     * @throws ThreadingPatternNotSupportedException
     * @throws ActionExecutionException
     * @throws ActionTaskLoaderException
     * @throws LoadQueueAlreadyExistsException
     * @throws ParameterDataProviderNotSupportedException
     * @throws ParameterDataProviderInitalizationException
     */
public void scheduleActions(String caller, String queueName, int queueId, List<ActionRequest> actionRequests, ThreadingPattern threadingPattern, LoaderDataConfig loaderDataConfig, boolean isUseSynchronizedIterations) throws NoSuchComponentException, NoSuchActionException, NoCompatibleMethodFoundException, ThreadingPatternNotSupportedException, ActionExecutionException, ActionTaskLoaderException, LoadQueueAlreadyExistsException, ParameterDataProviderNotSupportedException, ParameterDataProviderInitalizationException {
    //first cleanup the queues
    cleanupFinishedQueues();
    //check if we already have this queue and it has not finished yet
    //if the queue has finished, we can simply discard it
    QueueLoader queueLoader = queueLoadersMap.get(queueName);
    if (queueLoader != null) {
        throw new LoadQueueAlreadyExistsException(queueName, queueLoader.getState());
    }
    //create the data providers
    List<ParameterDataProvider> parameterDataProviders = new ArrayList<ParameterDataProvider>();
    for (ParameterDataConfig paramDataConfigs : loaderDataConfig.getParameterConfigurations()) {
        parameterDataProviders.add(ParameterDataProviderFactory.createDataProvider(paramDataConfigs));
    }
    //create the loader
    queueLoader = LoadQueueFactory.createLoadQueue(queueName, actionRequests, threadingPattern, parameterDataProviders, listeners);
    log.rememberLoadQueueState(queueName, queueId, threadingPattern.getPatternDescription(), threadingPattern.getThreadCount());
    //start the queue
    queueLoader.scheduleThreads(caller, isUseSynchronizedIterations);
    queueLoadersMap.put(queueName, queueLoader);
    log.info("Scheduled queue '" + queueName + "'");
}
Also used : QueueLoader(com.axway.ats.agent.core.threading.QueueLoader) AbstractQueueLoader(com.axway.ats.agent.core.threading.AbstractQueueLoader) LoadQueueAlreadyExistsException(com.axway.ats.agent.core.threading.exceptions.LoadQueueAlreadyExistsException) ParameterDataProvider(com.axway.ats.agent.core.threading.data.ParameterDataProvider) ParameterDataConfig(com.axway.ats.agent.core.threading.data.config.ParameterDataConfig) ArrayList(java.util.ArrayList)

Example 2 with ParameterDataProvider

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

the class Test_LoadQueueFactory method createQueueRampUpPatternPositive.

@Test
public void createQueueRampUpPatternPositive() throws Exception {
    RampUpPattern pattern = new RampUpPattern(100, false);
    QueueLoader loader = LoadQueueFactory.createLoadQueue("test", new ArrayList<ActionRequest>(), pattern, new ArrayList<ParameterDataProvider>(), null);
    assertEquals(RampUpQueueLoader.class, loader.getClass());
}
Also used : ParameterDataProvider(com.axway.ats.agent.core.threading.data.ParameterDataProvider) FixedDurationRampUpPattern(com.axway.ats.agent.core.threading.patterns.FixedDurationRampUpPattern) RampUpPattern(com.axway.ats.agent.core.threading.patterns.RampUpPattern) ActionRequest(com.axway.ats.agent.core.action.ActionRequest) Test(org.junit.Test)

Example 3 with ParameterDataProvider

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

the class Test_LoadQueueFactory method createQueueFixedDurationAllAtOncePatternPositive.

@Test
public void createQueueFixedDurationAllAtOncePatternPositive() throws Exception {
    FixedDurationAllAtOncePattern pattern = new FixedDurationAllAtOncePattern(100, false, 30);
    QueueLoader loader = LoadQueueFactory.createLoadQueue("test", new ArrayList<ActionRequest>(), pattern, new ArrayList<ParameterDataProvider>(), null);
    assertEquals(RampUpQueueLoader.class, loader.getClass());
}
Also used : ParameterDataProvider(com.axway.ats.agent.core.threading.data.ParameterDataProvider) ActionRequest(com.axway.ats.agent.core.action.ActionRequest) FixedDurationAllAtOncePattern(com.axway.ats.agent.core.threading.patterns.FixedDurationAllAtOncePattern) Test(org.junit.Test)

Example 4 with ParameterDataProvider

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

the class Test_LoadQueueFactory method createQueueFixedDurationRampUpPatternPositive.

@Test
public void createQueueFixedDurationRampUpPatternPositive() throws Exception {
    FixedDurationRampUpPattern pattern = new FixedDurationRampUpPattern(100, false, 3600);
    QueueLoader loader = LoadQueueFactory.createLoadQueue("test", new ArrayList<ActionRequest>(), pattern, new ArrayList<ParameterDataProvider>(), null);
    assertEquals(RampUpQueueLoader.class, loader.getClass());
}
Also used : ParameterDataProvider(com.axway.ats.agent.core.threading.data.ParameterDataProvider) ActionRequest(com.axway.ats.agent.core.action.ActionRequest) FixedDurationRampUpPattern(com.axway.ats.agent.core.threading.patterns.FixedDurationRampUpPattern) Test(org.junit.Test)

Example 5 with ParameterDataProvider

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

the class Test_LoadQueueFactory method createQueueAllAtOncePatternPositive.

@Test
public void createQueueAllAtOncePatternPositive() throws Exception {
    AllAtOncePattern pattern = new AllAtOncePattern(100, false);
    QueueLoader loader = LoadQueueFactory.createLoadQueue("test", new ArrayList<ActionRequest>(), pattern, new ArrayList<ParameterDataProvider>(), null);
    assertEquals(RampUpQueueLoader.class, loader.getClass());
}
Also used : ParameterDataProvider(com.axway.ats.agent.core.threading.data.ParameterDataProvider) AllAtOncePattern(com.axway.ats.agent.core.threading.patterns.AllAtOncePattern) FixedDurationAllAtOncePattern(com.axway.ats.agent.core.threading.patterns.FixedDurationAllAtOncePattern) ActionRequest(com.axway.ats.agent.core.action.ActionRequest) Test(org.junit.Test)

Aggregations

ParameterDataProvider (com.axway.ats.agent.core.threading.data.ParameterDataProvider)8 ActionRequest (com.axway.ats.agent.core.action.ActionRequest)6 Test (org.junit.Test)6 FixedDurationAllAtOncePattern (com.axway.ats.agent.core.threading.patterns.FixedDurationAllAtOncePattern)4 BaseTest (com.axway.ats.agent.core.BaseTest)2 AllAtOncePattern (com.axway.ats.agent.core.threading.patterns.AllAtOncePattern)2 FixedDurationRampUpPattern (com.axway.ats.agent.core.threading.patterns.FixedDurationRampUpPattern)2 ActionInvoker (com.axway.ats.agent.core.action.ActionInvoker)1 AbstractQueueLoader (com.axway.ats.agent.core.threading.AbstractQueueLoader)1 QueueLoader (com.axway.ats.agent.core.threading.QueueLoader)1 ParameterDataConfig (com.axway.ats.agent.core.threading.data.config.ParameterDataConfig)1 LoadQueueAlreadyExistsException (com.axway.ats.agent.core.threading.exceptions.LoadQueueAlreadyExistsException)1 RampUpPattern (com.axway.ats.agent.core.threading.patterns.RampUpPattern)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1