Package fitnesse.http

Examples of fitnesse.http.MockRequest


  @Before
  public void setUp() throws Exception {
    contentFilter = mock(ContentFilter.class);
    filter = new ContentFilterResponder(contentFilter);
    context = FitNesseUtil.makeTestContext();
    request = new MockRequest();
  }
View Full Code Here


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

    root = InMemoryPage.makeRoot("root");
    FitNesseUtil.makeTestContext(root);
    String childPage = "ChildPage";
    WikiPageUtil.addPage(root, PathParser.parse(childPage));

    request = new MockRequest();
    request.setResource(childPage);
    responder = new RefactorPageResponder();
  }
View Full Code Here

  @Test
  public void testDeleteConfirmation() throws Exception {
    WikiPage level1 = WikiPageUtil.addPage(this.root, this.level1Path, "");
    WikiPageUtil.addPage(level1, this.level2Path, "");
    MockRequest request = new MockRequest();
    request.setResource(this.qualifiedLevel2Name);
    request.addInput("deletePage", "");

    SimpleResponse response = (SimpleResponse) this.responder.makeResponse(FitNesseUtil.makeTestContext(this.root), request);
    String content = response.getContent();
    assertSubString("Are you sure you want to delete " + this.qualifiedLevel2Name, content);
  }
View Full Code Here

  @Test
  public void testDeletePage() throws Exception {
    WikiPage level1 = WikiPageUtil.addPage(this.root, this.level1Path, "");
    WikiPageUtil.addPage(level1, this.level2Path, "");
    assertTrue(this.root.getPageCrawler().pageExists(this.level1Path));
    MockRequest request = new MockRequest();
    request.setResource(this.level1Name);
    request.addInput("confirmed", "yes");

    SimpleResponse response = (SimpleResponse) this.responder.makeResponse(FitNesseUtil.makeTestContext(this.root), request);
    String page = response.getContent();
    assertNotSubString("Are you sure you want to delete", page);
    assertEquals(303, response.getStatus());
View Full Code Here

  public void setUp() throws Exception {
    root = InMemoryPage.makeRoot("RooT");
    pagePath = PathParser.parse("SomePage");
    somePage = WikiPageUtil.addPage(root, pagePath, "has something in it");
    responder = new SearchReplaceResponder();
    request = new MockRequest();
    request.setResource("SomePage");
    context = FitNesseUtil.makeTestContext(root);
  }
View Full Code Here

    requester.password = password;
    return requestPage(uri);
  }

  public int requestPageSaveWithContentsByUserAndPassword(String pageName, String contents, String username, String password) throws Exception {
    MockRequest request = new MockRequest();
    if (username != null)
      request.setCredentials(username, password);
    request.addInput("responder", "saveData");
    request.addInput(EditResponder.TIME_STAMP, "9999999999999");
    request.addInput(EditResponder.TICKET_ID, "321");
    request.addInput("pageContent", contents);
    request.parseRequestUri("/" + pageName);
    WikiPagePath path = PathParser.parse(request.getResource()); // uri;
    FitnesseFixtureContext.page = FitnesseFixtureContext.root.getPageCrawler().getPage(path);
    FitNesseExpediter expediter = new FitNesseExpediter(new MockSocket(""), FitnesseFixtureContext.context);
    FitnesseFixtureContext.response = expediter.createGoodResponse(request);
    FitnesseFixtureContext.sender = new MockResponseSender();
    FitnesseFixtureContext.sender.doSending(FitnesseFixtureContext.response);
View Full Code Here

  private MockRequest request;
  private FitNesseContext context;

  @Before
  public void setUp() {
    request = new MockRequest();
    context = FitNesseUtil.makeTestContext(null);
    FileUtil.makeDir(context.getRootPagePath());
  }
View Full Code Here

  private FitNesseContext context;
  private String content;

  @Before
  public void setUp() throws Exception {
    request = new MockRequest();
    context = FitNesseUtil.makeTestContext(null);
  }
View Full Code Here

  }

  @Test
  public void testMakeResponse() throws Exception {
    CreateDirectoryResponder responder = new CreateDirectoryResponder();
    MockRequest request = new MockRequest();
    request.addInput("dirname", "subdir");
    request.setResource("files/");

    Response response = responder.makeResponse(context, request);

    File file = new File(context.getRootPagePath() + "/files/subdir");
    assertTrue(file.exists());
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.