use of com.axway.ats.agent.core.action.ActionRequest in project ats-framework by Axway.
the class Test_QueueCanceling method allAtOnce_SetMaxSpeed.
@Test
public void allAtOnce_SetMaxSpeed() throws Exception {
expectedNumExecutions = 9;
actionRequests.add(new ActionRequest(TEST_COMPONENT_NAME, ACTION_SLEEP, new Object[] { "500" }));
AllAtOncePattern pattern = new AllAtOncePattern(9, false);
pattern.setExecutionSpeed(30, 15);
QueueExecutionStatistics.getInstance().initActionExecutionResults(QUEUE_NAME);
actionHandler.scheduleActions(HOST, QUEUE_NAME, -1, actionRequests, pattern, new LoaderDataConfig(), false);
actionHandler.startQueue(QUEUE_NAME);
Thread.sleep(1500);
}
use of com.axway.ats.agent.core.action.ActionRequest in project ats-framework by Axway.
the class Test_QueueCanceling method allAtOnce_SynchronizedActions.
/**
* 2 threads are run synchronized, 1 thread will do its iteration and will be put in sleep by
* the Thread Manager waiting until the 2 (slower) finish its iteration.
* This is the moment we will cancel the queue.
*/
@Test
public void allAtOnce_SynchronizedActions() throws Exception {
expectedNumExecutions = 2;
final String paramName = "sleepTime";
ListDataConfig parameterData = new ListDataConfig(paramName, Arrays.asList(new String[] { "500", "1500" }), ParameterProviderLevel.PER_THREAD_STATIC);
LoaderDataConfig loaderDataConfig = new LoaderDataConfig();
loaderDataConfig.addParameterConfig(parameterData);
actionRequests.add(new ActionRequest(TEST_COMPONENT_NAME, ACTION_SLEEP, new Object[] { paramName }));
AllAtOncePattern pattern = new AllAtOncePattern(2, false, 2, 0);
pattern.setUseSynchronizedIterations(true);
QueueExecutionStatistics.getInstance().initActionExecutionResults(QUEUE_NAME);
actionHandler.scheduleActions(HOST, QUEUE_NAME, -1, actionRequests, pattern, loaderDataConfig, true);
actionHandler.startQueue(QUEUE_NAME);
Thread.sleep(1000);
}
use of com.axway.ats.agent.core.action.ActionRequest in project ats-framework by Axway.
the class DisabledTest_RampUpLoaderMultipleInvocations method setUp.
@Before
public void setUp() throws AgentException, InterruptedException {
ActionRequest actionRequest = new ActionRequest(TEST_COMPONENT_NAME, "sleep action", new Object[] { "3" });
actionRequests = new ArrayList<ActionRequest>();
actionRequests.add(actionRequest);
synchronized (LoadTestActionClass.class) {
LoadTestActionClass.numExecutions = 0;
log.warn("clean numInvocations=" + LoadTestActionClass.numExecutions);
}
}
use of com.axway.ats.agent.core.action.ActionRequest 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());
}
use of com.axway.ats.agent.core.action.ActionRequest 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());
}
Aggregations