Package cc.plural.jsonij.jpath

Examples of cc.plural.jsonij.jpath.LastIndexPredicate


        System.out.println("readLastIndex");
        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);
        testString = "[$-1]/";
        target = new JPathParser.JPathReader(testString);
        result = instance.readPredicate(target);
        expResult = new LastIndexPredicate(1);
        assertEquals(expResult, result);
        testString = "[last()-5]/";
        target = new JPathParser.JPathReader(testString);
        result = instance.readPredicate(target);
        expResult = new LastIndexPredicate(5);
        assertEquals(expResult, result);
    }
View Full Code Here

TOP

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

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.