Search in sources :

Example 61 with BeforeSuite

use of org.testng.annotations.BeforeSuite in project oxAuth by GluuFederation.

the class BaseTest method initTestSuite.

@BeforeSuite
public void initTestSuite(ITestContext context) throws IOException {
    SecurityProviderUtility.installBCProvider();
    Reporter.log("Invoked init test suite method \n", true);
    String propertiesFile = context.getCurrentXmlTest().getParameter("propertiesFile");
    if (StringHelper.isEmpty(propertiesFile)) {
        propertiesFile = "target/test-classes/testng.properties";
    }
    FileInputStream conf = new FileInputStream(propertiesFile);
    Properties prop = new Properties();
    prop.load(conf);
    Map<String, String> parameters = new HashMap<String, String>();
    for (Entry<Object, Object> entry : prop.entrySet()) {
        Object key = entry.getKey();
        Object value = entry.getValue();
        if (StringHelper.isEmptyString(key) || StringHelper.isEmptyString(value)) {
            continue;
        }
        parameters.put(key.toString(), value.toString());
    }
    // Overrided test paramters
    context.getSuite().getXmlSuite().setParameters(parameters);
}
Also used : HashMap(java.util.HashMap) Properties(java.util.Properties) FileInputStream(java.io.FileInputStream) BeforeSuite(org.testng.annotations.BeforeSuite)

Example 62 with BeforeSuite

use of org.testng.annotations.BeforeSuite in project killbill by killbill.

the class TestJaxrsBase method beforeSuite.

@BeforeSuite(groups = "slow")
public void beforeSuite() throws Exception {
    if (hasFailed()) {
        return;
    }
    super.beforeSuite();
    // We need to setup these earlier than other tests because the server is started once in @BeforeSuite
    final KillbillConfigSource configSource = getConfigSource(extraPropertiesForTestSuite);
    final ConfigSource skifeConfigSource = new ConfigSource() {

        @Override
        public String getString(final String propertyName) {
            return configSource.getString(propertyName);
        }
    };
    final KillbillServerConfig serverConfig = new ConfigurationObjectFactory(skifeConfigSource).build(KillbillServerConfig.class);
    listener = new TestKillbillGuiceListener(serverConfig, configSource);
    config = new ConfigurationObjectFactory(System.getProperties()).build(HttpServerConfig.class);
    server = new HttpServer();
    server.configure(config, getListeners(), getFilters());
    server.start();
    callbackServlet = new CallbackServlet();
    callbackServer = new CallbackServer(callbackServlet);
    callbackServer.startServer();
}
Also used : KillbillConfigSource(org.killbill.billing.platform.api.KillbillConfigSource) ConfigSource(org.skife.config.ConfigSource) HttpServerConfig(org.killbill.billing.jetty.HttpServerConfig) KillbillServerConfig(org.killbill.billing.server.config.KillbillServerConfig) ConfigurationObjectFactory(org.skife.config.ConfigurationObjectFactory) HttpServer(org.killbill.billing.jetty.HttpServer) KillbillConfigSource(org.killbill.billing.platform.api.KillbillConfigSource) BeforeSuite(org.testng.annotations.BeforeSuite)

Example 63 with BeforeSuite

use of org.testng.annotations.BeforeSuite in project orientdb by orientechnologies.

the class RunServerTest method before.

@BeforeSuite
public void before() throws Exception {
    server = new OServer();
    server.startup(RunServerTest.class.getClassLoader().getResourceAsStream("orientdb-server-config.xml"));
    server.activate();
}
Also used : OServer(com.orientechnologies.orient.server.OServer) BeforeSuite(org.testng.annotations.BeforeSuite)

Example 64 with BeforeSuite

use of org.testng.annotations.BeforeSuite in project openstack4j by ContainX.

the class TelemetryDateDeserializerTest method setup.

@BeforeSuite
public void setup() {
    mapper = new ObjectMapper();
    deserializer = new TelemetryDateDeserializer();
}
Also used : ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) BeforeSuite(org.testng.annotations.BeforeSuite)

Example 65 with BeforeSuite

use of org.testng.annotations.BeforeSuite in project OpenRefine by OpenRefine.

the class RefineTest method init.

@BeforeSuite
public void init() {
    System.setProperty("log4j.configuration", "tests.log4j.properties");
    try {
        workspaceDir = TestUtils.createTempDirectory("openrefine-test-workspace-dir");
        File jsonPath = new File(workspaceDir, "workspace.json");
        FileUtils.writeStringToFile(jsonPath, "{\"projectIDs\":[]\n" + ",\"preferences\":{\"entries\":{\"scripting.starred-expressions\":" + "{\"class\":\"com.google.refine.preference.TopList\",\"top\":2147483647," + "\"list\":[]},\"scripting.expressions\":{\"class\":\"com.google.refine.preference.TopList\",\"top\":100,\"list\":[]}}}}", // JSON is always UTF-8
        "UTF-8");
        FileProjectManager.initialize(workspaceDir);
    } catch (IOException e) {
        workspaceDir = null;
        e.printStackTrace();
    }
    // This just keeps track of any failed test, for cleanupWorkspace
    testFailed = false;
}
Also used : IOException(java.io.IOException) File(java.io.File) BeforeSuite(org.testng.annotations.BeforeSuite)

Aggregations

BeforeSuite (org.testng.annotations.BeforeSuite)66 HashMap (java.util.HashMap)13 PrismInternalTestUtil (com.evolveum.midpoint.prism.PrismInternalTestUtil)12 File (java.io.File)11 FileInputStream (java.io.FileInputStream)6 Properties (java.util.Properties)6 WebDriverWait (org.openqa.selenium.support.ui.WebDriverWait)6 ChromeDriver (org.openqa.selenium.chrome.ChromeDriver)5 DesiredCapabilities (org.openqa.selenium.remote.DesiredCapabilities)5 ZNRecordSerializer (org.apache.helix.manager.zk.ZNRecordSerializer)4 ZkClient (org.apache.helix.manager.zk.ZkClient)4 ChromeOptions (org.openqa.selenium.chrome.ChromeOptions)4 Actions (org.openqa.selenium.interactions.Actions)4 IOException (java.io.IOException)3 ArrayList (java.util.ArrayList)3 Random (java.util.Random)3 SubscriptionManagerTasks (rhsm.cli.tasks.SubscriptionManagerTasks)3 SSHCommandResult (com.redhat.qe.tools.SSHCommandResult)2 CloudbreakClient (com.sequenceiq.cloudbreak.client.CloudbreakClient)2 InputStream (java.io.InputStream)2