org.odpi.openmetadata.accessservices.stewardshipaction.fvt.StewardshipActionOMASFVTSuite Maven / Gradle / Ivy
The newest version!
/* SPDX-License-Identifier: Apache-2.0 */
/* Copyright Contributors to the ODPi Egeria project. */
package org.odpi.openmetadata.accessservices.stewardshipaction.fvt;
import org.odpi.openmetadata.accessservices.stewardshipaction.fvt.clientconstructors.ClientConstructorTest;
import org.odpi.openmetadata.accessservices.stewardshipaction.fvt.duplicateprocessing.DuplicateAssetTest;
import org.odpi.openmetadata.fvt.utilities.FVTResults;
import org.odpi.openmetadata.fvt.utilities.FVTSuiteBase;
import org.odpi.openmetadata.http.HttpHelper;
import java.io.IOException;
import static java.lang.System.exit;
/**
* StewardshipActionOMASFVT provides the main program for the Stewardship Action OMAS
* Functional Verification Tests (FVTs).
*/
public class StewardshipActionOMASFVTSuite extends FVTSuiteBase
{
/**
* Run the FVT Suite.
*
* @param args user input
*/
public static void main(String[] args)
{
int exitCode;
try
{
String url = getUrl(args);
String serverName = getServerName(args);
String userId = getUserId(args);
StewardshipActionOMASFVTSuite fvtSuite = new StewardshipActionOMASFVTSuite();
exitCode = fvtSuite.performFVT(serverName, url, userId);
}
catch (IOException error)
{
System.out.println("Error getting user input");
error.printStackTrace();
exitCode = -99;
}
exit(exitCode);
}
/**
* Run all the defined tests and capture the results.
*
* @param serverName name of the server to connect to
* @param serverPlatformRootURL the network address of the server running the OMAS REST servers
* @param userId calling user
* @return combined results of running test
*/
@Override
public int performFVT(String serverName,
String serverPlatformRootURL,
String userId)
{
HttpHelper.noStrictSSL();
int returnCode = 0;
FVTResults results;
results = ClientConstructorTest.performFVT(serverName, serverPlatformRootURL);
if (! results.isSuccessful())
{
returnCode --;
}
results.printResults(serverName);
results = DuplicateAssetTest.performFVT(serverName, serverPlatformRootURL, userId);
if (! results.isSuccessful())
{
returnCode --;
}
results.printResults(serverName);
return returnCode;
}
}