Search in sources :

Example 46 with XPathAxis

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

the class FunctionsXMarkTest method testCount.

/**
 * Test function count().
 *
 * @throws SirixXPathException
 */
@Ignore
@Test
public final void testCount() throws SirixXPathException {
    final String query = "fn:count(for $i in /site/closed_auctions/closed_auction[price/text() >= 40] return $i/price)";
    final String result = "670";
    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 47 with XPathAxis

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

the class FunctionsXMarkTest method testLast.

/**
 * Test function last().
 *
 * @throws SirixXPathException
 */
@Ignore
@Test
public final void testLast() throws SirixXPathException {
    final String query = "/site/open_auctions/open_auction/reserve[last()]";
    final String result = "<reserve>539.66</reserve>";
    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 48 with XPathAxis

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

the class FunctionsXMarkTest method testMin.

/**
 * Test function min().
 *
 * @throws SirixXPathException
 */
@Ignore
@Test
public final void testMin() throws SirixXPathException {
    final String query = "fn:min(for $i in /site/open_auctions/open_auction return $i/reserve/text())";
    final String result = "0.43";
    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 49 with XPathAxis

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

the class FunctionsXMarkTest method testNode.

/**
 * Test function node().
 *
 * @throws SirixXPathException
 */
@Ignore
@Test
public final void testNode() throws SirixXPathException {
    final String query = "for $b in /site/people/person[@id=\"person1\"] return $b/name/node()";
    final String result = "Keung Yetim";
    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 50 with XPathAxis

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

the class FunctionsXMarkTest method testZeroOrOne.

/**
 * Test function zero-or-one(). alternative query: zero-or-one('a') -> result: a
 *
 * @throws SirixXPathException
 */
@Ignore
@Test
public final void testZeroOrOne() throws SirixXPathException {
    final String query = " for $i in /site/open_auctions/open_auction return zero-or-one($i/reserve[text()=\"20.54\"]/text())";
    final String result = "20.54";
    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