Package com.alibaba.json.bvt.path

Source Code of com.alibaba.json.bvt.path.JSONPath_list_size

package com.alibaba.json.bvt.path;

import java.util.ArrayList;
import java.util.List;

import junit.framework.TestCase;

import org.junit.Assert;

import com.alibaba.fastjson.JSONPath;

public class JSONPath_list_size extends TestCase {
    public void test_list_map() throws Exception {
        List list = new ArrayList();
        list.add(new Object());
        list.add(new Object());
        list.add(new Object());
        JSONPath path = new JSONPath("$.size()");
        Integer result = (Integer) path.eval(list);
        Assert.assertEquals(list.size(), result.intValue());
    }

}
TOP

Related Classes of com.alibaba.json.bvt.path.JSONPath_list_size

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.