Package fitnesse.http

Examples of fitnesse.http.MockResponseSender$OutputStreamSender


    FitNesseUtil.makeTestContext();
  }

  @After
  public void tearDown() throws Exception {
    if (response != null) response.sendTo(new MockResponseSender());
    SampleFileUtility.deleteSampleFiles(context.getRootPagePath());
    Locale.setDefault(saveLocale);
  }
View Full Code Here


  public void testFileContent() throws Exception {
    request.setResource("files/testFile1");
    responder = (FileResponder) FileResponder.makeResponder(request, context.getRootPagePath());
    response = responder.makeResponse(context, request);
    assertEquals(InputStreamResponse.class, response.getClass());
    MockResponseSender sender = new MockResponseSender();
    sender.doSending(response);
    assertSubString("file1 content", sender.sentData());
  }
View Full Code Here

  @Test
  public void testClasspathResourceContent() throws Exception {
    request.setResource("files/fitnesse/testresource.txt");
    responder = (FileResponder) FileResponder.makeResponder(request, context.getRootPagePath());
    response = responder.makeResponse(context, request);
    MockResponseSender sender = new MockResponseSender();
    sender.doSending(response);
    assertSubString("test resource content", sender.sentData());
  }
View Full Code Here

  public void testNavigationBackToFrontPage() throws Exception {
    request.setResource("files/");
    DirectoryResponder responder = (DirectoryResponder) FileResponder.makeResponder(request, FitNesseUtil.base);
    response = responder.makeResponse(context, request);
    response = responder.makeResponse(context, request);
    MockResponseSender sender = new MockResponseSender();
    sender.doSending(response);
    assertSubString("<a href=\"/FrontPage\" id=\"art_niche\"", sender.sentData());
  }
View Full Code Here

  private String getResultsUsing(String content) throws Exception {
    WikiPageUtil.addPage(root, PathParser.parse("SimplePage"), content);
    request.setResource("SimplePage");
    Response response = responder.makeResponse(context, request);
    MockResponseSender sender = new MockResponseSender();
    sender.doSending(response);
    String result = sender.sentData();
    return result;
  }
View Full Code Here

  }


  private String runResponder(StopTestResponder responder) 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

    }
    request.addInput("requestParam", "2");
    request.setResource(testPage.getName());

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

    results = sender.sentData();
  }
View Full Code Here

    root.commit(data);
    testPage = WikiPageUtil.addPage(root, PathParser.parse("EmptyTestPage"), "");
    request.setResource(testPage.getName());

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

    WikiPagePath errorLogPath = PathParser.parse("ErrorLogs.EmptyTestPage");
    WikiPage errorLogPage = root.getPageCrawler().getPage(errorLogPath);
View Full Code Here

  private String doRunAndGetErrorLog(String content) throws Exception {
    WikiPage testPage = WikiPageUtil.addPage(root, PathParser.parse("TestPage"), content);
    request.setResource(testPage.getName());

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

    assertHasRegexp("ErrorLog", results);

    WikiPage errorLog = errorLogsParentPage.getChildPage(testPage.getName());
    return errorLog.getData().getContent();
View Full Code Here

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

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

    assertSubString("Exit-Code: 0", results);
  }
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.