Search in sources :

Example 1 with MiscCodec

use of com.alibaba.fastjson.serializer.MiscCodec in project fastjson by alibaba.

the class InetAddressDeserializerTest method test_null.

public void test_null() throws Exception {
    String input = "null";
    DefaultJSONParser parser = new DefaultJSONParser(input, ParserConfig.getGlobalInstance(), JSON.DEFAULT_PARSER_FEATURE);
    MiscCodec deser = new MiscCodec();
    Assert.assertNull(deser.deserialze(parser, null, null));
}
Also used : DefaultJSONParser(com.alibaba.fastjson.parser.DefaultJSONParser) MiscCodec(com.alibaba.fastjson.serializer.MiscCodec)

Example 2 with MiscCodec

use of com.alibaba.fastjson.serializer.MiscCodec in project fastjson by alibaba.

the class LocaleTest method test_null.

public void test_null() throws Exception {
    String input = "null";
    DefaultJSONParser parser = new DefaultJSONParser(input, ParserConfig.getGlobalInstance(), JSON.DEFAULT_PARSER_FEATURE);
    MiscCodec deser = new MiscCodec();
    Assert.assertNull(deser.deserialze(parser, null, null));
}
Also used : DefaultJSONParser(com.alibaba.fastjson.parser.DefaultJSONParser) MiscCodec(com.alibaba.fastjson.serializer.MiscCodec)

Example 3 with MiscCodec

use of com.alibaba.fastjson.serializer.MiscCodec in project fastjson by alibaba.

the class URIDeserializerTest method test_null.

public void test_null() throws Exception {
    String input = "null";
    DefaultJSONParser parser = new DefaultJSONParser(input, ParserConfig.getGlobalInstance(), JSON.DEFAULT_PARSER_FEATURE);
    MiscCodec deser = new MiscCodec();
    Assert.assertEquals(JSONToken.LITERAL_STRING, deser.getFastMatchToken());
    Assert.assertNull(deser.deserialze(parser, null, null));
}
Also used : DefaultJSONParser(com.alibaba.fastjson.parser.DefaultJSONParser) MiscCodec(com.alibaba.fastjson.serializer.MiscCodec)

Example 4 with MiscCodec

use of com.alibaba.fastjson.serializer.MiscCodec in project fastjson by alibaba.

the class InetAddressDeserializerTest method test_error_0.

public void test_error_0() throws Exception {
    String input = "'[&中国-^]'";
    DefaultJSONParser parser = new DefaultJSONParser(input, ParserConfig.getGlobalInstance(), JSON.DEFAULT_PARSER_FEATURE);
    MiscCodec deser = new MiscCodec();
    Throwable error = null;
    Object value = null;
    try {
        value = deser.deserialze(parser, null, null);
    } catch (Throwable ex) {
        error = ex;
    }
    Assert.assertNotNull(error);
}
Also used : DefaultJSONParser(com.alibaba.fastjson.parser.DefaultJSONParser) MiscCodec(com.alibaba.fastjson.serializer.MiscCodec)

Aggregations

DefaultJSONParser (com.alibaba.fastjson.parser.DefaultJSONParser)4 MiscCodec (com.alibaba.fastjson.serializer.MiscCodec)4