try {
// clear up any existing databases
silentDropDatabase(TEST_DB1_NAME);
silentDropDatabase(TEST_DB2_NAME);
Database db = new Database();
db.setName(TEST_DB1_NAME);
client.createDatabase(db);
db = client.getDatabase(TEST_DB1_NAME);
assertEquals("name of returned db is different from that of inserted db",
TEST_DB1_NAME, db.getName());
assertEquals("location of the returned db is different from that of inserted db",
warehouse.getDefaultDatabasePath(TEST_DB1_NAME).toString(), db.getLocationUri());
Database db2 = new Database();
db2.setName(TEST_DB2_NAME);
client.createDatabase(db2);
db2 = client.getDatabase(TEST_DB2_NAME);
assertEquals("name of returned db is different from that of inserted db",
TEST_DB2_NAME, db2.getName());
assertEquals("location of the returned db is different from that of inserted db",
warehouse.getDefaultDatabasePath(TEST_DB2_NAME).toString(), db2.getLocationUri());
List<String> dbs = client.getDatabases(".*");
assertTrue("first database is not " + TEST_DB1_NAME, dbs.contains(TEST_DB1_NAME));
assertTrue("second database is not " + TEST_DB2_NAME, dbs.contains(TEST_DB2_NAME));