Examples of LastIndexPredicate


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
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.