use of org.xmldb.api.modules.XUpdateQueryService in project exist by eXist-db.
the class ConcurrencyTest method xupdateDocs.
private void xupdateDocs(final String collectionName) throws XMLDBException, IOException, URISyntaxException {
storeDocs(collectionName);
final EXistXQueryService xqs = (EXistXQueryService) test.getService("XQueryService", "1.0");
ResourceSet result = xqs.query("//SPEECH[ft:query(SPEAKER, 'juliet')]");
assertEquals(118, result.getSize());
final String xupdate = LuceneIndexTest.XUPDATE_START + " <xu:remove select=\"//SPEECH[ft:query(SPEAKER, 'juliet')]\"/>" + LuceneIndexTest.XUPDATE_END;
final XUpdateQueryService xuqs = (XUpdateQueryService) test.getService("XUpdateQueryService", "1.0");
xuqs.update(xupdate);
result = xqs.query("//SPEECH[ft:query(SPEAKER, 'juliet')]");
assertEquals(0, result.getSize());
result = xqs.query("//SPEECH[ft:query(LINE, 'king')]");
assertEquals(98, result.getSize());
}
use of org.xmldb.api.modules.XUpdateQueryService in project exist by eXist-db.
the class RemoveAppendAction method execute.
@Override
public boolean execute() throws XMLDBException, IOException {
final Collection col = DatabaseManager.getCollection(collectionPath, "admin", "");
final XUpdateQueryService service = (XUpdateQueryService) col.getService("XUpdateQueryService", "1.0");
append(service);
remove(service);
return true;
}
use of org.xmldb.api.modules.XUpdateQueryService in project exist by eXist-db.
the class ValueAppendAction method execute.
@Override
public boolean execute() throws XMLDBException {
final Collection col = DatabaseManager.getCollection(collectionPath, "admin", "");
final XUpdateQueryService service = (XUpdateQueryService) col.getService("XUpdateQueryService", "1.0");
final XPathQueryService query = (XPathQueryService) col.getService("XPathQueryService", "1.0");
append(service);
query(query);
remove(service);
return true;
}
use of org.xmldb.api.modules.XUpdateQueryService in project exist by eXist-db.
the class AttributeUpdateAction method execute.
@Override
public boolean execute() throws XMLDBException {
final Collection col = DatabaseManager.getCollection(collectionPath, "admin", "");
final XUpdateQueryService service = (XUpdateQueryService) col.getService("XUpdateQueryService", "1.0");
final int attrSize = rand.nextInt(5);
for (int i = 0; i < 10; i++) {
final String xupdate = XUPDATE_START + xmlGenerator.generateText(attrSize) + XUPDATE_END;
long mods = service.update(xupdate);
}
return true;
}
Aggregations