use of com.consol.citrus.exceptions.ValidationException in project apim-cli by Axway-API-Management-Plus.
the class ImportAppTestAction method runTest.
@Override
public void runTest(TestContext context) {
AppImportParams params = new AppImportParams();
addParameters(params, context);
params.setConfig(this.configFile.getPath());
ClientApplicationImportApp app = new ClientApplicationImportApp();
LOG.info("Running " + app.getClass().getSimpleName() + " with params: " + params);
ImportResult result = app.importApp(params);
if (this.getExpectedReturnCode(context) != result.getRc()) {
throw new ValidationException("Expected RC was: " + this.getExpectedReturnCode(context) + " but got: " + result.getRc());
}
}
use of com.consol.citrus.exceptions.ValidationException in project apim-cli by Axway-API-Management-Plus.
the class CLIAbstractImportTestAction method copyTestAssets.
private void copyTestAssets(File sourceDir, File testDir) {
if (!sourceDir.exists()) {
throw new ValidationException("Unable to copy test assets to test directory: '" + testDir + "'. Could not find sourceDir: '" + sourceDir + "'");
}
FileFilter filter = new WildcardFileFilter(new String[] { "*.crt", "*.jpg", "*.png", "*.pem" });
try {
LOG.info("Copy *.crt, *.jpg, *.png, *.pem from source: " + sourceDir + " into test-dir: '" + testDir + "'");
FileUtils.copyDirectory(sourceDir, testDir, filter, true);
} catch (IOException e) {
LOG.error("Unable to copy test assets from source: '" + sourceDir + "' into test directory: '" + testDir + "'", e);
}
}
use of com.consol.citrus.exceptions.ValidationException 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;
}
use of com.consol.citrus.exceptions.ValidationException 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());
}
}
use of com.consol.citrus.exceptions.ValidationException in project apim-cli by Axway-API-Management-Plus.
the class ExportUserTestAction method runTest.
@Override
public ExportResult runTest(TestContext context) {
UserExportParams params = new UserExportParams();
addParameters(params, context);
params.setLoginName(getParamLoginName(context));
UserApp app = new UserApp();
LOG.info("Running " + app.getClass().getSimpleName() + " with params: " + params);
ExportResult result = app.export(params);
if (this.getExpectedReturnCode(context) != result.getRc()) {
throw new ValidationException("Expected RC was: " + this.getExpectedReturnCode(context) + " but got: " + result.getRc());
}
return result;
}
Aggregations