BrokerPool.FORCE_CORRUPTION = true;
@SuppressWarnings("unused")
BrokerPool pool = startDB();
org.xmldb.api.base.Collection root = DatabaseManager.getCollection(XmldbURI.LOCAL_DB, "admin", "");
CollectionManagementServiceImpl mgr = (CollectionManagementServiceImpl)
root.getService("CollectionManagementService", "1.0");
org.xmldb.api.base.Collection test = root.getChildCollection("test");
if (test == null)
test = mgr.createCollection("test");
org.xmldb.api.base.Collection test2 = test.getChildCollection("test2");
if (test2 == null)
test2 = mgr.createCollection("test2");
String existHome = System.getProperty("exist.home");
File existDir = existHome==null ? new File(".") : new File(existHome);
File f = new File(existDir,"samples/shakespeare/r_and_j.xml");
assertNotNull(f);
Resource res = test2.createResource("test3.xml", "XMLResource");
res.setContent(f);
test2.storeResource(res);
mgr.moveResource(XmldbURI.create(XmldbURI.ROOT_COLLECTION + "/test2/test3.xml"),
TestConstants.TEST_COLLECTION_URI, XmldbURI.create("new_test3.xml"));
}