Package org.restlet

Examples of org.restlet.Client.stop()


        final Response response = client.handle(request);

        assertEquals("Short username did not throw 401",
                Status.CLIENT_ERROR_UNAUTHORIZED, response.getStatus());
       
        client.stop();
    }

    public void HTTPBasicWrongUser() throws Exception {
        final Request request = new Request(Method.GET, this.uri);
        final Client client = new Client(Protocol.HTTP);
View Full Code Here


        final Response response = client.handle(request);

        assertEquals("Wrong username did not throw 401",
                Status.CLIENT_ERROR_UNAUTHORIZED, response.getStatus());
       
        client.stop();
    }

    @Before
    public void makeServer() throws Exception {
        int port = TEST_PORT;
View Full Code Here

        response = client.handle(new Request(Method.GET, "http://localhost:"
                + this.port2 + "/efgh"));
        assertTrue(response.getStatus().isClientError());

        component.stop();
        client.stop();
    }
}
View Full Code Here

                .add("startTls", Boolean.toString(startTls).toLowerCase());

        request.setEntity(MAIL, MediaType.APPLICATION_XML);
        final Response response = client.handle(request);
        assertEquals(Status.SUCCESS_OK, response.getStatus());
        client.stop();
    }

    @Override
    protected void setUp() throws Exception {
        super.setUp();
View Full Code Here

                response = client.handle(request);
                assertEquals(Status.SUCCESS_OK, response.getStatus());
            }
        }

        client.stop();
    }

    public void testPops() throws Exception {
        final Client client = new Client(Protocol.POPS);
        client.getContext().getParameters().add("debug", DEBUG);
View Full Code Here

            final NamedNodeMap attrs = node.getAttributes();
            final String href = attrs.getNamedItem("href").getNodeValue();
            printMail(client, baseUri, href);
        }

        client.stop();
    }

    public void testSmtp() throws Exception {
        final Request request = new Request(Method.POST, YAHOO_SMTP);
        request.setChallengeResponse(new ChallengeResponse(
View Full Code Here

        Client c = new Client(Protocol.HTTP);
        final Response r = c.handle(request);
        assertEquals(r.getStatus().getDescription(), Status.SUCCESS_OK, r
                .getStatus());
        assertEquals("Hello world", r.getEntity().getText());
        c.stop();
    }

    @Override
    protected Application createApplication(Component component) {
        final Application application = new Application() {
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.