Package com.alibaba.fastjson.serializer

Examples of com.alibaba.fastjson.serializer.SerialWriterStringEncoder


public class SerialWriterStringEncoderTest2 extends TestCase {

    public void test_error_0() throws Exception {
        Charset charset = Charset.forName("UTF-8");
        CharsetEncoder charsetEncoder = new MockCharsetEncoder2(charset);
        SerialWriterStringEncoder encoder = new SerialWriterStringEncoder(charsetEncoder);

        Exception error = null;
        char[] chars = "abc".toCharArray();
        try {
            encoder.encode(chars, 0, chars.length);
        } catch (Exception ex) {
            error = ex;
        }
        Assert.assertNotNull(error);
    }
View Full Code Here


   
    public void test_error_1() throws Exception {
        Charset charset = Charset.forName("UTF-8");
        CharsetEncoder realEncoder = charset.newEncoder();
        CharsetEncoder charsetEncoder = new MockCharsetEncoder(charset, realEncoder);
        SerialWriterStringEncoder encoder = new SerialWriterStringEncoder(charsetEncoder);

        Exception error = null;
        char[] chars = "abc".toCharArray();
        try {
            encoder.encode(chars, 0, chars.length);
        } catch (Exception ex) {
            error = ex;
        }
        Assert.assertNotNull(error);
    }
View Full Code Here

public class SerialWriterStringEncoderTest2 extends TestCase {

    public void test_error_0() throws Exception {
        Charset charset = Charset.forName("UTF-8");
        CharsetEncoder charsetEncoder = new MockCharsetEncoder2(charset);
        SerialWriterStringEncoder encoder = new SerialWriterStringEncoder(charsetEncoder);

        Exception error = null;
        char[] chars = "abc".toCharArray();
        try {
            encoder.encode(chars, 0, chars.length);
        } catch (Exception ex) {
            error = ex;
        }
        Assert.assertNotNull(error);
    }
View Full Code Here

   
    public void test_error_1() throws Exception {
        Charset charset = Charset.forName("UTF-8");
        CharsetEncoder realEncoder = charset.newEncoder();
        CharsetEncoder charsetEncoder = new MockCharsetEncoder(charset, realEncoder);
        SerialWriterStringEncoder encoder = new SerialWriterStringEncoder(charsetEncoder);

        Exception error = null;
        char[] chars = "abc".toCharArray();
        try {
            encoder.encode(chars, 0, chars.length);
        } catch (Exception ex) {
            error = ex;
        }
        Assert.assertNotNull(error);
    }
View Full Code Here

TOP

Related Classes of com.alibaba.fastjson.serializer.SerialWriterStringEncoder

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.