Package com.hp.hpl.jena.query

Examples of com.hp.hpl.jena.query.ResultSetRewindable.reset()


    {
        ResultSetRewindable rs1 = new ResultSetMem() ;
        ResultSetRewindable rs2 = new ResultSetMem() ;
        assertTrue(ResultSetCompare.equalsByTerm(rs1, rs2)) ;
        rs1.reset() ;
        rs2.reset() ;
        assertTrue(ResultSetCompare.equalsByTerm(rs1, rs2)) ;
    }
   
    @Test public void test_RS_cmp_2()
    {
View Full Code Here


        // Same variable, different values
        ResultSetRewindable rs1 = makeRewindable("x", com.hp.hpl.jena.graph.NodeFactory.createURI("tag:local:1")) ;
        ResultSetRewindable rs2 = makeRewindable("x", com.hp.hpl.jena.graph.NodeFactory.createURI("tag:local:2")) ;
        assertFalse(ResultSetCompare.equalsByTerm(rs1, rs2)) ;
        rs1.reset() ;
        rs2.reset() ;
        assertFalse(ResultSetCompare.equalsByTerm(rs1, rs2)) ;
    }

    @Test public void test_RS_cmp_6()
    {
View Full Code Here

        // Different variable, same values
        ResultSetRewindable rs1 = makeRewindable("x", com.hp.hpl.jena.graph.NodeFactory.createURI("tag:local")) ;
        ResultSetRewindable rs2 = makeRewindable("y", com.hp.hpl.jena.graph.NodeFactory.createURI("tag:local")) ;
        assertFalse(ResultSetCompare.equalsByTermAndOrder(rs1, rs2)) ;
        rs1.reset() ;
        rs2.reset() ;
        assertFalse(ResultSetCompare.equalsByTerm(rs1, rs2)) ;
    }
   
    // Value based
    @Test public void test_RS_cmp_value_1()
View Full Code Here

        ResultSetPeekable rs = ResultSetFactory.makePeekable(inner);
        assertTrue(rs.hasNext());
        assertNotNull(rs.peek());
       
        // Reset the inner result set independently
        inner.reset();
       
        // Since we moved the underlying result set backwards but we hadn't gone anywhere
        // we should still be able to safely access the underlying results
        assertTrue(rs.hasNext());
    }
View Full Code Here

        assertTrue(rs.hasNext());
        assertNotNull(rs.peek());
        assertNotNull(rs.next());
       
        // Reset the inner result set independently
        inner.reset();
       
        // Since we moved the underlying result set backwards and had moved somewhere we
        // are now in an illegal state
        rs.hasNext();
    }
View Full Code Here

    {
        ResultSetRewindable rs1 = ResultSetFactory.makeRewindable(BuilderResultSet.build(SSE.parseItem(StrUtils.strjoinNL(rs1$)))) ;
        ResultSetRewindable rs2 = ResultSetFactory.makeRewindable(BuilderResultSet.build(SSE.parseItem(StrUtils.strjoinNL(rs2$)))) ;
        assertTrue(ResultSetCompare.isomorphic(rs1, rs2)) ;
        rs1.reset() ;
        rs2.reset() ;  
        assertTrue(ResultSetCompare.equalsByTerm(rs1, rs2)) ;
        assertTrue(ResultSetCompare.equalsByValue(rs1, rs2)) ;
    }

    // -------- Support functions
View Full Code Here

        // See if the same.
        boolean b = ResultSetCompare.equalsByValue(rs1, rs2) ;
        if ( !b )
        {
            rs1.reset() ;
            rs2.reset() ;
            System.out.println("------------------- "+this.getName());
            System.out.printf("**** Expected (%s)", expectedLabel) ;
            ResultSetFormatter.out(System.out, rs1) ;
            System.out.println("**** Got (TDB)") ;
            ResultSetFormatter.out(System.out, rs2) ;
View Full Code Here

        boolean b = ResultSetCompare.equalsByValue(rsw1, rsw2) ;
        if ( b != result)
        {
            System.out.println("Different: ") ;
            rsw1.reset() ;
            rsw2.reset() ;
            ResultSetFormatter.out(rsw1) ;
            ResultSetFormatter.out(rsw2) ;
            System.out.println() ;
        }
       
View Full Code Here

        ResultSetRewindable rs2a = ResultSetFactory.makeRewindable(rs2) ;
       
        if ( equivalent(convert(rs1a), convert(rs2a), new BNodeIso(NodeUtils.sameValue)) )
            return true ;
        rs1a.reset() ;   
        rs2a.reset() ;
        return isomorphic(rs1, rs2) ;
    }
   
    public static boolean equalsByTest(Collection<Binding> b1, Collection<Binding> b2, EqualityTest match)
    {
View Full Code Here

        ResultSetRewindable rs2a = ResultSetFactory.makeRewindable(rs2) ;
       
        if ( equivalent(convert(rs1a), convert(rs2a), new BNodeIso(NodeUtils.sameTerm)) )
            return true ;
        rs1a.reset() ;   
        rs2a.reset() ;
        return isomorphic(rs1, rs2) ;
    }

   
    /** Compare two result sets for equivalence.  Equivalance means:
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.