@Override
 protected void after() {
   super.after();
   if (server != null) {
     server.stop();
   }
 }
Ejemplo n.º 2
0
  private void runHsqldbServer(final String fileName, final int port, final char[] password) {
    org.hsqldb.server.Server hsqlServer = new org.hsqldb.server.Server();

    hsqlServer.setPort(port);
    hsqlServer.setDatabaseName(0, "jgnash"); // the alias
    hsqlServer.setDatabasePath(0, "file:" + FileUtils.stripFileExtension(fileName));

    hsqlServer.start();

    // Start the message server and engine, this should block until closed
    if (!run(DataStoreType.HSQL_DATABASE, fileName, port, password)) {
      Logger.getLogger(JpaNetworkServer.class.getName()).severe("Failed to start the server");
    }

    hsqlServer.stop();
  }