@Override
  protected void before() throws Throwable {
    super.before();

    File hsqlHome = new File("target/temporary/hsqldb/" + name);
    if (hsqlHome.exists()) {
      hsqlHome.delete();
    }
    hsqlHome.mkdirs();

    String dbHome = "file:" + hsqlHome.getAbsolutePath();

    HsqlProperties p = new HsqlProperties();
    p.setProperty("server.database.0", dbHome);
    p.setProperty("server.dbname.0", name);
    p.setProperty("server.port", port);
    server = new Server();
    server.setProperties(p);
    server.setLogWriter(new PrintWriter(System.out));
    server.setErrWriter(new PrintWriter(System.err));
    server.start();
  }
Ejemplo n.º 2
0
 @Override
 protected void before() throws Throwable {
   super.before();
   webRule.before();
 }