@BeforeClass
public static void initDB() {
// initialize XML:DB driver
try {
Class<?> cl = Class.forName("org.exist.xmldb.DatabaseImpl");
Database database = (Database) cl.newInstance();
database.setProperty("create-database", "true");
DatabaseManager.registerDatabase(database);
Collection root = DatabaseManager.getCollection(XmldbURI.LOCAL_DB, "admin", "");
CollectionManagementService mgmt = (CollectionManagementService) root.getService("CollectionManagementService", "1.0");
Collection collection = mgmt.createCollection("protected");