Search in sources :

Example 1 with APIManagerSettingsApp

use of com.axway.apim.setup.APIManagerSettingsApp in project apim-cli by Axway-API-Management-Plus.

the class ExportManagerConfigTestAction method runTest.

@Override
public ExportResult runTest(TestContext context) {
    APIManagerSetupExportParams params = new APIManagerSetupExportParams();
    addParameters(params, context);
    params.setRemoteHostName(getVariable(context, PARAM_NAME));
    params.setRemoteHostId(getVariable(context, PARAM_ID));
    APIManagerSettingsApp app = new APIManagerSettingsApp();
    LOG.info("Running " + app.getClass().getSimpleName() + " with params: " + params);
    ExportResult result = app.runExport(params);
    if (this.getExpectedReturnCode(context) != result.getRc()) {
        throw new ValidationException("Expected RC was: " + this.getExpectedReturnCode(context) + " but got: " + result.getRc());
    }
    return result;
}
Also used : APIManagerSetupExportParams(com.axway.apim.setup.lib.APIManagerSetupExportParams) ValidationException(com.consol.citrus.exceptions.ValidationException) APIManagerSettingsApp(com.axway.apim.setup.APIManagerSettingsApp) ExportResult(com.axway.apim.lib.ExportResult)

Example 2 with APIManagerSettingsApp

use of com.axway.apim.setup.APIManagerSettingsApp in project apim-cli by Axway-API-Management-Plus.

the class ImportManagerConfigTestAction method runTest.

@Override
public void runTest(TestContext context) {
    StandardImportParams params = new StandardImportParams();
    addParameters(params, context);
    params.setConfig(this.configFile.getPath());
    APIManagerSettingsApp app = new APIManagerSettingsApp();
    LOG.info("Running " + app.getClass().getSimpleName() + " with params: " + params);
    ImportResult result = app.importConfig(params);
    if (this.getExpectedReturnCode(context) != result.getRc()) {
        throw new ValidationException("Expected RC was: " + this.getExpectedReturnCode(context) + " but got: " + result.getRc());
    }
}
Also used : ImportResult(com.axway.apim.lib.ImportResult) ValidationException(com.consol.citrus.exceptions.ValidationException) StandardImportParams(com.axway.apim.lib.StandardImportParams) APIManagerSettingsApp(com.axway.apim.setup.APIManagerSettingsApp)

Aggregations

APIManagerSettingsApp (com.axway.apim.setup.APIManagerSettingsApp)2 ValidationException (com.consol.citrus.exceptions.ValidationException)2 ExportResult (com.axway.apim.lib.ExportResult)1 ImportResult (com.axway.apim.lib.ImportResult)1 StandardImportParams (com.axway.apim.lib.StandardImportParams)1 APIManagerSetupExportParams (com.axway.apim.setup.lib.APIManagerSetupExportParams)1