public static void main(String[] args) { try { TomcatServer.openServer(); } catch (Exception e) { try { TomcatServer.closeServer(); } catch (Exception e1) { } } }
@BeforeClass public static void initTomcat() throws Exception { URL dir = TomcatTest.class.getResource("/adapter-test/demorealm.json"); String baseDir = new File(dir.getFile()).getParentFile().toString(); System.out.println("Tomcat basedir: " + baseDir); tomcat = new TomcatServer(8082, baseDir); System.setProperty("app.server.base.url", "http://localhost:8082"); System.setProperty("my.host.name", "localhost"); tomcat.deploy("/customer-portal", "customer-portal"); tomcat.deploy("/customer-db", "customer-db"); tomcat.deploy("/product-portal", "product-portal"); tomcat.deploy("/secure-portal", "secure-portal"); tomcat.deploy("/session-portal", "session-portal"); tomcat.start(); // tomcat.getServer().await(); }
@AfterClass public static void shutdownTomcat() throws Exception { tomcat.stop(); }