Search in sources :

Example 11 with LocalExecutor

use of com.axway.ats.agent.webapp.client.executors.LocalExecutor in project ats-framework by Axway.

the class EnvironmentCleanupClient method restoreAllComponents.

/**
     * Restore the environment for all components
     *
     * @throws AgentException
     */
@PublicAtsApi
public void restoreAllComponents() throws AgentException {
    log.info("Executing restore for all registered components");
    if (atsAgent.equals(LOCAL_JVM)) {
        LocalExecutor localExecutor = new LocalExecutor();
        localExecutor.restoreAll(null);
    } else {
        RemoteExecutor remoteExecutor = new RemoteExecutor(atsAgent);
        remoteExecutor.restoreAll(null);
    }
    log.info("Finished executing restore for all registered components");
}
Also used : RemoteExecutor(com.axway.ats.agent.webapp.client.executors.RemoteExecutor) LocalExecutor(com.axway.ats.agent.webapp.client.executors.LocalExecutor) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 12 with LocalExecutor

use of com.axway.ats.agent.webapp.client.executors.LocalExecutor in project ats-framework by Axway.

the class Test_LocalExecutor method cleanAllPositive.

@Test
public void cleanAllPositive() throws Exception {
    expect(EnvironmentHandler.getInstance()).andReturn(mockEnvironmentHandler);
    mockEnvironmentHandler.restoreAll(null);
    replayAll();
    LocalExecutor localExecutor = new LocalExecutor();
    localExecutor.restoreAll(null);
}
Also used : LocalExecutor(com.axway.ats.agent.webapp.client.executors.LocalExecutor) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Example 13 with LocalExecutor

use of com.axway.ats.agent.webapp.client.executors.LocalExecutor in project ats-framework by Axway.

the class Test_LocalExecutor method backupAllPositive.

@Test
public void backupAllPositive() throws Exception {
    expect(EnvironmentHandler.getInstance()).andReturn(mockEnvironmentHandler);
    mockEnvironmentHandler.backupAll(null);
    replayAll();
    LocalExecutor localExecutor = new LocalExecutor();
    localExecutor.backupAll(null);
}
Also used : LocalExecutor(com.axway.ats.agent.webapp.client.executors.LocalExecutor) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Example 14 with LocalExecutor

use of com.axway.ats.agent.webapp.client.executors.LocalExecutor in project ats-framework by Axway.

the class Test_LocalExecutor method waitUntilAllQueuesFinishPositive.

@Test
public void waitUntilAllQueuesFinishPositive() throws Exception {
    expect(MultiThreadedActionHandler.getInstance(ThreadsPerCaller.getCaller())).andReturn(mockMultiThreadedActionHandler);
    mockMultiThreadedActionHandler.waitUntilAllQueuesFinish();
    replayAll();
    LocalExecutor localExecutor = new LocalExecutor();
    localExecutor.waitUntilQueueFinish();
}
Also used : LocalExecutor(com.axway.ats.agent.webapp.client.executors.LocalExecutor) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Example 15 with LocalExecutor

use of com.axway.ats.agent.webapp.client.executors.LocalExecutor in project ats-framework by Axway.

the class Test_LocalExecutor method cleanPositive.

@Test
public void cleanPositive() throws Exception {
    expect(EnvironmentHandler.getInstance()).andReturn(mockEnvironmentHandler);
    mockEnvironmentHandler.restore(TEST_COMPONENT_NAME, null, null);
    replayAll();
    LocalExecutor localExecutor = new LocalExecutor();
    localExecutor.restore(TEST_COMPONENT_NAME, null, null);
}
Also used : LocalExecutor(com.axway.ats.agent.webapp.client.executors.LocalExecutor) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Aggregations

LocalExecutor (com.axway.ats.agent.webapp.client.executors.LocalExecutor)16 RemoteExecutor (com.axway.ats.agent.webapp.client.executors.RemoteExecutor)10 PublicAtsApi (com.axway.ats.common.PublicAtsApi)9 Test (org.junit.Test)6 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)6 ActionRequest (com.axway.ats.agent.core.action.ActionRequest)3 AbstractClientExecutor (com.axway.ats.agent.webapp.client.executors.AbstractClientExecutor)1