Search in sources :

Example 6 with NestedAxis

use of org.sirix.axis.NestedAxis in project sirix by sirixdb.

the class ConcurrentAxisTest method testSeriellNew.

/**
 * Test seriell.
 */
// @Bench
@Test
public void testSeriellNew() throws Exception {
    /* query: //regions/africa//location */
    final int resultNumber = 55;
    final Axis axis = new NestedAxis(new NestedAxis(new FilterAxis(new DescendantAxis(holder.getReader(), IncludeSelf.YES), new NameFilter(holder.getReader(), "regions")), new FilterAxis(new ChildAxis(holder.getReader()), new NameFilter(holder.getReader(), "africa"))), new FilterAxis(new DescendantAxis(holder.getReader(), IncludeSelf.YES), new NameFilter(holder.getReader(), "location")));
    for (int i = 0; i < resultNumber; i++) {
        assertEquals(true, axis.hasNext());
        axis.next();
    }
    assertEquals(false, axis.hasNext());
}
Also used : ChildAxis(org.sirix.axis.ChildAxis) NameFilter(org.sirix.axis.filter.NameFilter) NestedAxis(org.sirix.axis.NestedAxis) DescendantAxis(org.sirix.axis.DescendantAxis) Axis(org.sirix.api.Axis) NestedAxis(org.sirix.axis.NestedAxis) ChildAxis(org.sirix.axis.ChildAxis) FilterAxis(org.sirix.axis.filter.FilterAxis) DescendantAxis(org.sirix.axis.DescendantAxis) XPathAxis(org.sirix.service.xml.xpath.XPathAxis) FilterAxis(org.sirix.axis.filter.FilterAxis) Test(org.junit.Test)

Example 7 with NestedAxis

use of org.sirix.axis.NestedAxis in project sirix by sirixdb.

the class ConcurrentAxisTest method testPartConcurrentDescAxis1.

/**
 * Test concurrent.
 *
 * @throws SirixXPathException
 */
// @Bench
@Test
public void testPartConcurrentDescAxis1() throws Exception {
    /* query: //regions/africa//location */
    final int resultNumber = 55;
    final XdmNodeReadTrx firstConcurrRtx = holder.getResourceManager().beginNodeReadTrx();
    final Axis axis = new NestedAxis(new NestedAxis(new ConcurrentAxis(firstConcurrRtx, new FilterAxis(new DescendantAxis(holder.getReader(), IncludeSelf.YES), new NameFilter(holder.getReader(), "regions"))), new FilterAxis(new ChildAxis(firstConcurrRtx), new NameFilter(firstConcurrRtx, "africa"))), new FilterAxis(new DescendantAxis(firstConcurrRtx, IncludeSelf.YES), new NameFilter(firstConcurrRtx, "location")));
    for (int i = 0; i < resultNumber; i++) {
        assertEquals(true, axis.hasNext());
        axis.next();
    }
    assertEquals(false, axis.hasNext());
}
Also used : ChildAxis(org.sirix.axis.ChildAxis) NameFilter(org.sirix.axis.filter.NameFilter) XdmNodeReadTrx(org.sirix.api.XdmNodeReadTrx) NestedAxis(org.sirix.axis.NestedAxis) DescendantAxis(org.sirix.axis.DescendantAxis) Axis(org.sirix.api.Axis) NestedAxis(org.sirix.axis.NestedAxis) ChildAxis(org.sirix.axis.ChildAxis) FilterAxis(org.sirix.axis.filter.FilterAxis) DescendantAxis(org.sirix.axis.DescendantAxis) XPathAxis(org.sirix.service.xml.xpath.XPathAxis) FilterAxis(org.sirix.axis.filter.FilterAxis) Test(org.junit.Test)

Aggregations

NestedAxis (org.sirix.axis.NestedAxis)7 Test (org.junit.Test)6 ChildAxis (org.sirix.axis.ChildAxis)6 DescendantAxis (org.sirix.axis.DescendantAxis)6 Axis (org.sirix.api.Axis)5 FilterAxis (org.sirix.axis.filter.FilterAxis)5 NameFilter (org.sirix.axis.filter.NameFilter)4 XPathAxis (org.sirix.service.xml.xpath.XPathAxis)4 XdmNodeReadTrx (org.sirix.api.XdmNodeReadTrx)3 FollowingSiblingAxis (org.sirix.axis.FollowingSiblingAxis)2 ParentAxis (org.sirix.axis.ParentAxis)2 UnionAxis (org.sirix.service.xml.xpath.expr.UnionAxis)2 DupFilterAxis (org.sirix.service.xml.xpath.filter.DupFilterAxis)2 AbstractAxis (org.sirix.axis.AbstractAxis)1 AncestorAxis (org.sirix.axis.AncestorAxis)1 FollowingAxis (org.sirix.axis.FollowingAxis)1 PrecedingAxis (org.sirix.axis.PrecedingAxis)1 PrecedingSiblingAxis (org.sirix.axis.PrecedingSiblingAxis)1 SelfAxis (org.sirix.axis.SelfAxis)1