Search in sources :

Example 11 with LoaderDataConfig

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

the class DisabledTest_MultiThreadedActionHandler method cancelAllQueuesBeforeStartPositive.

@Test
public void cancelAllQueuesBeforeStartPositive() throws Exception {
    RampUpPattern pattern = new RampUpPattern(3, true, 10, 3000);
    QueueExecutionStatistics.getInstance().initActionExecutionResults(QUEUE_1);
    //first schedule the threads
    actionHandler.scheduleActions("IP", QUEUE_1, -1, actionRequests, pattern, new LoaderDataConfig(), false);
    actionHandler.cancelAllQueues();
    expectedNumExecutions = 0;
}
Also used : RampUpPattern(com.axway.ats.agent.core.threading.patterns.RampUpPattern) LoaderDataConfig(com.axway.ats.agent.core.threading.data.config.LoaderDataConfig) Test(org.junit.Test)

Example 12 with LoaderDataConfig

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

the class DisabledTest_MultiThreadedActionHandler method executeActionsAllAtOncePatternBlockingVerifyNoDelay.

@Test
public void executeActionsAllAtOncePatternBlockingVerifyNoDelay() throws Exception {
    AllAtOncePattern pattern = new AllAtOncePattern(5, true);
    long startTime = Calendar.getInstance().getTimeInMillis();
    QueueExecutionStatistics.getInstance().initActionExecutionResults(QUEUE_1);
    actionHandler.executeActions("IP", QUEUE_1, -1, actionRequests, pattern, new LoaderDataConfig());
    long endTime = Calendar.getInstance().getTimeInMillis();
    assertTrue(endTime - startTime < 1000);
}
Also used : AllAtOncePattern(com.axway.ats.agent.core.threading.patterns.AllAtOncePattern) LoaderDataConfig(com.axway.ats.agent.core.threading.data.config.LoaderDataConfig) Test(org.junit.Test)

Example 13 with LoaderDataConfig

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

the class DisabledTest_MultiThreadedActionHandler method scheduleActionsRampUpPatternBlockingWithRampUpPositive.

@Test
public void scheduleActionsRampUpPatternBlockingWithRampUpPositive() throws Exception {
    RampUpPattern pattern = new RampUpPattern(10, true, 1, 0, 5000, 2);
    //then start the queue
    long startTime = Calendar.getInstance().getTimeInMillis();
    actionHandler.scheduleActions("IP", QUEUE_1, -1, actionRequests, pattern, new LoaderDataConfig(), false);
    long executionTime = Calendar.getInstance().getTimeInMillis() - startTime;
    assertTrue(executionTime < 1000);
}
Also used : RampUpPattern(com.axway.ats.agent.core.threading.patterns.RampUpPattern) LoaderDataConfig(com.axway.ats.agent.core.threading.data.config.LoaderDataConfig) Test(org.junit.Test)

Example 14 with LoaderDataConfig

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

the class DisabledTest_MultiThreadedActionHandler method finishedQueuesAreCleanedUpOnSchedule.

@Test
public void finishedQueuesAreCleanedUpOnSchedule() throws Exception {
    AllAtOncePattern pattern = new AllAtOncePattern(1, true);
    QueueExecutionStatistics.getInstance().initActionExecutionResults(QUEUE_1);
    //first queue finished
    actionHandler.executeActions("IP", QUEUE_1, -1, actionRequests, pattern, new LoaderDataConfig());
    //second queue running
    actionHandler.executeActions("IP", QUEUE_1, -1, actionRequests, pattern, new LoaderDataConfig());
    //wait until the queue finishes
    actionHandler.waitUntilAllQueuesFinish();
}
Also used : AllAtOncePattern(com.axway.ats.agent.core.threading.patterns.AllAtOncePattern) LoaderDataConfig(com.axway.ats.agent.core.threading.data.config.LoaderDataConfig) Test(org.junit.Test)

Example 15 with LoaderDataConfig

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

the class DisabledTest_MultiThreadedActionHandler method executeActionsAllAtOncePatternBlockingPositive.

@Test
public void executeActionsAllAtOncePatternBlockingPositive() throws Exception {
    AllAtOncePattern pattern = new AllAtOncePattern(5, true);
    QueueExecutionStatistics.getInstance().initActionExecutionResults(QUEUE_1);
    actionHandler.executeActions("IP", QUEUE_1, -1, actionRequests, pattern, new LoaderDataConfig());
    expectedNumExecutions = 5;
}
Also used : AllAtOncePattern(com.axway.ats.agent.core.threading.patterns.AllAtOncePattern) LoaderDataConfig(com.axway.ats.agent.core.threading.data.config.LoaderDataConfig) Test(org.junit.Test)

Aggregations

LoaderDataConfig (com.axway.ats.agent.core.threading.data.config.LoaderDataConfig)50 Test (org.junit.Test)47 AllAtOncePattern (com.axway.ats.agent.core.threading.patterns.AllAtOncePattern)30 ActionRequest (com.axway.ats.agent.core.action.ActionRequest)26 RampUpPattern (com.axway.ats.agent.core.threading.patterns.RampUpPattern)18 ArrayList (java.util.ArrayList)16 RangeDataConfig (com.axway.ats.agent.core.threading.data.config.RangeDataConfig)5 AgentException (com.axway.ats.agent.core.exceptions.AgentException)3 ListDataConfig (com.axway.ats.agent.core.threading.data.config.ListDataConfig)3 ThreadingPattern (com.axway.ats.agent.core.threading.patterns.ThreadingPattern)2 IOException (java.io.IOException)2 ActionExecutionException (com.axway.ats.agent.core.exceptions.ActionExecutionException)1 InternalComponentException (com.axway.ats.agent.core.exceptions.InternalComponentException)1 NoCompatibleMethodFoundException (com.axway.ats.agent.core.exceptions.NoCompatibleMethodFoundException)1 NoSuchActionException (com.axway.ats.agent.core.exceptions.NoSuchActionException)1 NoSuchComponentException (com.axway.ats.agent.core.exceptions.NoSuchComponentException)1 ImportantThread (com.axway.ats.agent.core.threading.ImportantThread)1 ActionWrapper (com.axway.ats.agent.webapp.client.ActionWrapper)1 AgentException_Exception (com.axway.ats.agent.webapp.client.AgentException_Exception)1 AgentService (com.axway.ats.agent.webapp.client.AgentService)1