Package com.alibaba.fastjson.support.odps.udf

Examples of com.alibaba.fastjson.support.odps.udf.JSONContainsValue


import com.alibaba.fastjson.support.odps.udf.JSONContainsValue;


public class JSONContainsValue_Test extends TestCase {
    public void test_contians() throws Exception {
        JSONContainsValue udf = new JSONContainsValue();
        Assert.assertTrue(udf.evaluate("{\"name\":\"123\"}", "$.name", "123"));
        Assert.assertFalse(udf.evaluate("{\"name\":\"123\"}", "$.name", "124"));
        Assert.assertTrue(udf.evaluate("{\"name\":\"123\"}", "$.value", (Long) null));
    }
View Full Code Here


        Assert.assertFalse(udf.evaluate("{\"name\":\"123\"}", "$.name", "124"));
        Assert.assertTrue(udf.evaluate("{\"name\":\"123\"}", "$.value", (Long) null));
    }
   
    public void test_array_contians() throws Exception {
        JSONContainsValue udf = new JSONContainsValue();
        Assert.assertTrue(udf.evaluate("{\"name\":[\"123\"]}", "$.name", "123"));
        Assert.assertFalse(udf.evaluate("{\"name\":[\"123\"]}", "$.name", "124"));
        Assert.assertTrue(udf.evaluate("{\"name\":[\"123\"]}", "$.value", (Long) null));
        Assert.assertFalse(udf.evaluate("{\"name\":[\"123\"]}", "$.name", (Long) null));
    }
View Full Code Here

TOP

Related Classes of com.alibaba.fastjson.support.odps.udf.JSONContainsValue

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.