Esempio n. 1
0
 /** Executes a block of code in a running server, with a test browser. */
 public static void running(
     TestServer server, WebDriver webDriver, final Callback<TestBrowser> block) {
   synchronized (PlayRunners$.MODULE$.mutex()) {
     TestBrowser browser = null;
     TestServer startedServer = null;
     try {
       start(server);
       startedServer = server;
       browser = testBrowser(webDriver);
       block.invoke(browser);
     } catch (Error e) {
       throw e;
     } catch (RuntimeException re) {
       throw re;
     } catch (Throwable t) {
       throw new RuntimeException(t);
     } finally {
       if (browser != null) {
         browser.quit();
       }
       if (startedServer != null) {
         stop(startedServer);
       }
     }
   }
 }
  @Before
  public void setUp() {
    FakeApplication app = fakeApplication(inMemoryDatabase());
    start(app);

    CarregadorDeDisciplinas.limparCache();
  }
Esempio n. 3
0
 /** Executes a block of code in a running server. */
 public static void running(TestServer server, final Runnable block) {
   synchronized (PlayRunners$.MODULE$.mutex()) {
     try {
       start(server);
       block.run();
     } finally {
       stop(server);
     }
   }
 }
Esempio n. 4
0
 /** Executes a block of code in a running application. */
 public static void running(FakeApplication fakeApplication, final Runnable block) {
   synchronized (PlayRunners$.MODULE$.mutex()) {
     try {
       start(fakeApplication);
       block.run();
     } finally {
       stop(fakeApplication);
     }
   }
 }
Esempio n. 5
0
  @Before
  public void SetUp()
      throws IOException, ParserConfigurationException, SAXException, CadastroUsuarioException {
    start(fakeApplication(inMemoryDatabase()));

    sistema = new Sistema();
    CadastroUsuario cadastro = new CadastroUsuario();

    cadastro.cadastrarUsuario("Fulano", "*****@*****.**", "12345678");

    usuario = cadastro.getUsuarioPorEmail("*****@*****.**");
    grade = new Grade();
    plano1 = usuario.getPlano();
  }
Esempio n. 6
0
 /** Executes a block of code in a running server, with a test browser. */
 public static void running(
     TestServer server, WebDriver webDriver, final Consumer<TestBrowser> block) {
   synchronized (PlayRunners$.MODULE$.mutex()) {
     TestBrowser browser = null;
     TestServer startedServer = null;
     try {
       start(server);
       startedServer = server;
       browser = testBrowser(webDriver, server.port());
       block.accept(browser);
     } finally {
       if (browser != null) {
         browser.quit();
       }
       if (startedServer != null) {
         stop(startedServer);
       }
     }
   }
 }
 @Before
 public void startApp() {
   app = Helpers.fakeApplication(Helpers.inMemoryDatabase());
   Helpers.start(app);
 }
Esempio n. 8
0
 @Before
 public void setUp() {
   start(fakeApplication(fakeGlobal()));
   Database.connectToTest();
   Database.destroy();
 }
 @Before
 public void setUp() {
   start(fakeApplication(inMemoryDatabase(), fakeGlobal()));
   Ebean.save((List) Yaml.load("test-data.yml"));
 }
Esempio n. 10
0
 @Before
 public void before() {
   app = support.Helpers.makeTestApplication();
   Helpers.start(app);
 }
 @Before
 public void setUp() {
   start(fakeApplication(Helpers.inMemoryDatabase()));
 }