use of org.testng.annotations.BeforeSuite in project cloudbreak by hortonworks.
the class CloudbreakTestSuiteInitializer method initCloudbreakSuite.
@BeforeSuite(dependsOnMethods = "initContext")
@Parameters({ "cloudbreakServer", "cloudProvider", "credentialName", "instanceGroups", "hostGroups", "blueprintName", "stackName", "networkName", "securityGroupName" })
public void initCloudbreakSuite(@Optional("") String cloudbreakServer, @Optional("") String cloudProvider, @Optional("") String credentialName, @Optional("") String instanceGroups, @Optional("") String hostGroups, @Optional("") String blueprintName, @Optional("") String stackName, @Optional("") String networkName, @Optional("") String securityGroupName) {
cloudbreakServer = StringUtils.hasLength(cloudbreakServer) ? cloudbreakServer : defaultCloudbreakServer;
String cbServerRoot = cloudbreakServer + cbRootContextPath;
itContext.putContextParam(CloudbreakITContextConstants.SKIP_REMAINING_SUITETEST_AFTER_ONE_FAILED, skipRemainingSuiteTestsAfterOneFailed);
itContext.putContextParam(CloudbreakITContextConstants.CLOUDBREAK_SERVER, cloudbreakServer);
itContext.putContextParam(CloudbreakITContextConstants.CLOUDBREAK_SERVER_ROOT, cbServerRoot);
itContext.putContextParam(CloudbreakITContextConstants.CLOUDPROVIDER, cloudProvider);
String identity = itContext.getContextParam(IntegrationTestContext.IDENTITY_URL);
String user = itContext.getContextParam(IntegrationTestContext.AUTH_USER);
String password = itContext.getContextParam(IntegrationTestContext.AUTH_PASSWORD);
CloudbreakClient cloudbreakClient = new CloudbreakClientBuilder(cbServerRoot, identity, "cloudbreak_shell").withCertificateValidation(false).withIgnorePreValidation(true).withDebug(true).withCredential(user, password).build();
itContext.putContextParam(CloudbreakITContextConstants.CLOUDBREAK_CLIENT, cloudbreakClient);
if (cleanUpBeforeStart) {
cleanUpService.deleteTestStacksAndResources(cloudbreakClient);
}
putBlueprintToContextIfExist(itContext.getContextParam(CloudbreakITContextConstants.CLOUDBREAK_CLIENT, CloudbreakClient.class).blueprintEndpoint(), blueprintName);
putNetworkToContext(itContext.getContextParam(CloudbreakITContextConstants.CLOUDBREAK_CLIENT, CloudbreakClient.class).networkEndpoint(), cloudProvider, networkName);
putSecurityGroupToContext(itContext.getContextParam(CloudbreakITContextConstants.CLOUDBREAK_CLIENT, CloudbreakClient.class).securityGroupEndpoint(), cloudProvider, securityGroupName);
putCredentialToContext(itContext.getContextParam(CloudbreakITContextConstants.CLOUDBREAK_CLIENT, CloudbreakClient.class).credentialEndpoint(), cloudProvider, credentialName);
putStackToContextIfExist(itContext.getContextParam(CloudbreakITContextConstants.CLOUDBREAK_CLIENT, CloudbreakClient.class).stackV1Endpoint(), stackName);
if (StringUtils.hasLength(instanceGroups)) {
List<String[]> instanceGroupStrings = templateAdditionHelper.parseCommaSeparatedRows(instanceGroups);
itContext.putContextParam(CloudbreakITContextConstants.TEMPLATE_ID, createInstanceGroups(itContext.getContextParam(CloudbreakITContextConstants.CLOUDBREAK_CLIENT, CloudbreakClient.class).templateEndpoint(), instanceGroupStrings));
}
if (StringUtils.hasLength(hostGroups)) {
List<String[]> hostGroupStrings = templateAdditionHelper.parseCommaSeparatedRows(hostGroups);
itContext.putContextParam(CloudbreakITContextConstants.HOSTGROUP_ID, createHostGroups(hostGroupStrings));
}
}
use of org.testng.annotations.BeforeSuite in project killbill by killbill.
the class GuicyKillbillTestSuite method globalBeforeSuite.
@BeforeSuite(alwaysRun = true)
public void globalBeforeSuite() {
extraPropertiesForTestSuite.put("org.killbill.security.shiroResourcePath", "classpath:org/killbill/billing/util/shiro.ini");
if (Boolean.valueOf(System.getProperty("killbill.test.redis", "false"))) {
redisServer = new RedisServer(56379);
redisServer.start();
redissonClient = new RedissonCacheClientProvider("redis://127.0.0.1:56379", 1, null).get();
theRealClock = new DistributedClockMock();
((DistributedClockMock) theRealClock).setRedissonClient(redissonClient);
extraPropertiesForTestSuite.put("org.killbill.cache.config.redis", "true");
extraPropertiesForTestSuite.put("org.killbill.cache.config.redis.url", "redis://127.0.0.1:56379");
} else {
theRealClock.resetDeltaFromReality();
}
// The clock needs to be setup early in @BeforeSuite, as it is needed when starting the server, but see below
clock = theRealClock;
}
use of org.testng.annotations.BeforeSuite in project midpoint by Evolveum.
the class TestExpressionFunctions method setup.
@BeforeSuite
public void setup() throws SchemaException, SAXException, IOException {
PrettyPrinter.setDefaultNamespacePrefix(MidPointConstants.NS_MIDPOINT_PUBLIC_PREFIX);
PrismTestUtil.resetPrismContext(MidPointPrismContextFactory.FACTORY);
protector = KeyStoreBasedProtectorBuilder.create(getPrismContext()).keyStorePath("src/test/resources/keystore.jceks").keyStorePassword("changeit").initialize();
clock = new Clock();
basic = createBasicFunctions();
}
use of org.testng.annotations.BeforeSuite in project ats-framework by Axway.
the class BaseTestClass method beforeSuite.
@BeforeSuite
public void beforeSuite() {
boolean hasServiceException = false;
// quick sanity check if all servers are working properly
log.info("Running SANITY check for Example servers...");
// check agents
log.info("ATS Agents sanity check START");
try {
String agent1AtsVersion = new SystemOperations(configuration.getAgent1Address()).getAtsVersion();
log.info("Agent 1 is working and its version is: " + agent1AtsVersion);
String agent2AtsVersion = new SystemOperations(configuration.getAgent1Address()).getAtsVersion();
log.info("Agent 2 is working and its version is: " + agent2AtsVersion);
} catch (Exception e) {
hasServiceException = true;
log.error(e);
}
log.info("ATS Agents sanity check END");
log.info("HTTP Server sanity check START");
// check HTTP server
RestClient restClient = null;
try {
restClient = new RestClient("http://" + configuration.getServerIp() + ":" + configuration.getHttpServerPort());
RestResponse rr = restClient.get();
if (rr.getStatusCode() != 200) {
throw new RuntimeException("HTTP Server server maybe in trouble or not started properly. Status of HTTP sanity check response is :\n\tStatus Message: " + rr.getStatusMessage() + "\n\tBody: " + rr.getBodyAsString());
} else {
log.info("HTTP server working");
}
} catch (Exception e) {
hasServiceException = true;
log.error(e);
} finally {
if (restClient != null) {
restClient.disconnect();
restClient = null;
}
}
log.info("HTTP Server sanity check END");
log.info("FTP/FTPS Server sanity check START");
// check FTP/FTPS server (TODO)
FtpClient ftpClient = null;
try {
ftpClient = new FtpClient();
ftpClient.setCustomPort(configuration.getFtpServerPort());
ftpClient.connect(configuration.getServerIp(), configuration.getUserName(), configuration.getUserPassword());
} catch (Exception e) {
hasServiceException = true;
log.error(e);
} finally {
if (ftpClient != null) {
ftpClient.disconnect();
ftpClient = null;
}
}
log.info("FTP/FTPS Server sanity check END");
log.info("DONE running SANITY check for Examples servers");
if (hasServiceException) {
throw new RuntimeException("Not all servers started or working properly. Did you run 'Start servers' from the Desktop directory?");
}
}
use of org.testng.annotations.BeforeSuite in project ats-framework by Axway.
the class HtmlEngineBaseTest method beforeSuiteHtmlEngineBaseTest.
@BeforeSuite
public void beforeSuiteHtmlEngineBaseTest() throws Exception {
UiEngineConfigurator configurator = UiEngineConfigurator.getInstance();
// set the base folder with the map files
// configurator.setMapFilesBaseDir( "resources/com/axway/ats/uiengine/maps" );
// overwrite some configuration properties for faster test execution
configurator.setCommandDelay(-1);
configurator.setElementStateChangeDelay(2000);
configurator.setHighlightElements(false);
}
Aggregations