Package org.webbitserver.stub

Examples of org.webbitserver.stub.StubHttpResponse.status()


    @Test
    public void listsDirectory() throws Exception {
        handler.enableDirectoryListing(true).welcomeFile("doesnotexist");

        StubHttpResponse response = handle(request("/"));
        assertEquals(200, response.status());
        assertThat(response.contentsString(), containsString("index.html"));
        assertThat(response.contentsString(), containsString("jquery-1.5.2.js"));
        assertThat(response.contentsString(), not(containsString("EmbeddedResourceHandlerTest")));
    }
View Full Code Here


    @Test
    public void listsSubDirectory() throws Exception {
      handler.enableDirectoryListing(true).welcomeFile("doesnotexist");

      StubHttpResponse response = handle(request("/"));
      assertEquals(200, response.status());
      // / is a /
      assertThat(response.contentsString(), containsString("href=\"subdir/\""));
      assertThat(response.contentsString(), not(containsString("subfile.txt")));

      response = handle(request("/subdir/"));
View Full Code Here

      // / is a /
      assertThat(response.contentsString(), containsString("href=\"subdir/\""));
      assertThat(response.contentsString(), not(containsString("subfile.txt")));

      response = handle(request("/subdir/"));
      assertEquals(200, response.status());
      assertThat(response.contentsString(), containsString("subfile.txt"));
      assertThat(response.contentsString(), not(containsString("index.html")));
    }

    @Test
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.