Search in sources :

Example 16 with XPathAxis

use of org.sirix.service.xml.xpath.XPathAxis in project sirix by sirixdb.

the class FunctionsXMarkTest method testData.

/**
 * Test function data().
 *
 * @throws SirixXPathException
 */
@Ignore
@Test
public final void testData() throws SirixXPathException {
    final String query = "for $b in /site/people/person[@id=\"person0\"] return fn:data($b/name)";
    final String result = "Krishna Merle";
    XPathStringChecker.testIAxisConventions(new XPathAxis(holder.getReader(), query), new String[] { result });
}
Also used : XPathAxis(org.sirix.service.xml.xpath.XPathAxis) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 17 with XPathAxis

use of org.sirix.service.xml.xpath.XPathAxis in project sirix by sirixdb.

the class FunctionsXMarkTest method testText.

/**
 * Test function text().
 *
 * @throws SirixXPathException
 */
@Ignore
@Test
public final void testText() throws SirixXPathException {
    final String query = "for $b in /site/people/person[@id=\"person0\"] return $b/name/text()";
    final String result = "Krishna Merle";
    XPathStringChecker.testIAxisConventions(new XPathAxis(holder.getReader(), query), new String[] { result });
}
Also used : XPathAxis(org.sirix.service.xml.xpath.XPathAxis) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 18 with XPathAxis

use of org.sirix.service.xml.xpath.XPathAxis in project sirix by sirixdb.

the class FunctionsXMarkTest method testSubstringAfter.

/**
 * Test function substring-after().
 *
 * @throws SirixXPathException
 */
@Ignore
@Test
public final void testSubstringAfter() throws SirixXPathException {
    final String query = "fn:substring-after(\"query\", \"u\")";
    final String result = "ery";
    XPathStringChecker.testIAxisConventions(new XPathAxis(holder.getReader(), query), new String[] { result });
}
Also used : XPathAxis(org.sirix.service.xml.xpath.XPathAxis) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 19 with XPathAxis

use of org.sirix.service.xml.xpath.XPathAxis in project sirix by sirixdb.

the class FunctionsXMarkTest method testMax.

/**
 * Test function max().
 *
 * @throws SirixXPathException
 */
@Ignore
@Test
public final void testMax() throws SirixXPathException {
    final String query = "fn:max(for $i in /site/open_auctions/open_auction return $i/reserve/text())";
    final String result = "4701.79";
    XPathStringChecker.testIAxisConventions(new XPathAxis(holder.getReader(), query), new String[] { result });
}
Also used : XPathAxis(org.sirix.service.xml.xpath.XPathAxis) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 20 with XPathAxis

use of org.sirix.service.xml.xpath.XPathAxis in project sirix by sirixdb.

the class FunctionsXMarkTest method testExactlyOne.

/**
 * Test function exactly-one(). alternative query: exactly-one('a') -> result: a
 *
 * @throws SirixXPathException
 */
@Ignore
@Test
public final void testExactlyOne() throws SirixXPathException {
    final String query = "exactly-one(/site/people/person[@id=\"person0\"]/name)";
    final String result = "<name>Krishna Merle</name>";
    XPathStringChecker.testIAxisConventions(new XPathAxis(holder.getReader(), query), new String[] { result });
}
Also used : XPathAxis(org.sirix.service.xml.xpath.XPathAxis) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

XPathAxis (org.sirix.service.xml.xpath.XPathAxis)67 Test (org.junit.Test)62 Ignore (org.junit.Ignore)27 AbsAxisTest (org.sirix.axis.AbsAxisTest)18 SirixXPathException (org.sirix.exception.SirixXPathException)12 AbstractAxis (org.sirix.service.xml.xpath.AbstractAxis)12 Axis (org.sirix.api.Axis)6 IOException (java.io.IOException)3 WebApplicationException (javax.ws.rs.WebApplicationException)3 SessionConfiguration (org.sirix.access.conf.SessionConfiguration)3 Database (org.sirix.api.Database)3 NodeReadTrx (org.sirix.api.NodeReadTrx)3 Session (org.sirix.api.Session)3 SirixException (org.sirix.exception.SirixException)3 XPathError (org.sirix.service.xml.xpath.XPathError)3 XdmNodeReadTrx (org.sirix.api.XdmNodeReadTrx)2 LinkedList (java.util.LinkedList)1 StringTokenizer (java.util.StringTokenizer)1 QName (javax.xml.namespace.QName)1 XMLEvent (javax.xml.stream.events.XMLEvent)1