Package org.restlet

Examples of org.restlet.Response


* @see MatrixParam
*/
public class MatrixParamTest extends JaxRsTestCase {

    public void checkBothGiven(String subPath) throws IOException {
        Response response = get(subPath + ";firstname=Angela;lastname=Merkel");
        assertEquals(Status.SUCCESS_OK, response.getStatus());
        assertEquals("Angela Merkel", response.getEntity().getText());

        response = get(subPath + ";lastname=Merkel;firstname=Angela");
        assertEquals(Status.SUCCESS_OK, response.getStatus());
        assertEquals("Angela Merkel", response.getEntity().getText());
    }
View Full Code Here


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

    public void checkOneGiven(String subPath) throws IOException {
        Response response = get(subPath + ";firstname=Goofy");
        assertEquals(Status.SUCCESS_OK, response.getStatus());
        assertEquals("Goofy null", response.getEntity().getText());

        response = get(subPath + ";lastname=Goofy");
        assertEquals(Status.SUCCESS_OK, response.getStatus());
        assertEquals("null Goofy", response.getEntity().getText());
    }
View Full Code Here

        checkBothGiven("b");
        checkOneGiven("b");
    }

    public void testCheckUnmodifiable() {
        Response response = get("checkUnmodifiable");
        assertTrue(
                "The List annotated with @MatrixParam seems to be modifiable",
                response.getStatus().isSuccess());
    }
View Full Code Here

                "The List annotated with @MatrixParam seems to be modifiable",
                response.getStatus().isSuccess());
    }

    public void testDecoded() throws IOException {
        final Response response = get("b;firstname=George%20U.;lastname=Bush");
        assertEquals(Status.SUCCESS_OK, response.getStatus());
        assertEquals("George U. Bush", response.getEntity().getText());
    }
View Full Code Here

        assertEquals("George U. Bush", response.getEntity().getText());
    }

    /** @see MatrixParamTestService#encoded(String, String) */
    public void testEncoded() throws IOException {
        final Response response = get("encoded;firstname=George%20U.;lastname=Bush");
        assertEquals(Status.SUCCESS_OK, response.getStatus());
        assertEquals("George%20U. Bush", response.getEntity().getText());
    }
View Full Code Here

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

    public void testOne1() throws Exception {
        final Response response = get("one;name");
        sysOutEntityIfError(response);
        assertEquals(Status.SUCCESS_OK, response.getStatus());
        assertEquals("[empty]", response.getEntity().getText());
    }
View Full Code Here

        assertEquals(Status.SUCCESS_OK, response.getStatus());
        assertEquals("[empty]", response.getEntity().getText());
    }

    public void testOne2() throws Exception {
        final Response response = get("one;name=");
        sysOutEntityIfError(response);
        assertEquals(Status.SUCCESS_OK, response.getStatus());
        assertEquals("[empty]", response.getEntity().getText());
    }
View Full Code Here

        assertEquals(Status.SUCCESS_OK, response.getStatus());
        assertEquals("[empty]", response.getEntity().getText());
    }

    public void testOne3() throws Exception {
        final Response response = get("one;name=x");
        sysOutEntityIfError(response);
        assertEquals(Status.SUCCESS_OK, response.getStatus());
        assertEquals("x", response.getEntity().getText());
    }
View Full Code Here

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

    public void testOne4() throws Exception {
        final Response response = get("one;name2=sdf");
        sysOutEntityIfError(response);
        assertEquals(Status.SUCCESS_OK, response.getStatus());
        assertEquals("[null]", response.getEntity().getText());
    }
View Full Code Here

        assertEquals(Status.SUCCESS_OK, response.getStatus());
        assertEquals("[null]", response.getEntity().getText());
    }

    public void testSemicolon() {
        final Response response1 = get("semicolon");
        assertEquals(Status.CLIENT_ERROR_NOT_FOUND, response1.getStatus());
        sysOutEntityIfError(response1);

        final Response response2 = get("semicolon;mpA=6");
        assertEquals(Status.CLIENT_ERROR_NOT_FOUND, response2.getStatus());
        sysOutEntityIfError(response2);

        final Response response3 = get("semicolon;mpB=6");
        assertEquals(Status.CLIENT_ERROR_NOT_FOUND, response3.getStatus());
        sysOutEntityIfError(response3);

        final Response response4 = get("semicolon;mpB=6;mpA=5");
        assertEquals(Status.CLIENT_ERROR_NOT_FOUND, response4.getStatus());
        sysOutEntityIfError(response4);

        final Response response5 = get("semicolon;mpA=5;mpB=6");
        assertEquals(Status.CLIENT_ERROR_NOT_FOUND, response5.getStatus());
        sysOutEntityIfError(response5);
    }
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.