Examples of serializeAndConsume()


Examples of org.apache.axiom.om.OMDocument.serializeAndConsume()

                new StringReader("<elem>text</elem>")).getDocumentElement(true);
        OMDocument document = factory.createOMDocument();
        OMElement root = factory.createOMElement("root", null, document);
        root.addChild(incompleteElement);
        StringWriter out = new StringWriter();
        document.serializeAndConsume(out);
        assertXMLEqual("<root><elem>text</elem></root>", out.toString());
        assertConsumed(incompleteElement);
    }
}
View Full Code Here

Examples of org.apache.axiom.om.OMElement.serializeAndConsume()

            baos.reset();
            root.serialize(baos);
            result = baos.toString("UTF-8");
            assertResult(result);
        } else if (scenario == Scenario.SAC) {
            root.serializeAndConsume(baos);
            String result = baos.toString("UTF-8");
            assertResult(result);
        } else if (scenario == Scenario.SER_SAC) {
            root.serialize(baos);
            String result = baos.toString("UTF-8");
View Full Code Here

Examples of org.apache.axiom.om.OMElement.serializeAndConsume()

        } else if (scenario == Scenario.SER_SAC) {
            root.serialize(baos);
            String result = baos.toString("UTF-8");
            assertResult(result);
            baos.reset();
            root.serializeAndConsume(baos);
            result = baos.toString("UTF-8");
            assertResult(result);
        } else if (scenario == Scenario.SAC_SAC) {
            root.serializeAndConsume(baos);
            String result = baos.toString("UTF-8");
View Full Code Here

Examples of org.apache.axiom.om.OMElement.serializeAndConsume()

            baos.reset();
            root.serializeAndConsume(baos);
            result = baos.toString("UTF-8");
            assertResult(result);
        } else if (scenario == Scenario.SAC_SAC) {
            root.serializeAndConsume(baos);
            String result = baos.toString("UTF-8");
            assertResult(result);
            baos.reset();
            root.serializeAndConsume(baos);
            // This second serializeAndConsume is expected to throw an exception.
View Full Code Here

Examples of org.apache.axiom.om.OMElement.serializeAndConsume()

        } else if (scenario == Scenario.SAC_SAC) {
            root.serializeAndConsume(baos);
            String result = baos.toString("UTF-8");
            assertResult(result);
            baos.reset();
            root.serializeAndConsume(baos);
            // This second serializeAndConsume is expected to throw an exception.
        }
       
        return peds.numReads();
    }
View Full Code Here

Examples of org.apache.axiom.om.OMElement.serializeAndConsume()

       
        // Partially build the tree
        root.getFirstElement().getFirstElement();

        StringWriter out = new StringWriter();
        root.serializeAndConsume(out);
        assertEquals(xml, out.toString());
    }
}
View Full Code Here

Examples of org.apache.axiom.om.OMElement.serializeAndConsume()

        // Serialize and consume.  This should not cause expansion and currently won't update
        // the name of the element.
        StringWriter writer = new StringWriter();
        XMLStreamWriter xmlwriter = StAXUtils.createXMLStreamWriter(writer);
        root.serializeAndConsume(writer);
        xmlwriter.flush();
        String result = writer.toString();

        assertTrue(element.getLocalName().equals("DUMMYNAME"));
        assertTrue(element.getNamespace().getNamespaceURI().equals("http://DUMMYNS"));
View Full Code Here

Examples of org.apache.axiom.om.OMElement.serializeAndConsume()

        // Serialize and consume.  This should not cause expansion and currently won't update
        // the name of the element.
        StringWriter writer = new StringWriter();
        XMLStreamWriter xmlwriter = StAXUtils.createXMLStreamWriter(writer);
        root.serializeAndConsume(writer);
        xmlwriter.flush();
        String result = writer.toString();

        assertTrue(element.getLocalName().equals("library"));
        assertTrue(element.getNamespace().getNamespaceURI().equals(
View Full Code Here

Examples of org.apache.axiom.om.OMElement.serializeAndConsume()

        element.setNamespace(ns);
        element.setLocalName("dummy");
        // TODO: See https://issues.apache.org/jira/browse/WSCOMMONS-226
        // element.getBuilder().setCache(true);
        StringWriter writer = new StringWriter();
        element.serializeAndConsume(writer);
        // System.out.println(writer);
    }

}
View Full Code Here

Examples of org.apache.axiom.om.OMElement.serializeAndConsume()

                OMElement element = builder.getDocumentElement();
                ByteArrayOutputStream baos = new ByteArrayOutputStream();
                if (cache) {
                    element.serialize(baos);
                } else {
                    element.serializeAndConsume(baos);
                }
                assertXMLIdentical(compareXML(new InputSource(new ByteArrayInputStream(control)),
                        new InputSource(new ByteArrayInputStream(baos.toByteArray()))), true);
                if (cache) {
                    assertTrue(element.isComplete());
View Full Code Here
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.