use of org.xmldb.api.base.ResourceSet in project exist by eXist-db.
the class JaxpXsdCatalogTest method executeAndEvaluate.
private void executeAndEvaluate(final String query, final String expectedValue) throws XMLDBException, SAXException, IOException, XpathException {
final ResourceSet results = existEmbeddedServer.executeQuery(query);
assertEquals(1, results.getSize());
final String r = (String) results.getResource(0).getContent();
assertXpathEvaluatesTo(expectedValue, "//status/text()", r);
}
use of org.xmldb.api.base.ResourceSet in project exist by eXist-db.
the class JaxpXsdCatalogTest method clearGrammarCache.
@Before
public void clearGrammarCache() throws XMLDBException {
final ResourceSet results = existEmbeddedServer.executeQuery("validation:clear-grammar-cache()");
results.getResource(0).getContent();
}
use of org.xmldb.api.base.ResourceSet in project exist by eXist-db.
the class SwitchTest method oneCaseCaseMatch.
@Test
public void oneCaseCaseMatch() throws XMLDBException {
final String query = "xquery version '3.0';" + "let $animal := 'Cat' return " + "switch ($animal)" + "case 'Cow' return 'Moo'" + "case 'Cat' return 'Meow'" + "case 'Duck' return 'Quack'" + "default return 'Odd noise!'";
final ResourceSet results = existEmbeddedServer.executeQuery(query);
final String r = (String) results.getResource(0).getContent();
assertEquals("Meow", r);
}
use of org.xmldb.api.base.ResourceSet in project exist by eXist-db.
the class SwitchTest method twoCaseCaseMatch.
@Test
public void twoCaseCaseMatch() throws XMLDBException {
final String query = "xquery version '3.0';" + "let $animal := 'Calf' return " + "switch ($animal)" + "case 'Cow' case 'Calf' return 'Moo'" + "case 'Cat' return 'Meow'" + "case 'Duck' return 'Quack'" + "default return 'Odd noise!'";
final ResourceSet results = existEmbeddedServer.executeQuery(query);
final String r = (String) results.getResource(0).getContent();
assertEquals("Moo", r);
}
use of org.xmldb.api.base.ResourceSet in project exist by eXist-db.
the class BaseConverterTest method testBaseConverterIntToHex.
@Test
public void testBaseConverterIntToHex() throws XMLDBException {
final String query = "util:integer-to-base(10, 16)";
final ResourceSet result = existXmldbEmbeddedServer.executeQuery(query);
final String r = (String) result.getResource(0).getContent();
assertEquals("a", r);
}
Aggregations