Code example for ByteArrayOutputStream

Methods: toString

0
        NamespaceContext nsCtx = new SimpleNamespaceContext(m);
        XMLUnit.setXpathNamespaceContext(nsCtx);
    } 
 
    protected String getStringResultOfTest(OMElement elem) throws Exception {
        OutputStream os = new ByteArrayOutputStream();
        elem.serialize(os);
        return os.toString();
    } 
 
    protected void startCustomAxis2Server(String httpPort, String httpsPort) throws Exception {
        System.setProperty("http_port", httpPort);
        System.setProperty("https_port", httpsPort);
        SampleAxis2ServerManager.getInstance().start(new String[]{"-repo",
                "modules/samples/target/test_repos/axis2Server/", 
                    "-conf", "modules/samples/target/test_repos/axis2Server/conf/axis2.xml"}); 
    } 
    protected void stopCustomAxis2Server(String httpPort, String httpsPort) throws Exception {
        SampleAxis2ServerManager.getInstance().stop(); 
    }