Package fitnesse.http

Examples of fitnesse.http.Response


    assertSubString("3 pages were imported.", content);
  }

  @Test
  public void testHtmlOfMakeResponseWithNoModifications() throws Exception {
    Response response = makeSampleResponse(baseUrl);
    MockResponseSender sender = new MockResponseSender();
    sender.doSending(response);

    // import a second time... nothing was modified
    createResponder();
View Full Code Here


  @Test
  public void testMakeResponseImportingNonRootPage() throws Exception {
    MockRequest request = makeRequest(baseUrl + "PageOne");

    Response response = responder.makeResponse(FitNesseUtil.makeTestContext(testData.localRoot), request);
    MockResponseSender sender = new MockResponseSender();
    sender.doSending(response);
    String content = sender.sentData();

    assertNotNull(testData.pageTwo.getChildPage("ChildOne"));
View Full Code Here

  }

  @Test
  public void testRemoteUrlNotFound() throws Exception {
    String remoteUrl = baseUrl + "PageDoesntExist";
    Response response = makeSampleResponse(remoteUrl);

    MockResponseSender sender = new MockResponseSender();
    sender.doSending(response);
    String content = sender.sentData();
    assertSubString("The remote resource, " + remoteUrl + ", was not found.", content);
View Full Code Here

  }

  @Test
  public void testErrorMessageForBadUrlProvided() throws Exception {
    String remoteUrl = baseUrl + "+blah";
    Response response = makeSampleResponse(remoteUrl);

    MockResponseSender sender = new MockResponseSender();
    sender.doSending(response);
    String content = sender.sentData();
    assertSubString("The URL's resource path, +blah, is not a valid WikiWord.", content);
View Full Code Here

  fitnesseTag = "fitnesse";
  }

  @Test
  public void testTextPlain() throws Exception {
    Response r = responder.makeResponse(FitNesseUtil.makeTestContext(root), request);
    assertEquals("text/plain", r.getContentType());
  }
View Full Code Here

  public void tearDown() throws Exception {
    FitNesseUtil.destroyTestContext();
  }

  private String runSuite() throws Exception {
    Response response = responder.makeResponse(context, request);
    MockResponseSender sender = new MockResponseSender();
    sender.doSending(response);
    String results = sender.sentData();
    return results;
  }
View Full Code Here

  @Test
  public void testUnauthorizedResponse() throws Exception {
    makeSecurePage(testData.remoteRoot);

    Response response = makeSampleResponse(baseUrl);
    MockResponseSender sender = new MockResponseSender();
    sender.doSending(response);
    String content = sender.sentData();
    checkRemoteLoginForm(content);
  }
View Full Code Here

  @Test
  public void testUnauthorizedResponseFromNonRoot() throws Exception {
    WikiPage childPage = testData.remoteRoot.getChildPage("PageOne");
    makeSecurePage(childPage);

    Response response = makeSampleResponse(baseUrl);
    MockResponseSender sender = new MockResponseSender();
    sender.doSending(response);
    String content = sender.sentData();
    assertSubString("The wiki at " + baseUrl + "PageOne requires authentication.", content);
    assertSubString("<form", content);
View Full Code Here

    makeSecurePage(testData.remoteRoot);

    MockRequest request = makeRequest(baseUrl);
    request.addInput("remoteUsername", "joe");
    request.addInput("remotePassword", "blow");
    Response response = getResponse(request);
    MockResponseSender sender = new MockResponseSender();
    sender.doSending(response);
    String content = sender.sentData();

    assertNotSubString("requires authentication", content);
View Full Code Here

    File file = new File(dir, "testfile");
    assertTrue(file.createNewFile());
    DeleteFileResponder responder = new DeleteFileResponder();
    request.addInput("filename", "testfile");
    request.setResource("files/");
    Response response = responder.makeResponse(context, request);
    assertFalse(file.exists());
    assertEquals(303, response.getStatus());
    assertEquals("/files/", response.getHeader("Location"));
  }
View Full Code Here

TOP

Related Classes of fitnesse.http.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.