Package com.alibaba.json.bvt

Source Code of com.alibaba.json.bvt.JSON_toJavaObject_test$IB

package com.alibaba.json.bvt;

import junit.framework.Assert;
import junit.framework.TestCase;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.parser.ParserConfig;
import com.alibaba.fastjson.util.TypeUtils;

public class JSON_toJavaObject_test extends TestCase {

    public void test_0() throws Exception {
        A a = (A) JSON.toJavaObject(new JSONObject(), A.class);
        Assert.assertNotNull(a);
    }

    public void test_1() throws Exception {
        A a = (A) TypeUtils.cast(new B(), A.class, ParserConfig.getGlobalInstance());
        Assert.assertNotNull(a);
    }

    public static class A {

    }

    public static interface IB {

    }

    public static class B extends A implements IB {

    }
}
TOP

Related Classes of com.alibaba.json.bvt.JSON_toJavaObject_test$IB

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.