org.hsqldb.server.ServerAcl Java Examples

The following examples show how to use org.hsqldb.server.ServerAcl. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TestAcl.java    From evosql with Apache License 2.0 6 votes vote down vote up
public static Test suite()
throws IOException, ServerAcl.AclFormatException {

    TestSuite newSuite = new TestSuite();

    newSuite.addTest(new TestAcl("testDefaultWithNames"));
    newSuite.addTest(new TestAcl("testDefaultWithIPs"));
    newSuite.addTest(new TestAcl("testDenyAllWithNames"));
    newSuite.addTest(new TestAcl("testDenyAllWithIPs"));
    newSuite.addTest(new TestAcl("testLocalhostOnlyWithNames"));
    newSuite.addTest(new TestAcl("testLocalhostOnlyWithIPs"));
    newSuite.addTest(new TestAcl("testNoLocalhostOnlyWithNames"));
    newSuite.addTest(new TestAcl("testNoLocalhostOnlyWithIPs"));
    newSuite.addTest(new TestAcl("testLocalNetOnlyWithNames"));
    newSuite.addTest(new TestAcl("testLocalNetOnlyWithIPs"));
    newSuite.addTest(new TestAcl("testNoLocalNetOnlyWithNames"));
    newSuite.addTest(new TestAcl("testNoLocalNetOnlyWithIPs"));

    return newSuite;
}
 
Example #2
Source File: JdbcHdfsDatabaseConfiguration.java    From spring-cloud-task-app-starters with Apache License 2.0 6 votes vote down vote up
@Bean(destroyMethod = "stop")
public Server databaseServer() throws SQLException, IOException, ServerAcl.AclFormatException {
	DriverManager.registerDriver(new org.hsqldb.jdbcDriver());
	int hsqldbPort = SocketUtils.findAvailableTcpPort(10000);
	System.setProperty("db.server.port", Integer.toString(hsqldbPort));
	logger.info("Database is using port: " + Integer.toString(hsqldbPort));
	HsqlProperties configProps = new HsqlProperties();
	configProps.setProperty("server.port", hsqldbPort);
	configProps.setProperty("server.database.0", "file:target/db/test");
	configProps.setProperty("server.dbname.0", "test");
	Server server = new Server();
	server.setLogWriter(null);
	server.setErrWriter(null);
	server.setRestartOnShutdown(false);
	server.setNoSystemExit(true);
	server.setProperties(configProps);
	server.start();
	return server;
}
 
Example #3
Source File: HsqlDatabaseServer.java    From tessera with Apache License 2.0 5 votes vote down vote up
@Override
public void start() {

    HsqlProperties properties = new HsqlProperties();
    for (int i = 0; i < 4; i++) {
        String db = nodeId + (i + 1);
        properties.setProperty("server.database." + i, "file:target/hsql/" + db);
        properties.setProperty("server.dbname." + i, db);
    }
    
    properties.setProperty("server.database.4", "file:target/hsql/rest-httpwhitelist5");
    properties.setProperty("server.dbname.4", "rest-httpwhitelist5");

    hsqlServer.setPort(9189);
    hsqlServer.setSilent(true);
    hsqlServer.setTrace(false);
    try{
        hsqlServer.setProperties(properties);
    } catch (IOException | ServerAcl.AclFormatException ex) {
        throw new RuntimeException(ex);
    }
    hsqlServer.start();
    if(hsqlServer.isNotRunning()) {
        throw new IllegalStateException("HSQL DB not started. ");
    }

}
 
Example #4
Source File: HsqlTestUtils.java    From CogStack-Pipeline with Apache License 2.0 5 votes vote down vote up
public static void initHSQLDBs() throws IOException, ServerAcl.AclFormatException {

       HsqlProperties p1 = new HsqlProperties();
       p1.setProperty("server.database.0", "mem:hsqldb");
       p1.setProperty("server.dbname.0", "minicogs");
       p1.setProperty("server.port", "9001");
       p1.setProperty("server.remote_open", "true");
       server1 = new Server();
       server1.setProperties(p1);
       server1.setLogWriter(null);
       server1.setErrWriter(null);
       server1.start();

       HsqlProperties p2 = new HsqlProperties();
       p2.setProperty("server.database.0", "mem:hsqldb");
       p2.setProperty("server.dbname.0", "minicogs");
       p2.setProperty("server.port", "9002");
       p2.setProperty("server.remote_open", "true");
       server2 = new Server();
       server2.setProperties(p2);
       server2.setLogWriter(null);
       server2.setErrWriter(null);
       server2.start();

       //yodieconfig
       //Properties prop = System.getProperties();
       //prop.setProperty("at.ofai.gate.modularpipelines.configFile", "/home/rich/gate-apps/yodie/yodie-pipeline/main-bio/main-bio.config.yaml");        
   }
 
Example #5
Source File: TestAcl.java    From evosql with Apache License 2.0 4 votes vote down vote up
public TestAcl() throws IOException, ServerAcl.AclFormatException {
    commonSetup();
}
 
Example #6
Source File: TestAcl.java    From evosql with Apache License 2.0 2 votes vote down vote up
public TestAcl(String s) throws IOException, ServerAcl.AclFormatException {

        super(s);

        commonSetup();
    }