Package com.ibm.icu.impl.duration.impl

Examples of com.ibm.icu.impl.duration.impl.XMLRecordWriter


        return sb.toString();
    }

    public void testOpenClose() {
        StringWriter sw = new StringWriter();
        XMLRecordWriter xrw = new XMLRecordWriter(sw);
        assertTrue(null, xrw.open("Test"));
        assertTrue(null, xrw.close());
        xrw.flush();
        String str = sw.toString();
        assertEquals(null, "<Test></Test>", normalize(str));

        StringReader sr = new StringReader(str);
        XMLRecordReader xrr = new XMLRecordReader(sr);
View Full Code Here


        assertTrue(null, xrr.close());
    }

    public void testBool() {
        StringWriter sw = new StringWriter();
        XMLRecordWriter xrw = new XMLRecordWriter(sw);
        xrw.bool("x", true);
        xrw.bool("y", false);
        xrw.flush();
        String str = sw.toString();
        assertEquals(null, "<x>true</x><y>false</y>", normalize(str));

        StringReader sr = new StringReader(str);
        XMLRecordReader xrr = new XMLRecordReader(sr);
View Full Code Here

        for (int j = 0; j < datas.length; ++j) {
            boolean[] data = datas[j];
            String target = targets[j];

            StringWriter sw = new StringWriter();
            XMLRecordWriter xrw = new XMLRecordWriter(sw);
            xrw.boolArray("test", data);
            xrw.flush();
            String str = sw.toString();
            assertEquals("" + j, target, normalize(str));

            StringReader sr = new StringReader(str);
            XMLRecordReader xrr = new XMLRecordReader(sr);
View Full Code Here

        }
    }

    public void testCharacter() {
        StringWriter sw = new StringWriter();
        XMLRecordWriter xrw = new XMLRecordWriter(sw);
        xrw.character("x", 'a');
        xrw.character("y", 'b');
        xrw.flush();
        String str = sw.toString();
        assertEquals(null, "<x>a</x><y>b</y>", normalize(str));

        StringReader sr = new StringReader(str);
        XMLRecordReader xrr = new XMLRecordReader(sr);
View Full Code Here

        for (int j = 0; j < datas.length; ++j) {
            char[] data = datas[j];
            String target = targets[j];

            StringWriter sw = new StringWriter();
            XMLRecordWriter xrw = new XMLRecordWriter(sw);
            xrw.characterArray("test", data);
            xrw.flush();
            String str = sw.toString();
            assertEquals("" + j, target, normalize(str));

            StringReader sr = new StringReader(str);
            XMLRecordReader xrr = new XMLRecordReader(sr);
View Full Code Here

        }
    }

    public void testNamedIndex() {
        StringWriter sw = new StringWriter();
        XMLRecordWriter xrw = new XMLRecordWriter(sw);
        String[] names = { "zero", "one" };

        xrw.namedIndex("x", names, 0);
        xrw.namedIndex("y", names, 1);
        xrw.flush();
        String str = sw.toString();
        assertEquals(null, "<x>zero</x><y>one</y>", normalize(str));

        StringReader sr = new StringReader(str);
        XMLRecordReader xrr = new XMLRecordReader(sr);
View Full Code Here

        for (int j = 0; j < datas.length; ++j) {
            byte[] data = datas[j];
            String target = targets[j];

            StringWriter sw = new StringWriter();
            XMLRecordWriter xrw = new XMLRecordWriter(sw);
            xrw.namedIndexArray("test", names, data);
            xrw.flush();
            String str = sw.toString();
            assertEquals("" + j, target, normalize(str));

            StringReader sr = new StringReader(str);
            XMLRecordReader xrr = new XMLRecordReader(sr);
View Full Code Here

        }
    }

    public void testString() {
        StringWriter sw = new StringWriter();
        XMLRecordWriter xrw = new XMLRecordWriter(sw);

        String s = " This is <a> &&\t test. ";
        String s1 = " This is <a> && test. ";
        String t = " This is &lt;a> &amp;&amp; test. ";
        xrw.string("x", s);
        xrw.flush();
        String str = sw.toString();
        assertEquals("\n'" + normalize(str) + "' = \n'<x>" + t + "</x>", "<x>"
                + t + "</x>", normalize(str));

        StringReader sr = new StringReader(str);
View Full Code Here

        for (int j = 0; j < datas.length; ++j) {
            String[] data = datas[j];
            String target = targets[j];

            StringWriter sw = new StringWriter();
            XMLRecordWriter xrw = new XMLRecordWriter(sw);
            xrw.stringArray("test", data);
            xrw.flush();
            String str = sw.toString();
            assertEquals("" + j + " '" + str + "'", target, normalize(str));

            StringReader sr = new StringReader(str);
            XMLRecordReader xrr = new XMLRecordReader(sr);
View Full Code Here

            "<testList><test>It is only a test</test><test></test>" +
                "<test>This is a test</test><test> </test></testList>" +
            "</testTable>";

        StringWriter sw = new StringWriter();
        XMLRecordWriter xrw = new XMLRecordWriter(sw);
        xrw.stringTable("test", table);
        xrw.flush();
        String str = sw.toString();
        assertEquals("'" + str + "'", target, normalize(str));
    }
View Full Code Here

TOP

Related Classes of com.ibm.icu.impl.duration.impl.XMLRecordWriter

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.