Package org.restlet

Examples of org.restlet.Response


    private void doTest(String doctypeEncoded, String entryidEncoded,
            String doctypeDecoded, String entryidDecoded) throws IOException {
        Reference reference = createBaseRef();
        reference = new Reference(reference + "/supplemental/" + doctypeEncoded
                + "/" + entryidEncoded);
        Response response = get(reference);
        assertEquals(Status.SUCCESS_OK, response.getStatus());
        assertEquals(doctypeDecoded + "\n" + entryidDecoded + "\n", response
                .getEntity().getText());
    }
View Full Code Here


            }
        };
    }

    public void testDecoded1() throws Exception {
        Response response = get("decoded/x");
        assertEquals(Status.SUCCESS_OK, response.getStatus());
        assertEquals("x", response.getEntity().getText());

        response = get("decoded/sjkg");
        assertEquals(Status.SUCCESS_OK, response.getStatus());
        assertEquals("sjkg", response.getEntity().getText());
    }
View Full Code Here

        assertEquals(Status.SUCCESS_OK, response.getStatus());
        assertEquals("sjkg", response.getEntity().getText());
    }

    public void testDecoded2() throws Exception {
        final Response response = get("decoded/%20");
        assertEquals(Status.SUCCESS_OK, response.getStatus());
        assertEquals(" ", response.getEntity().getText());
    }
View Full Code Here

        assertEquals(" ", response.getEntity().getText());
    }

    /** @see PathParamTestService2#encoded(String) */
    public void testEncoded() throws Exception {
        Response response = get("encoded/x");
        assertEquals(Status.SUCCESS_OK, response.getStatus());
        assertEquals("x", response.getEntity().getText());

        response = get("encoded/sjkg");
        assertEquals(Status.SUCCESS_OK, response.getStatus());
        assertEquals("sjkg", response.getEntity().getText());

        response = get("encoded/%20");
        assertEquals(Status.SUCCESS_OK, response.getStatus());
        assertEquals("%20", response.getEntity().getText());
    }
View Full Code Here

        assertEquals(Status.SUCCESS_OK, response.getStatus());
        assertEquals("%20", response.getEntity().getText());
    }

    public void testGetBigDecimal() throws IOException {
        Response response = get("BigDecimal/413624654744743534745767");
        assertEquals(Status.SUCCESS_OK, response.getStatus());
        assertEquals("413624654744743534745767", response.getEntity().getText());

        response = get("BigDecimal/abc");
        assertTrue(response.getStatus().isError());
    }
View Full Code Here

        response = get("BigDecimal/abc");
        assertTrue(response.getStatus().isError());
    }

    public void testGetInt() throws IOException {
        Response response = get("int/467");
        assertEquals(Status.SUCCESS_OK, response.getStatus());
        assertEquals("467", response.getEntity().getText());

        response = get("int/abc");
        assertTrue(response.getStatus().isError());
    }
View Full Code Here

        response = get("int/abc");
        assertTrue(response.getStatus().isError());
    }

    public void testGetInteger() throws IOException {
        Response response = get("Integer/4423467");
        assertEquals(Status.SUCCESS_OK, response.getStatus());
        assertEquals("4423467", response.getEntity().getText());

        response = get("Integer/423645365467345743734");
        assertTrue(response.getStatus().isError());
        assertEquals(Status.CLIENT_ERROR_NOT_FOUND, response.getStatus());

        response = get("Integer/abc");
        assertTrue(response.getStatus().isError());
        assertEquals(Status.CLIENT_ERROR_NOT_FOUND, response.getStatus());
    }
View Full Code Here

        assertTrue(response.getStatus().isError());
        assertEquals(Status.CLIENT_ERROR_NOT_FOUND, response.getStatus());
    }

    public void testGetMediaType() throws IOException {
        Response response = get("MediaType/467");
        assertEquals(Status.SUCCESS_OK, response.getStatus());
        assertEquals("467/*", response.getEntity().getText());

        response = get("MediaType/abc");
        assertEquals(Status.SUCCESS_OK, response.getStatus());
        assertEquals("abc/*", response.getEntity().getText());
    }
View Full Code Here

        assertEquals(Status.SUCCESS_OK, response.getStatus());
        assertEquals("abc/*", response.getEntity().getText());
    }

    public void testGetMn() throws IOException {
        Response response = get("mn467");
        assertEquals(Status.SUCCESS_OK, response.getStatus());
        assertEquals("467", response.getEntity().getText());

        response = get("mnabc");
        assertTrue(response.getStatus().isError());
        assertEquals(Status.CLIENT_ERROR_NOT_FOUND, response.getStatus());
    }
View Full Code Here

        assertEquals(Status.CLIENT_ERROR_NOT_FOUND, response.getStatus());
    }

    /** @see PathParamTestService2#getMultSegment(String) */
    public void testGetWithSlashInUriParam() throws IOException {
        final Response response = get("multSegm/abc/def");
        assertEquals(Status.SUCCESS_OK, response.getStatus());
        assertEquals("abc/def", response.getEntity().getText());
    }
View Full Code Here

TOP

Related Classes of org.restlet.Response

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.