FileDocCategorySizeDatePackage
FastXmlSerializerTest.javaAPI DocAndroid 5.1 API1554Thu Mar 12 22:22:12 GMT 2015com.android.internal.util

FastXmlSerializerTest

public class FastXmlSerializerTest extends TestCase
Tests for {@link FastXmlSerializer}

Fields Summary
Constructors Summary
Methods Summary
public voidtestEmptyText()

        final ByteArrayOutputStream stream = new ByteArrayOutputStream();

        final XmlSerializer out = new FastXmlSerializer();
        out.setOutput(stream, "utf-8");
        out.startDocument(null, true);
        out.setFeature("http://xmlpull.org/v1/doc/features.html#indent-output", true);

        out.startTag(null, "string");
        out.attribute(null, "name", "meow");
        out.text("");
        out.endTag(null, "string");

        out.endDocument();

        assertEquals("<?xml version='1.0' encoding='utf-8' standalone='yes' ?>\n"
                + "<string name=\"meow\"></string>", stream.toString());