Package com.alibaba.fastjson.parser

Examples of com.alibaba.fastjson.parser.DefaultExtJSONParser


    parser.config(Feature.IgnoreNotMatch, false);
  }

  public void test_1() throws Exception {
    DefaultExtJSONParser parser = new DefaultExtJSONParser("[]");
    parser.parseArray(Class.class);
  }
View Full Code Here


    DefaultExtJSONParser parser = new DefaultExtJSONParser("[]");
    parser.parseArray(Class.class);
  }

  public void test_2() throws Exception {
    DefaultExtJSONParser parser = new DefaultExtJSONParser("{}");
    parser.parseObject(Object.class);
  }
View Full Code Here

    DefaultExtJSONParser parser = new DefaultExtJSONParser("{}");
    parser.parseObject(Object.class);
  }

  public void test_3() throws Exception {
    DefaultExtJSONParser parser = new DefaultExtJSONParser("{}");
    parser.parseObject(User.class);
  }
View Full Code Here

  }

  public void test_error_0() throws Exception {
    JSONException error = null;
    try {
      DefaultExtJSONParser parser = new DefaultExtJSONParser("123");
      parser.parseObject(Class.class);
    } catch (JSONException e) {
      error = e;
    }
    Assert.assertNotNull(error);
  }
View Full Code Here

  }

  public void test_error_1() throws Exception {
    JSONException error = null;
    try {
      DefaultExtJSONParser parser = new DefaultExtJSONParser("[{}]");
      parser.parseArray(Class.class);
    } catch (JSONException e) {
      error = e;
    }
    Assert.assertNotNull(error);
  }
View Full Code Here

  }

  public void test_error_2() throws Exception {
    JSONException error = null;
    try {
      DefaultExtJSONParser parser = new DefaultExtJSONParser(
          "{\"errorValue\":33}");
      parser.parseArray(User.class);
    } catch (JSONException e) {
      error = e;
    }
    Assert.assertNotNull(error);
  }
View Full Code Here

  }

  public void test_error_3() throws Exception {
    JSONException error = null;
    try {
      DefaultExtJSONParser parser = new DefaultExtJSONParser(
          "{\"age\"33}");
      parser.parseArray(User.class);
    } catch (JSONException e) {
      error = e;
    }
    Assert.assertNotNull(error);
  }
View Full Code Here

  }

  public void test_error_4() throws Exception {
    JSONException error = null;
    try {
      DefaultExtJSONParser parser = new DefaultExtJSONParser(
          "[\"age\":33}");
      parser.parseObject(new User());
    } catch (JSONException e) {
      error = e;
    }
    Assert.assertNotNull(error);
  }
View Full Code Here

import com.alibaba.fastjson.parser.ParserConfig;

public class DateParserTest_sql extends TestCase {

    public void f_test_date_0() throws Exception {
        DefaultExtJSONParser parser = new DefaultExtJSONParser("1294552193254");

        java.sql.Date date = parser.parseObject(java.sql.Date.class);

        Assert.assertEquals(new java.sql.Date(1294552193254L), date);
    }
View Full Code Here

    }

    public void test_date_1() throws Exception {
        int featrues = JSON.DEFAULT_PARSER_FEATURE;
        featrues = Feature.config(featrues, Feature.AllowISO8601DateFormat, true);
        DefaultExtJSONParser parser = new DefaultExtJSONParser("\"2011-01-09T13:49:53.254\"", ParserConfig.getGlobalInstance(), featrues);

        java.sql.Date date = parser.parseObject(java.sql.Date.class);

        Assert.assertEquals(new java.sql.Date(1294552193254L), date);
    }
View Full Code Here

TOP

Related Classes of com.alibaba.fastjson.parser.DefaultExtJSONParser

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.