Search in sources :

Example 51 with BeforeSuite

use of org.testng.annotations.BeforeSuite in project selenium_java by sergueik.

the class AngularAndWebDriverTest method before_suite.

@BeforeSuite
public void before_suite() throws Exception {
    // Launch Protractor's own test app on http://localhost:8080
    ((StdErrLog) Log.getRootLogger()).setLevel(StdErrLog.LEVEL_OFF);
    webServer = new Server(new QueuedThreadPool(6));
    ServerConnector connector = new ServerConnector(webServer, new HttpConnectionFactory());
    connector.setPort(8080);
    webServer.addConnector(connector);
    ResourceHandler resource_handler = new ResourceHandler();
    resource_handler.setDirectoriesListed(true);
    resource_handler.setWelcomeFiles(new String[] { "index.html" });
    resource_handler.setResourceBase("src/test/webapp");
    HandlerList handlers = new HandlerList();
    MovedContextHandler effective_symlink = new MovedContextHandler(webServer, "/lib/angular", "/lib/angular_v1.2.9");
    handlers.setHandlers(new Handler[] { effective_symlink, resource_handler, new DefaultHandler() });
    webServer.setHandler(handlers);
    webServer.start();
    setupBrowser("chrome");
    driver.manage().timeouts().setScriptTimeout(30, TimeUnit.SECONDS);
    ngWebDriver = new NgWebDriver(driver);
}
Also used : ServerConnector(org.eclipse.jetty.server.ServerConnector) HandlerList(org.eclipse.jetty.server.handler.HandlerList) StdErrLog(org.eclipse.jetty.util.log.StdErrLog) Server(org.eclipse.jetty.server.Server) HttpConnectionFactory(org.eclipse.jetty.server.HttpConnectionFactory) MovedContextHandler(org.eclipse.jetty.server.handler.MovedContextHandler) QueuedThreadPool(org.eclipse.jetty.util.thread.QueuedThreadPool) ResourceHandler(org.eclipse.jetty.server.handler.ResourceHandler) DefaultHandler(org.eclipse.jetty.server.handler.DefaultHandler) BeforeSuite(org.testng.annotations.BeforeSuite)

Example 52 with BeforeSuite

use of org.testng.annotations.BeforeSuite in project helix by apache.

the class ZkUnitTestBase method beforeSuite.

@BeforeSuite(alwaysRun = true)
public void beforeSuite() throws Exception {
    // Due to ZOOKEEPER-2693 fix, we need to specify whitelist for execute zk commends
    System.setProperty("zookeeper.4lw.commands.whitelist", "*");
    _zkServer = TestHelper.startZkServer(ZK_ADDR);
    AssertJUnit.assertTrue(_zkServer != null);
    ZKClientPool.reset();
    // System.out.println("Number of open zkClient before ZkUnitTests: "
    // + ZkClient.getNumberOfConnections());
    _gZkClient = new ZkClient(ZK_ADDR);
    _gZkClient.setZkSerializer(new ZNRecordSerializer());
}
Also used : ZkClient(org.apache.helix.manager.zk.ZkClient) ZNRecordSerializer(org.apache.helix.manager.zk.ZNRecordSerializer) BeforeSuite(org.testng.annotations.BeforeSuite)

Example 53 with BeforeSuite

use of org.testng.annotations.BeforeSuite in project helix by apache.

the class AdminTestBase method beforeSuite.

@BeforeSuite
public void beforeSuite() throws Exception {
    // TODO: use logging.properties file to config java.util.logging.Logger levels
    java.util.logging.Logger topJavaLogger = java.util.logging.Logger.getLogger("");
    topJavaLogger.setLevel(Level.WARNING);
    // start zk
    _zkServer = TestHelper.startZkServer(ZK_ADDR);
    AssertJUnit.assertTrue(_zkServer != null);
    ZKClientPool.reset();
    _gZkClient = new ZkClient(ZK_ADDR, ZkClient.DEFAULT_CONNECTION_TIMEOUT, ZkClient.DEFAULT_SESSION_TIMEOUT, new ZNRecordSerializer());
    _gSetupTool = new ClusterSetup(_gZkClient);
    // start admin
    _adminThread = new AdminThread(ZK_ADDR, ADMIN_PORT);
    _adminThread.start();
    // create a client
    _gClient = new Client(Protocol.HTTP);
    // wait for the web service to start
    Thread.sleep(100);
}
Also used : ZkClient(org.apache.helix.manager.zk.ZkClient) AdminThread(org.apache.helix.webapp.AdminTestHelper.AdminThread) ClusterSetup(org.apache.helix.tools.ClusterSetup) ZkClient(org.apache.helix.manager.zk.ZkClient) Client(org.restlet.Client) ZNRecordSerializer(org.apache.helix.manager.zk.ZNRecordSerializer) BeforeSuite(org.testng.annotations.BeforeSuite)

Example 54 with BeforeSuite

use of org.testng.annotations.BeforeSuite in project cloudbreak by hortonworks.

the class MockSuiteInitializer method initSuiteMap.

@BeforeSuite(dependsOnMethods = "initContext")
public void initSuiteMap(ITestContext testContext) {
    CloudbreakClient cloudbreakClient = itContext.getContextParam(CloudbreakITContextConstants.CLOUDBREAK_CLIENT, CloudbreakClient.class);
    if (cleanUpBeforeStart && isImageCatalogExists(cloudbreakClient.imageCatalogEndpoint(), MOCK_IMAGE_CATALOG_NAME)) {
        cleanUpService.deleteImageCatalog(cloudbreakClient, MOCK_IMAGE_CATALOG_NAME);
    }
    createMockImageCatalog(cloudbreakClient.imageCatalogEndpoint());
}
Also used : CloudbreakClient(com.sequenceiq.cloudbreak.client.CloudbreakClient) BeforeSuite(org.testng.annotations.BeforeSuite)

Example 55 with BeforeSuite

use of org.testng.annotations.BeforeSuite in project cloudbreak by hortonworks.

the class AutoscaleTestSuiteInitializer method initCloudbreakSuite.

@BeforeSuite(dependsOnMethods = "initContext")
@Parameters("periscopeServer")
public void initCloudbreakSuite(@Optional("") String periscopeServer) {
    periscopeServer = StringUtils.hasLength(periscopeServer) ? periscopeServer : defaultPeriscopeServer;
    String identity = itContext.getContextParam(IntegrationTestContext.IDENTITY_URL);
    String user = itContext.getContextParam(IntegrationTestContext.AUTH_USER);
    String password = itContext.getContextParam(IntegrationTestContext.AUTH_PASSWORD);
    AutoscaleClient autoscaleClient = new AutoscaleClientBuilder(periscopeServer + autoscaleRootContextPath, identity, "cloudbreak_shell").withCertificateValidation(false).withDebug(true).withCredential(user, password).withIgnorePreValidation(false).build();
    itContext.putContextParam(CloudbreakITContextConstants.AUTOSCALE_CLIENT, autoscaleClient);
}
Also used : AutoscaleClient(com.sequenceiq.periscope.client.AutoscaleClient) AutoscaleClientBuilder(com.sequenceiq.periscope.client.AutoscaleClient.AutoscaleClientBuilder) Parameters(org.testng.annotations.Parameters) 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