Database database = (Database) cl.newInstance();
database.setProperty("create-database", "true");
DatabaseManager.registerDatabase(database);
Collection root = DatabaseManager.getCollection(ROOT_URI, ADMIN_UID, ADMIN_PWD);
CollectionManagementService service = (CollectionManagementService) root.getService("CollectionManagementService", "1.0");
Collection testCollection = service.createCollection(TEST_COLLECTION);
UserManagementService ums = (UserManagementService) testCollection.getService("UserManagementService", "1.0");
// change ownership to guest
Account guest = ums.getAccount(GUEST_UID);
ums.chown(guest, guest.getPrimaryGroup());
ums.chmod("rwxr-xr-x");
Collection testConfCollection = service.createCollection(CONF_COLL_URI.toString());
ums = (UserManagementService) testConfCollection.getService("UserManagementService", "1.0");
// change ownership to guest
ums.chown(guest, guest.getPrimaryGroup());
ums.chmod("rwxr-xr-x");