Package fitnesse.http

Examples of fitnesse.http.MockRequest


    FitNesseUtil.makeTestContext(root);
  }

  @Test
  public void testMakeReponder() throws Exception {
    MockRequest request = new MockRequest();
    request.setResource("PageOne");

    Responder responder = new VersionSelectionResponder();
    SimpleResponse response = (SimpleResponse) responder.makeResponse(FitNesseUtil.makeTestContext(root), request);

    String content = response.getContent();
View Full Code Here


  @Before
  public void setUp() throws Exception {
    root = InMemoryPage.makeRoot("root");
    FitNesseUtil.makeTestContext(root);
    request = new MockRequest();
    responder = new NewPageResponder();
  }
View Full Code Here

  @Before
  public void setUp() throws Exception {
    source = InMemoryPage.makeRoot("RooT");
    WikiPageUtil.addPage(source, PathParser.parse("SimplePage"), "this is SimplePage");
    request = new MockRequest();
    request.setResource("SimplePage");
    request.addInput(EditResponder.TIME_STAMP, "");
    request.addInput(EditResponder.CONTENT_INPUT_NAME, "some new content");
    FitNesseUtil.makeTestContext();
  }
View Full Code Here

  }

  @Test
  public void testHtml() throws Exception {
    Responder responder = new MergeResponder(request);
    SimpleResponse response = (SimpleResponse) responder.makeResponse(FitNesseUtil.makeTestContext(source), new MockRequest());
    assertHasRegexp("name=\\\"" + EditResponder.CONTENT_INPUT_NAME + "\\\"", response.getContent());
    assertHasRegexp("this is SimplePage", response.getContent());
    assertHasRegexp("name=\\\"oldContent\\\"", response.getContent());
    assertHasRegexp("some new content", response.getContent());
  }
View Full Code Here

  public void testAttributeValues() throws Exception {
    request.addInput("Edit", "On");
    request.addInput("PageType", "Test");
    request.addInput("Search", "On");
    Responder responder = new MergeResponder(request);
    SimpleResponse response = (SimpleResponse) responder.makeResponse(FitNesseUtil.makeTestContext(source), new MockRequest());

    assertHasRegexp("type=\"hidden\"", response.getContent());
    assertHasRegexp("name=\"Edit\"", response.getContent());
    assertHasRegexp("name=\"PageType\" value=\"Test\" checked", response.getContent());
    assertHasRegexp("name=\"Search\"", response.getContent());
View Full Code Here

  @Before
  public void setUp() throws Exception {
    WikiPage root = InMemoryPage.makeRoot("RooT");
    FitNesseContext context = FitNesseUtil.makeTestContext(root);
    SearchFormResponder responder = new SearchFormResponder();
    SimpleResponse response = (SimpleResponse) responder.makeResponse(context, new MockRequest());
    content = response.getContent();
  }
View Full Code Here

    WikiPageUtil.addPage(pageOne, PathParser.parse("ChildOne"), "");   //#    |    `--ChildOne
    WikiPage pageTwo = WikiPageUtil.addPage(root, PathParser.parse("PageTwo"), "");
    childTwo = WikiPageUtil.addPage(pageTwo, PathParser.parse("ChildTwo"), "");   //#         |--ChildTwo
    WikiPageUtil.addPage(pageTwo, PathParser.parse("ChildThree"), ""); //#         `--ChildThree

    request = new MockRequest();
    request.setResource("PageOne");
    context = FitNesseUtil.makeTestContext(root);
    responder = new SymbolicLinkResponder(fileSystem);
  }
View Full Code Here

  @Before
  public void setUp() throws Exception {
    WikiPage root = InMemoryPage.makeRoot("RooT");
    WikiPageUtil.addPage(root, PathParser.parse("SomePage"), "has something in it");
    request = new MockRequest();
    request.addInput("searchString", "blah");
    request.addInput("searchType", "blah");
    context = FitNesseUtil.makeTestContext(root);
    responder = new SearchResponder();
  }
View Full Code Here

  }

  @Test
  public void testResponseWithNoParametersWillReturnEmptyPage()
  throws Exception {
    MockRequest request = setupRequest();
    String content = invokeResponder(request);
    assertSubString("Search Page Properties Results", content);
    assertSubString("No search properties", content);
  }
View Full Code Here

  }

  @Test
  public void testResponseWithNoMatchesWillReturnEmptyPageList()
  throws Exception {
    MockRequest request = setupRequest();
    request.addInput(PAGE_TYPE_ATTRIBUTE, "Suite,Static");

    String content = invokeResponder(request);

    assertSubString("No pages", content);
  }
View Full Code Here

TOP

Related Classes of fitnesse.http.MockRequest

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.