Package org.apache.clerezza.jaxrs.testutils

Examples of org.apache.clerezza.jaxrs.testutils.TestWebServer.stop()


    connection.addRequestProperty("Accept", "application/json, */*; q=.2");
    BufferedReader br = new BufferedReader(new InputStreamReader(connection.getInputStream(), "UTF-8"));
    String line = br.readLine();
//    System.out.println(line);
    Assert.assertEquals("{\"name\":\""+param+"\"}", line);
    testWebServer.stop();
  }

  private TestWebServer createTestWebServer(final Object resource) {
    return new TestWebServer(new Application() {

View Full Code Here


    connection = (HttpURLConnection) serverURL.openConnection();
    connection.setRequestMethod("GET");
    connection.addRequestProperty("Accept", "text/html, */*; q=.2")
    Assert.assertEquals(204, connection.getResponseCode());
    Assert.assertTrue(path.endsWith("/"));
    testWebServer.stop();
  }
 
  @Test
  public void testEnforceNoSlash() throws IOException {
    final TestWebServer testWebServer = createTestWebServer(new MyResource2());
View Full Code Here

    connection.setRequestMethod("GET");

    connection.addRequestProperty("Accept", "text/html, */*; q=.2");
    Assert.assertEquals(204, connection.getResponseCode());
    Assert.assertFalse(path.endsWith("/"));
    testWebServer.stop();
  }
 
 
  private TestWebServer createTestWebServer(final Object resource) {
    return new TestWebServer(new Application() {
View Full Code Here

        connection.addRequestProperty("Accept", "application/json, */*; q=.2");
        BufferedReader br = new BufferedReader(new InputStreamReader(connection.getInputStream(), "UTF-8"));
        String line = br.readLine();
//        System.out.println(line);
        Assert.assertEquals("{\"name\":\""+param+"\"}", line);
        testWebServer.stop();
    }

    private TestWebServer createTestWebServer(final Object resource) {
        return new TestWebServer(new Application() {

View Full Code Here

        connection = (HttpURLConnection) serverURL.openConnection();
        connection.setRequestMethod("GET");
        connection.addRequestProperty("Accept", "text/html, */*; q=.2");   
        Assert.assertEquals(204, connection.getResponseCode());
        Assert.assertTrue(path.endsWith("/"));
        testWebServer.stop();
    }
   
    @Test
    public void testEnforceNoSlash() throws IOException {
        final TestWebServer testWebServer = createTestWebServer(new MyResource2());
View Full Code Here

        connection.setRequestMethod("GET");

        connection.addRequestProperty("Accept", "text/html, */*; q=.2");
        Assert.assertEquals(204, connection.getResponseCode());
        Assert.assertFalse(path.endsWith("/"));
        testWebServer.stop();
    }
   
   
    private TestWebServer createTestWebServer(final Object resource) {
        return new TestWebServer(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.