Search in sources :

Example 1 with WARServerLauncher

use of org.mifos.server.WARServerLauncher in project head by mifos.

the class MifosPackagedWARBasicTest method mifosLauncher.

// TODO When acceptanceTest is WebDriver instead of Selenium-based, and uses
// server-jetty instead of Cargo for start-up, this test can go into
// acceptanceTest (and the entire war-test module would no longer needed -
// be the same thing?)
private static WARServerLauncher mifosLauncher(int port) {
    // maven-dependency-plugin (see pom.xml) copied it:
    File warFile = new File("target/dependency/mifos.war");
    assertTrue(warFile.toString() + " doesn't exist?!", warFile.exists());
    return new WARServerLauncher(port, "mifos", warFile);
}
Also used : WARServerLauncher(org.mifos.server.WARServerLauncher) File(java.io.File)

Example 2 with WARServerLauncher

use of org.mifos.server.WARServerLauncher in project head by mifos.

the class MifosPackagedWARBasicTest method testPackagedWARStartup.

@Test
public void testPackagedWARStartup() throws Exception {
    WARServerLauncher serverLauncher = mifosLauncher(7077);
    serverLauncher.startServer();
    WebDriver wd = new FirefoxDriver();
    wd.get("http://localhost:7077/mifos/");
    wd.findElement(By.id("login.input.username")).sendKeys("mifos");
    wd.findElement(By.id("login.input.password")).sendKeys("testmifos");
    wd.findElement(By.id("login.button.login")).click();
    Assert.assertTrue(wd.getPageSource().contains("Mifos"));
    Assert.assertTrue(wd.getPageSource().contains("Home"));
    Assert.assertTrue(wd.getPageSource().contains("Search"));
    wd.quit();
    serverLauncher.stopServer();
    serverLauncher = null;
}
Also used : WebDriver(org.openqa.selenium.WebDriver) WARServerLauncher(org.mifos.server.WARServerLauncher) FirefoxDriver(org.openqa.selenium.firefox.FirefoxDriver) Test(org.junit.Test)

Example 3 with WARServerLauncher

use of org.mifos.server.WARServerLauncher in project head by mifos.

the class MifosPackagedWARBasicTest method main.

public static void main(String[] args) throws Exception {
    final int port = Integer.parseInt(args[0]);
    WARServerLauncher serverLauncher = mifosLauncher(port);
    serverLauncher.startServer();
}
Also used : WARServerLauncher(org.mifos.server.WARServerLauncher)

Aggregations

WARServerLauncher (org.mifos.server.WARServerLauncher)3 File (java.io.File)1 Test (org.junit.Test)1 WebDriver (org.openqa.selenium.WebDriver)1 FirefoxDriver (org.openqa.selenium.firefox.FirefoxDriver)1