use of org.xmldb.api.modules.XQueryService in project exist by eXist-db.
the class SpecialNamesTest method attributes.
@Test
public void attributes() throws XMLDBException {
XQueryService service = getQueryService();
@SuppressWarnings("unused") ResourceSet result;
result = queryAndAssert(service, "<foo amp='x' lt='x' gt='x' apos='x' quot='x'/>", 1, null);
// TODO: could check result
}
use of org.xmldb.api.modules.XQueryService in project exist by eXist-db.
the class SpecialNamesTest method storeXMLStringAndGetQueryService.
/**
* stores XML String and get Query Service
* @param documentName to be stored in the DB
* @param content to be stored in the DB
* @return the XQuery Service
* @throws XMLDBException
*/
@SuppressWarnings("unused")
private XQueryService storeXMLStringAndGetQueryService(String documentName, String content) throws XMLDBException {
XMLResource doc = (XMLResource) testCollection.createResource(documentName, "XMLResource");
doc.setContent(content);
testCollection.storeResource(doc);
XQueryService service = (XQueryService) testCollection.getService("XPathQueryService", "1.0");
return service;
}
use of org.xmldb.api.modules.XQueryService in project exist by eXist-db.
the class UnionTest method unionInPredicate_withIndex.
@Test
public void unionInPredicate_withIndex() throws XMLDBException {
storeCollectionConfig();
final XQueryService service = storeXMLStringAndGetQueryService(PUBMED_DOC_NAME, PUBMED);
final ResourceSet result = service.queryResource(PUBMED_DOC_NAME, XQUERY);
assertEquals(1, result.getSize());
}
use of org.xmldb.api.modules.XQueryService in project exist by eXist-db.
the class UnionTest method unionInPredicate_withoutIndex.
@Test
public void unionInPredicate_withoutIndex() throws XMLDBException {
final XQueryService service = storeXMLStringAndGetQueryService(PUBMED_DOC_NAME, PUBMED);
final ResourceSet result = service.queryResource(PUBMED_DOC_NAME, XQUERY);
assertEquals(1, result.getSize());
}
use of org.xmldb.api.modules.XQueryService in project exist by eXist-db.
the class XPathQueryTest method childWildcards.
@Test
public void childWildcards() throws XMLDBException {
final String docName = "testChildWildcards.xml";
final XQueryService service = storeXMLStringAndGetQueryService(docName, "<test xmlns=\"http://test\"/>");
service.setNamespace("t", "http://test");
// make sure all is well!
queryResource(service, docName, "/t:test", 1);
queryResource(service, docName, "/*", 1);
queryResource(service, docName, "/t:*", 1);
queryResource(service, docName, "/*:test", 1);
queryResource(service, docName, "/child::*", 1);
queryResource(service, docName, "/child::t:*", 1);
queryResource(service, docName, "/child::*:test", 1);
}
Aggregations