Package cc.plural.jsonij.jpath

Examples of cc.plural.jsonij.jpath.PredicateComponent


        System.out.println("readSimpleIndex");
        String testString = "[1]/";
        JPathParser.JPathReader target = new JPathParser.JPathReader(testString);
        JPathParser instance = new JPathParser();
        SimpleIndexPredicate expResult = new SimpleIndexPredicate(1);
        PredicateComponent result = instance.readPredicate(target);
        assertEquals(expResult, result);
        testString = "[-3]";
        target = new JPathParser.JPathReader(testString);
        expResult = new SimpleIndexPredicate(-3);
        result = instance.readPredicate(target);
View Full Code Here


        String testString = "[$]/";
        JPathParser.JPathReader target = new JPathParser.JPathReader(testString);
        JPathParser instance = new JPathParser();

        LastIndexPredicate expResult = new LastIndexPredicate();
        PredicateComponent result = instance.readPredicate(target);
        assertEquals(expResult, result);
        testString = "[last()]/";
        target = new JPathParser.JPathReader(testString);
        result = instance.readPredicate(target);
        assertEquals(expResult, result);
View Full Code Here

    public void testReadAttributeIndex() throws Exception {
        System.out.println("readAttributeIndex");
        String testString = "[?(  \t\t @.firstName     <=     \"RAH\"    )  ]";
        JPathParser.JPathReader target = new JPathParser.JPathReader(testString);
        JPathParser instance = new JPathParser();
        PredicateComponent result = instance.readPredicate(target);
        System.out.println(result);
    }
View Full Code Here

    public void testReadUnionIndex() throws Exception {
        System.out.println("readAttributeIndex");
        String testString = "[1,2,3,4,222,34,900,345,122,22,34,44,55,555,321,22,2]";
        JPathParser.JPathReader target = new JPathParser.JPathReader(testString);
        JPathParser instance = new JPathParser();
        PredicateComponent result = instance.readPredicate(target);
        PredicateComponent expResult = new UnionPredicate(new int[] {1,2,3,4,222,34,900,345,122,22,44,55,555,321});
        assertEquals(expResult, result);
    }
View Full Code Here

    public void testFunctionPredicate() throws Exception {
        System.out.println("testFunctionPredicate");
        String testString = "[?(  regex(   @.firstName   ,   [    \"RAH\",   null]  ))]";
        JPathParser.JPathReader target = new JPathParser.JPathReader(testString);
        JPathParser instance = new JPathParser();
        PredicateComponent result = instance.readPredicate(target);
        System.out.println(result);
    }
View Full Code Here

    public void testFunctionPredicateCombined() throws Exception {
        System.out.println("testFunctionPredicateCombined");
        String testString = "[?(regex(@.firstName,\"RAH\") & @.lastName=\"HAR\")]";
        JPathParser.JPathReader target = new JPathParser.JPathReader(testString);
        JPathParser instance = new JPathParser();
        PredicateComponent result = instance.readPredicate(target);
        System.out.println(result);
    }
View Full Code Here

TOP

Related Classes of cc.plural.jsonij.jpath.PredicateComponent

Copyright © 2018 www.massapicom. 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.