Package com.alibaba.json.bvt.serializer

Source Code of com.alibaba.json.bvt.serializer.SerialWriterTest

package com.alibaba.json.bvt.serializer;

import junit.framework.TestCase;

import org.junit.Assert;

import com.alibaba.fastjson.serializer.SerializeWriter;

public class SerialWriterTest extends TestCase {

    public void test_0() throws Exception {
        for (int i = 0; i < 3; ++i) {
            {
                String text = "abc";
                String charset = "UTF-8";
                SerializeWriter writer = new SerializeWriter();
                writer.append(text);
                byte[] bytes = writer.toBytes(charset);
                Assert.assertArrayEquals(text.getBytes(charset), bytes);
            }
           
            {
                String text = "efg";
                String charset = "UTF-8";
                SerializeWriter writer = new SerializeWriter();
                writer.append(text);
                byte[] bytes = writer.toBytes(charset);
                Assert.assertArrayEquals(text.getBytes(charset), bytes);
            }
        }
    }
}
TOP

Related Classes of com.alibaba.json.bvt.serializer.SerialWriterTest

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.