Package fitnesse.http

Examples of fitnesse.http.SimpleResponse


    PageData data = page.getData();
    data.setAttribute(PageData.LAST_MODIFYING_USER, "Bill");
    page.commit(data);

    request.setResource("SomePage");
    SimpleResponse response = (SimpleResponse) responder.makeResponse(context, request);
    content = response.getContent();

    assertSubString("Last modified by Bill", content);
  }
View Full Code Here


  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

  @Test
  public void testPageTypePropertiesHtml() throws Exception {
    WikiPage page = WikiPageUtil.addPage(root, PathParser.parse("SomePage"));
    PageData data = page.getData();
    SimpleResponse response = (SimpleResponse) new PropertiesResponder().makeResponse(context, request);
    String html = response.getContent();
    assertSubString("Page type:", html);
    assertSubString("<input type=\"radio\" id=\"Static\" name=\"PageType\" value=\"Static\" checked=\"checked\"/>", html);
    assertSubString("<input type=\"radio\" id=\"Test\" name=\"PageType\" value=\"Test\"/>", html);
    assertSubString("<input type=\"radio\" id=\"Suite\" name=\"PageType\" value=\"Suite\"/>", html);
    assertSubString("<input type=\"checkbox\" id=\"Prune\" name=\"Prune\"/>", html);
View Full Code Here

    PageData data = page.getData();
    data.setAttribute("Suite");
    page.commit(data);
    assertEquals(page, context.root.getPageCrawler().getPage(PathParser.parse(".SomePage")));
    request.setResource(page.getPageCrawler().getFullPath().toString());
    SimpleResponse response = (SimpleResponse) new PropertiesResponder().makeResponse(context, request);
    String html = response.getContent();
    assertSubString("Page type:", html);
    assertSubString("<input type=\"radio\" id=\"Static\" name=\"PageType\" value=\"Static\"/>", html);
    assertSubString("<input type=\"radio\" id=\"Test\" name=\"PageType\" value=\"Test\"/>", html);
    assertSubString("<input type=\"radio\" id=\"Suite\" name=\"PageType\" value=\"Suite\" checked=\"checked\"/>", html);
    assertSubString("<input type=\"checkbox\" id=\"Prune\" name=\"Prune\"/>", html);
View Full Code Here

    WikiPage page = WikiPageUtil.addPage(root, PathParser.parse("SomePage"));
    PageData data = page.getData();
    data.setAttribute("Test");
    page.commit(data);
    request.setResource(page.getPageCrawler().getFullPath().toString());
    SimpleResponse response = (SimpleResponse) new PropertiesResponder().makeResponse(context, request);
    String html = response.getContent();
    assertSubString("Page type:", html);
    assertSubString("<input type=\"radio\" id=\"Static\" name=\"PageType\" value=\"Static\"/>", html);
    assertSubString("<input type=\"radio\" id=\"Test\" name=\"PageType\" value=\"Test\" checked=\"checked\"/>", html);
    assertSubString("<input type=\"radio\" id=\"Suite\" name=\"PageType\" value=\"Suite\"/>", html);
    assertSubString("<input type=\"checkbox\" id=\"Prune\" name=\"Prune\"/>", html);
View Full Code Here

    WikiPage page = WikiPageUtil.addPage(root, PathParser.parse("SomePage"));
    PageData data = page.getData();
    data.setAttribute("Prune");
    page.commit(data);
    request.setResource(page.getPageCrawler().getFullPath().toString());
    SimpleResponse response = (SimpleResponse) new PropertiesResponder().makeResponse(context, request);
    String html = response.getContent();
    assertSubString("Page type:", html);
    assertSubString("<input type=\"checkbox\" id=\"Prune\" name=\"Prune\" checked=\"checked\"/>", html);
  }
View Full Code Here

    assertSubString("<input type=\"checkbox\" id=\"Prune\" name=\"Prune\" checked=\"checked\"/>", html);
  }

  @Test
  public void testActionPropertiesHtml() throws Exception {
    SimpleResponse response = (SimpleResponse) new PropertiesResponder().makeResponse(context, request);
    String html = response.getContent();
    assertSubString("Actions:", html);
    assertSubString("<input type=\"checkbox\" id=\"Edit\" name=\"Edit\" checked=\"checked\"/>", html);
    assertSubString("<input type=\"checkbox\" id=\"Versions\" name=\"Versions\" checked=\"checked\"/>", html);
    assertSubString("<input type=\"checkbox\" id=\"Properties\" name=\"Properties\" checked=\"checked\"/>", html);
    assertSubString("<input type=\"checkbox\" id=\"Refactor\" name=\"Refactor\" checked=\"checked\"/>", html);
View Full Code Here

    assertSubString("<input type=\"checkbox\" id=\"WhereUsed\" name=\"WhereUsed\" checked=\"checked\"/>", html);
  }

  @Test
  public void testMakeNavigationPropertiesHtml() throws Exception {
    SimpleResponse response = (SimpleResponse) new PropertiesResponder().makeResponse(context, request);
    String html = response.getContent();
    assertSubString("Navigation:", html);
    assertSubString("<input type=\"checkbox\" id=\"Files\" name=\"Files\" checked=\"checked\"/>", html);
    assertSubString("<input type=\"checkbox\" id=\"RecentChanges\" name=\"RecentChanges\" checked=\"checked\"/>", html);
    assertSubString("<input type=\"checkbox\" id=\"Search\" name=\"Search\" checked=\"checked\"/>", html);
  }
View Full Code Here

    assertSubString("<input type=\"checkbox\" id=\"Search\" name=\"Search\" checked=\"checked\"/>", html);
  }

  @Test
  public void testMakeSecurityPropertiesHtml() throws Exception {
    SimpleResponse response = (SimpleResponse) new PropertiesResponder().makeResponse(context, request);
    String html = response.getContent();
    assertSubString("Security:", html);
    assertSubString("<input type=\"checkbox\" id=\"secure-read\" name=\"secure-read\"/>", html);
    assertSubString("<input type=\"checkbox\" id=\"secure-write\" name=\"secure-write\"/>", html);
    assertSubString("<input type=\"checkbox\" id=\"secure-test\" name=\"secure-test\"/>", html);
  }
View Full Code Here

    PageData data = page.getData();
    WikiPageProperties properties = data.getProperties();
    properties.set(PageData.PropertySUITES, "Edit Page tags");
    page.commit(data);

    SimpleResponse response = makeResponse();
    assertEquals(200, response.getStatus());

    String body = response.getContent();
    assertSubString("<html>", body);
    assertSubString("<form", body);
    assertSubString("method=\"post\"", body);
    assertSubString("child content with &lt;html&gt;", body);
    assertSubString("name=\"responder\"", body);
View Full Code Here

TOP

Related Classes of fitnesse.http.SimpleResponse

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.