Search in sources :

Example 1 with LocalExecutor

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

the class EnvironmentCleanupClient method restoreFrom.

/**
     * Restore the component environment from a specific folder using a specific environment configuration
     *
     * @param componentName the name of the component
     * @param environmentName the name of the environment configuration
     * @param folderPath the backup folder to use for restore
     * @throws AgentException
     */
@PublicAtsApi
public void restoreFrom(String componentName, String environmentName, String folderPath) throws AgentException {
    log.info("Executing restore for component '" + componentName + "' using environment '" + environmentName + "' from folder '" + folderPath + "'");
    if (atsAgent.equals(LOCAL_JVM)) {
        LocalExecutor localExecutor = new LocalExecutor();
        localExecutor.restore(componentName, environmentName, folderPath);
    } else {
        RemoteExecutor remoteExecutor = new RemoteExecutor(atsAgent);
        remoteExecutor.restore(componentName, environmentName, folderPath);
    }
    log.info("Finished executing restore for component '" + componentName + "' using environment '" + environmentName + "' from folder '" + folderPath + "'");
}
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 2 with LocalExecutor

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

the class EnvironmentCleanupClient method restore.

/**
     * Restore the environment for given component with a specific environment configuration
     *
     * @param componentName the name of the component
     * @param environmentName the name of the environment configuration
     * @throws AgentException
     */
@PublicAtsApi
public void restore(String componentName, String environmentName) throws AgentException {
    log.info("Executing restore for component '" + componentName + "' using environment configuration '" + environmentName + "'");
    if (atsAgent.equals(LOCAL_JVM)) {
        LocalExecutor localExecutor = new LocalExecutor();
        localExecutor.restore(componentName, environmentName, null);
    } else {
        RemoteExecutor remoteExecutor = new RemoteExecutor(atsAgent);
        remoteExecutor.restore(componentName, environmentName, null);
    }
    log.info("Finished executing restore for component '" + componentName + "' using environment configuration '" + environmentName + "'");
}
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 3 with LocalExecutor

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

the class EnvironmentCleanupClient method backupAllComponents.

/**
     * Create backup for all registered components
     *
     * @throws AgentException
     */
@PublicAtsApi
public void backupAllComponents() throws AgentException {
    log.info("Executing backup for all registered components");
    if (atsAgent.equals(LOCAL_JVM)) {
        LocalExecutor localExecutor = new LocalExecutor();
        localExecutor.backupAll(null);
    } else {
        RemoteExecutor remoteExecutor = new RemoteExecutor(atsAgent);
        remoteExecutor.backupAll(null);
    }
    log.info("Finished executing backup 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 4 with LocalExecutor

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

the class EnvironmentCleanupClient method backupTo.

/**
     * Create backup for given component to specific backup folder
     *
     * @param componentName the name of the component
     * @param environmentName the name of the environment configuration
     * @param folderPath backup folder path
     * @throws AgentException
     */
@PublicAtsApi
public void backupTo(String componentName, String folderPath) throws AgentException {
    log.info("Executing backup for component '" + componentName + "' to folder '" + folderPath + "'");
    if (atsAgent.equals(LOCAL_JVM)) {
        LocalExecutor localExecutor = new LocalExecutor();
        localExecutor.backup(componentName, null, folderPath);
    } else {
        RemoteExecutor remoteExecutor = new RemoteExecutor(atsAgent);
        remoteExecutor.backup(componentName, null, folderPath);
    }
    log.info("Finished executing backup for component '" + componentName + "' to folder '" + folderPath + "'");
}
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 5 with LocalExecutor

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

the class Test_LocalExecutor method executeActionPositive.

@Test
public void executeActionPositive() throws Exception {
    LocalExecutor localExecutor = new LocalExecutor();
    localExecutor.executeAction(new ActionRequest(TEST_COMPONENT_NAME, "action 1", new Object[] { 1 }));
    assertEquals(1, ActionClassOne.ACTION_VALUE);
}
Also used : ActionRequest(com.axway.ats.agent.core.action.ActionRequest) 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