// OK
try {
String query = "empty( ()/string() )";
XPathQueryService service = (XPathQueryService) getTestCollection().getService("XPathQueryService", "1.0");
ResourceSet result = service.query(query);
assertEquals(1, result.getSize());
assertEquals(query, "true",
result.getResource(0).getContent().toString());
} catch (XMLDBException ex) {
ex.printStackTrace();
fail(ex.toString());
}
// NOK
try {
String query = "empty( ()/string(.) )";
XPathQueryService service = (XPathQueryService) getTestCollection().getService("XPathQueryService", "1.0");
ResourceSet result = service.query(query);
assertEquals(1, result.getSize());
assertEquals(query, "true",
result.getResource(0).getContent().toString());
} catch (XMLDBException ex) {
ex.printStackTrace();
fail(ex.toString());
}
}