Package com.alibaba.json.bvt.parser

Source Code of com.alibaba.json.bvt.parser.JSONReader_error

package com.alibaba.json.bvt.parser;

import java.io.StringReader;

import junit.framework.TestCase;

import org.junit.Assert;

import com.alibaba.fastjson.JSONReader;

public class JSONReader_error extends TestCase {

    public void test_0() throws Exception {
        JSONReader reader = new JSONReader(new StringReader("[]"));

        Exception error = null;
        try {
            reader.hasNext();
        } catch (Exception e) {
            error = e;
        }
        Assert.assertNotNull(error);
       
        reader.close();
    }

    public void test_1() throws Exception {
        JSONReader reader = new JSONReader(new StringReader("{\"id\":123}"));

        reader.startObject();
        reader.readObject();

        Exception error = null;
        try {
            reader.hasNext();
        } catch (Exception e) {
            error = e;
        }
        Assert.assertNotNull(error);
        reader.close();
    }
}
TOP

Related Classes of com.alibaba.json.bvt.parser.JSONReader_error

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.