Package cc.plural.jsonij.jpath

Examples of cc.plural.jsonij.jpath.KeyComponent


    public void testParse() throws Exception {
        System.out.println("parse");
        String testString = "/rah/boop[1]/boop[55]";
        JPathParser instance = new JPathParser();
        JPath<Component> result = instance.parse(testString);
        KeyComponent expResult1 = new KeyComponent("rah");
       KeyComponent expResult2 = new KeyComponent("boop");
        SimpleIndexPredicate expResult3 = new SimpleIndexPredicate(1);
        SimpleIndexPredicate expResult5 = new SimpleIndexPredicate(55);
        assertEquals(result.size(), 5, 0);
        assertEquals(expResult1, result.get(0));
        assertEquals(expResult2, result.get(1));
View Full Code Here


    public void testReadKey() throws Exception {
        System.out.println("readKey");
        String testString = "rah/boop[1]";
        JPathParser.JPathReader target = new JPathParser.JPathReader(testString);
        JPathParser instance = new JPathParser();
        KeyComponent expResult = new KeyComponent("rah");
        KeyComponent result = instance.readKey(target);
        assertEquals(expResult, result);
        testString = "boop[1]";
        target = new JPathParser.JPathReader(testString);
        instance = new JPathParser();
        expResult = new KeyComponent("boop");
        result = instance.readKey(target);
        assertEquals(expResult, result);
    }
View Full Code Here

TOP

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

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.