Package fitnesse.http

Examples of fitnesse.http.MockResponseSender$OutputStreamSender


  public void testTestIdIsSentAsHeader() throws Exception {
    WikiPage testPage = WikiPageUtil.addPage(root, PathParser.parse("TestPage"), "");
    request.setResource(testPage.getName());

    Response response = responder.makeResponse(context, request);
    MockResponseSender sender = new MockResponseSender();
    sender.doSending(response);

    String results = sender.sentData();
    assertSubString("X-FitNesse-Test-Id: ", results);
  }
View Full Code Here


  public void testFixtureThatCrashes() throws Exception {
    WikiPage testPage = WikiPageUtil.addPage(root, PathParser.parse("TestPage"), classpathWidgets() + crashFixtureTable());
    request.setResource(testPage.getName());

    Response response = responder.makeResponse(context, request);
    MockResponseSender sender = new MockResponseSender();
    sender.doSending(response);

    String results = sender.sentData();
    assertSubString("ErrorLog", results);
  }
View Full Code Here

    WikiPagePath testPagePath = testPage.getPageCrawler().getFullPath();
    String resource = PathParser.render(testPagePath);
    request.setResource(resource);

    Response response = responder.makeResponse(context, request);
    MockResponseSender sender = new MockResponseSender();
    sender.doSending(response);
    results = sender.sentData();

    assertTrue(results.contains(">Output Captured<"));
    assertHasRegexp("ErrorLog", results);
    assertSubString("Test Page tags", results);
View Full Code Here

    WikiPagePath testPagePath = testPage.getPageCrawler().getFullPath();
    String resource = PathParser.render(testPagePath);
    request.setResource(resource);

    Response response = responder.makeResponse(context, request);
    MockResponseSender sender = new MockResponseSender();
    sender.doSending(response);
    results = sender.sentData();

    WikiPage errorLog = errorLogsParentPage.getPageCrawler().getPage(testPagePath);
    String errorLogContent = errorLog.getData().getContent();
    assertMessagesOccurInOrder(errorLogContent, "Output of SuiteSetUp", "Output of SetUp", "Output of TestPage");
    assertMessageHasJustOneOccurrenceOf(errorLogContent, "Output of SetUp");
View Full Code Here

    importer = new WikiImporter();
    importer.setDeleteOrphanOption(false);
    responder = new WikiImportingResponder(importer);
    responder.path = new WikiPagePath();
    ChunkedResponse response = new ChunkedResponse("html", new MockChunkedDataProvider());
    response.sendTo(new MockResponseSender());
    responder.setResponse(response);
  }
View Full Code Here

  }

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

    assertEquals(2, testData.pageTwo.getChildren().size());
    WikiPage importedPageOne = testData.pageTwo.getChildPage("PageOne");
    assertNotNull(importedPageOne);
    assertEquals("page one", importedPageOne.getData().getContent());
View Full Code Here

    WikiPagePath testPagePath = testPage.getPageCrawler().getFullPath();
    String resource = PathParser.render(testPagePath);
    request.setResource(resource);

    Response response = responder.makeResponse(context, request);
    MockResponseSender sender = new MockResponseSender();
    sender.doSending(response);
    results = sender.sentData();

    WikiPage errorLog = errorLogsParentPage.getPageCrawler().getPage(testPagePath);
    String errorLogContent = errorLog.getData().getContent();
    assertMessagesOccurInOrder(errorLogContent, "Output of TestPage", "Output of TearDown", "Output of SuiteTearDown");
    assertMessageHasJustOneOccurrenceOf(errorLogContent, "Output of TearDown");
View Full Code Here

    importProperty.addTo(data.getProperties());
    data.setContent("nonsense");
    testData.pageTwo.commit(data);

    Response response = makeSampleResponse("blah");
    MockResponseSender sender = new MockResponseSender();
    sender.doSending(response);

    data = testData.pageTwo.getData();
    assertEquals("page one", data.getContent());

    assertFalse(WikiImportProperty.createFrom(data.getProperties()).isRoot());
View Full Code Here

  }

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

    checkProperties(testData.pageTwo, baseUrl, true, null);

    WikiPage importedPageOne = testData.pageTwo.getChildPage("PageOne");
    checkProperties(importedPageOne, baseUrl + "PageOne", false, testData.remoteRoot.getChildPage("PageOne"));
View Full Code Here

    }
  }

  private String simulateWebRequest(MockRequest request) throws IOException {
    ChunkedResponse response = getResponse(request);
    MockResponseSender sender = new MockResponseSender();
    sender.doSending(response);
    String content = sender.sentData();
    return content;
  }
View Full Code Here

TOP

Related Classes of fitnesse.http.MockResponseSender$OutputStreamSender

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.