Package fitnesse.http

Examples of fitnesse.http.MockRequest


    PageData data = page.getData();
    WikiPageProperties properties = data.getProperties();
    properties.set(PageType.TEST.toString(), "true");
    page.commit(data);

    MockRequest request = new MockRequest();
    request.setResource("PageOne");
    request.addInput("format", "json");

    Responder responder = new PropertiesResponder();
    SimpleResponse response = (SimpleResponse) responder.makeResponse(context, request);
    assertEquals("text/json", response.getContentType());
    String jsonText = response.getContent();
View Full Code Here


    WikiPageProperties properties = data.getProperties();
    properties.set(PropertyHELP, "help text");
    properties.set(PropertySUITES, "foo,bar");
    page.commit(data);

    MockRequest request = new MockRequest();
    request.setResource("PageOne");
    request.addInput("format", "json");

    Responder responder = new PropertiesResponder();
    SimpleResponse response = (SimpleResponse) responder.makeResponse(context, request);
    assertEquals("text/json", response.getContentType());
    String jsonText = response.getContent();
View Full Code Here

    return getPropertiesContentFromPage(page);
  }

  private WikiPage getPropertiesContentFromPage(WikiPage page) throws Exception {
    request = new MockRequest();
    request.setResource(page.getName());
    responder = new PropertiesResponder();
    SimpleResponse response = (SimpleResponse) responder.makeResponse(context, request);
    content = response.getContent();
    return page;
View Full Code Here

    WikiPageUtil.addPage(pageTwo, PathParser.parse("ChildPage"), ".PageOne");
  }

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

    Response response = responder.makeResponse(FitNesseUtil.makeTestContext(root), request);
    MockResponseSender sender = new MockResponseSender();
    response.sendTo(sender);
View Full Code Here

  private EditResponder responder;

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

    crawler = root.getPageCrawler();
    WikiPageUtil.addPage(root, PathParser.parse("TestPage"), "");
    childName = "ChildPage";
    String childContent = "child content";
    String pagetype = "";
    request = new MockRequest();
    request.setResource("TestPage");
    request.addInput("pageName", childName);
    request.addInput("pageContent", childContent);
    request.addInput("pageType", pagetype);
    context = FitNesseUtil.makeTestContext(root);
View Full Code Here

    response = (SimpleResponse) responder.makeResponse(context, request);
    assertSubString("Invalid Child Name", response.getContent());
  }

  private MockRequest makeInvalidRequest(String name) {
    MockRequest request = new MockRequest();
    request.setResource("TestPage");
    request.addInput("pageName", name);
    request.addInput("pageContent", "hello");
    request.addInput("pageType", "");
    return request;
  }
View Full Code Here

  private WikiPage root;

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

  }

  private void createRequest() throws Exception {
    page = WikiPageUtil.addPage(root, PathParser.parse(PAGE_NAME), "");

    request = new MockRequest();
    request.addInput("PageType", "Test");
    request.addInput("Properties", "on");
    request.addInput("Search", "on");
    request.addInput("RecentChanges", "on");
    request.addInput(PageData.PropertyPRUNE,"on");
View Full Code Here

    // The SavePropertiesResponder saves them by setting the attribute without a value.
    // This test ensures that the behavior is the same (i.e. without value)
    page = WikiPageUtil.addPage(root, PathParser.parse(PAGE_NAME), "");
    PageData defaultData = page.getData();

    request = new MockRequest();
    request.setResource(PAGE_NAME);
    setBooleanAttributesOnRequest(defaultData, PageData.NON_SECURITY_ATTRIBUTES);
    setBooleanAttributesOnRequest(defaultData, PageData.SECURITY_ATTRIBUTES);

    responder.makeResponse(FitNesseUtil.makeTestContext(root), request);
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.