Package org.wiztools.restclient.bean

Examples of org.wiztools.restclient.bean.ResponseBean


        expResult.setFollowRedirect(true);
        return expResult;
    }

    private ResponseBean getDefaultResponseBean(){
        ResponseBean expResult = new ResponseBean();
        expResult.setStatusLine("HTTP/1.1 200 OK");
        expResult.setStatusCode(200);
        expResult.addHeader("Content-Type", "text/plain; charset=utf-8");
        expResult.addHeader("Transfer-Encoding", "chunked");
        expResult.addHeader("Server", "Jetty(6.1.25)");
        expResult.setResponseBody(Util.base64decodeByteArray("KipSRVNUQ2xpZW50IFRyYWNlU2VydmxldCoqCgoqTWV0aG9kKgoJR0VUCgoqUGF0aCBJbmZvKgoJLwoKKkhlYWRlcnMqCglIb3N0OiBsb2NhbGhvc3Q6MTAxMDEKCUNvbm5lY3Rpb246IEtlZXAtQWxpdmUKCVVzZXItQWdlbnQ6IEFwYWNoZS1IdHRwQ2xpZW50LzQuMi4xIChqYXZhIDEuNSkKCipRdWVyeSBTdHJpbmcqCgludWxsCgoqUGFyYW1ldGVycyoKCipCb2R5IChGaXJzdCAxMDAgY2hhcmFjdGVycyBvbmx5KSoKCQoK"));
        return expResult;
    }
View Full Code Here


     * Test of writeResponseXML method, of class XMLUtil.
     */
    @Test
    public void testWriteResponseXML() throws Exception {
        System.out.println("writeResponseXML");
        ResponseBean bean = getDefaultResponseBean();
        File f = File.createTempFile("prefix", ".rcs");
        XMLUtil.writeResponseXML(bean, f);
        Response expResult = XMLUtil.getResponseFromXMLFile(f);
        assertEquals(expResult, bean);
    }
View Full Code Here

    @Test
    public void testGetResponseFromXMLFile() throws Exception {
        System.out.println("getResponseFromXMLFile");
        File f = new File("src/test/resources/resFromXml.rcs");

        ResponseBean expResult = getDefaultResponseBean();
       
        Response result = XMLUtil.getResponseFromXMLFile(f);
        assertEquals(expResult, result);
    }
View Full Code Here

TOP

Related Classes of org.wiztools.restclient.bean.ResponseBean

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.