Examples of IOSServerManager


Examples of org.uiautomation.ios.IOSServerManager

    IOSServerConfiguration config = new IOSServerConfiguration();
    config.setPort(4444);
    config.setHost("localhost");
    Configuration.SIMULATORS_ENABLED = true;

    final IOSServerManager mgr = new IOSServerManager(config);

    Assert.assertEquals(mgr.getSessions().size(), 0);
    Thread t = new Thread(new Runnable() {
      @Override
      public void run() {
        try {
          mgr.stopGracefully();
        } catch (InterruptedException e) {
          e.printStackTrace();
        }
      }
    });
    t.start();

    Assert.assertEquals(mgr.getSessions().size(), 0);

    while (mgr.isRunning()) {
      Thread.sleep(250);
    }

    t.join();
  }
View Full Code Here

Examples of org.uiautomation.ios.IOSServerManager

    IOSServerConfiguration config = new IOSServerConfiguration();
    config.setPort(4444);
    config.setHost("localhost");
    Configuration.SIMULATORS_ENABLED = true;

    final IOSServerManager mgr = new IOSServerManager(config);
    addSafari(mgr, new StringBuilder());

    IOSCapabilities saf = IOSCapabilities.iphone("Safari");
    ServerSideSession session = mgr.createSession(saf);
    Assert.assertEquals(mgr.getSessions().size(), 1);
    Thread t = new Thread(new Runnable() {
      @Override
      public void run() {

        try {
          mgr.stopGracefully();
        } catch (InterruptedException e) {
          e.printStackTrace();
        }
      }
    });

    t.start();

    mgr.registerSessionHasStop(session);
    Assert.assertEquals(mgr.getSessions().size(), 0);

    while (mgr.isRunning()) {
      Thread.sleep(250);
    }

    t.join();
  }
View Full Code Here

Examples of org.uiautomation.ios.IOSServerManager

    IOSServerConfiguration config = new IOSServerConfiguration();
    config.setPort(4444);
    config.setHost("localhost");
    Configuration.SIMULATORS_ENABLED = true;

    final IOSServerManager mgr = new IOSServerManager(config);
    addSafari(mgr, new StringBuilder());

    IOSCapabilities saf = IOSCapabilities.iphone("Safari");
    ServerSideSession session = mgr.createSession(saf);
    Assert.assertEquals(mgr.getSessions().size(), 1);
    Thread t = new Thread(new Runnable() {
      @Override
      public void run() {
        try {
          mgr.stopGracefully();
        } catch (InterruptedException e) {
          e.printStackTrace();
        }
      }
    });

    t.start();

    mgr.waitForState(IOSServerManager.State.stopping);
    ServerSideSession session2 = mgr.createSession(saf);
    Assert.assertNull(session2);

    mgr.registerSessionHasStop(session);
    Assert.assertEquals(mgr.getSessions().size(), 0);

    while (mgr.isRunning()) {
      Thread.sleep(250);
    }

    t.join();
  }
View Full Code Here

Examples of org.uiautomation.ios.IOSServerManager

  public void init() throws ServletException {
    super.init();
    URL u = null;

    try {
      IOSServerManager
          driver =
          (IOSServerManager) getServletContext().getAttribute(IOSServer.DRIVER);
      if (driver != null) {
        int port = driver.getPort();
        u = new URL(System.getProperty("endpoint", "http://localhost:" + port + "/wd/hub"));
      } else {
        log.warning("couldn't find the end point.");
      }
    } catch (MalformedURLException e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.