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);
IndexInfo info = subTestCollection.validateXMLResource(transaction, broker, XmldbURI.create("test2.xml"), new InputSource(f.toURI().toASCIIString()));
assertNotNull(info);
subTestCollection.store(transaction, broker, info, new InputSource(f.toURI().toASCIIString()), false);
transact.commit(transaction);
System.out.println("Transaction commited ...");
transaction = transact.beginTransaction();
System.out.println("Transaction started ...");
broker.copyResource(transaction, info.getDocument(), testCollection, XmldbURI.create("new_test2.xml"));
broker.saveCollection(transaction, testCollection);
// Don't commit...
pool.getTransactionManager().getJournal().flushToLog(true);
System.out.println("Transaction interrupted ...");