protected void createDefaultSchema(String testName, boolean salted) {
        JDBCDataSource ds = new JDBCDataSource();
        ds.setDatabase("jdbc:hsqldb:mem:" + name);
        ds.setUser("SA");
        ds.setPassword("");
        Connection conn = null;
        Statement sql = null;
        try {
            conn = ds.getConnection();
            sql = conn.createStatement();
            sql.executeUpdate("create table users (username varchar(20), password varchar(100))");
            Sha256Hash sha256Hash = salted ? new Sha256Hash(plainTextPassword, salt)
                    : new Sha256Hash(plainTextPassword);
            String password = sha256Hash.toHex();
            sql.executeUpdate("insert into users values ('" + username + "', '" + password + "')");
        } catch (SQLException ex) {
            fail("Exception creating test database");
        } finally {
            JdbcUtils.closeStatement(sql);
            JdbcUtils.closeConnection(conn);
        }
        createRolesAndPermissions(ds);
        realmMap.get(testName).setDataSource(ds);
        dsMap.put(testName, ds);
    }
Creates a test database with the default (no separate salt column) schema, salting with
username if salted is true. Sets the DataSource of the realm associated with the test
to a DataSource connected to the database.  (To prevent concurrency problems when tests
are executed in multithreaded mode, each test method gets its own database.)
core/src/test/java/org/apache/shiro/realm/jdbc/JDBCRealmTest.java