database.setProperty("create-database", "true");
DatabaseManager.registerDatabase(database);
Collection root = DatabaseManager.getCollection(ROOT_URI, ADMIN_UID, ADMIN_PWD);
CollectionManagementService cms = (CollectionManagementService)root.getService("CollectionManagementService", "1.0");
Collection test = cms.createCollection(TEST_COLLECTION);
UserManagementService ums = (UserManagementService) test.getService("UserManagementService", "1.0");
// change ownership to guest
Account guest = ums.getAccount(GUEST_UID);
ums.chown(guest, guest.getPrimaryGroup());
ums.chmod(Permission.DEFAULT_COLLECTION_PERM);
assertNotNull("Could not connect to database.");
System.out.println("<<<\n");
} catch (Exception e) {
fail(e.getMessage());