Package fitnesse.http

Examples of fitnesse.http.SimpleResponse


    WikiPage frontPage = WikiPageUtil.addPage(root, frontPagePath, "");
    WikiPageUtil.addPage(frontPage, pageOnePath, "");
    WikiPageUtil.addPage(frontPage, pageTwoPath, "");
    request.setResource("");
    request.addInput("ShowChildCount","");
    SimpleResponse response = (SimpleResponse) responder.makeResponse(FitNesseUtil.makeTestContext(root), request);
    assertHasRegexp("FrontPage 2", response.getContent());
  }
View Full Code Here


    WikiPage frontPage = createTestPageTree();
 
    request.setResource(frontPageName);
    request.addInput("Recursive", "");
 
    SimpleResponse response = (SimpleResponse) responder.makeResponse(FitNesseUtil.makeTestContext(root), request);
 
    assertHasRegexp(pageOneName,                                             response.getContent());
    assertHasRegexp(pageOneName + "." + pageTwoName,                         response.getContent());
    assertHasRegexp(pageThreeName,                                           response.getContent());
    assertHasRegexp(pageThreeName + "." + pageFourName,                      response.getContent());
    assertHasRegexp(pageThreeName + "." + pageFourName + "." + pageFiveName, response.getContent());
    assertEquals(5, CountLines(response.getContent()));
  }
View Full Code Here

 
    request.setResource(frontPageName);
    request.addInput("Recursive", "");
    request.addInput("LeafOnly", "");
 
    SimpleResponse response = (SimpleResponse) responder.makeResponse(FitNesseUtil.makeTestContext(root), request);
    assertEquals(2, CountLines(response.getContent())); // we only have 2 leave pages
  }
View Full Code Here

 
    request.setResource(frontPageName);
    request.addInput("Recursive", "");
    request.addInput("ShowTags", "");
 
    SimpleResponse response = (SimpleResponse) responder.makeResponse(FitNesseUtil.makeTestContext(root), request);
 
    // since the setAttribute() calls in createTestPageTree() don't have an effect the following tests are failing
    // reenable them once the issue above has been resolved!
    assertHasRegexp(pageOneName, response.getContent());
    assertHasRegexp(pageOneName + "." + pageTwoName + " \\[" + helloTag + "]", response.getContent());
    assertHasRegexp(pageThreeName + " \\[" + worldTag + "\\]", response.getContent());
    assertHasRegexp(pageThreeName + "." + pageFourName + " \\[" + worldTag + "\\]", response.getContent());
    assertHasRegexp(pageThreeName + "." + pageFourName + "." + pageFiveName + " \\[" + fitnesseTag + "\\]\\[" + worldTag + "\\]", response.getContent());
  }
View Full Code Here

    final MockRequest request = new MockRequest();
    request.setResource("ChildPage");

    final Responder responder = new WikiPageResponder();
    final SimpleResponse response = (SimpleResponse) responder.makeResponse(context, request);

    assertEquals(200, response.getStatus());

    final String body = response.getContent();

    assertSubString("<html>", body);
    assertSubString("<body", body);
    assertSubString("child content", body);
    assertSubString("href=\"ChildPage?whereUsed\"", body);
    assertSubString("Cache-Control: max-age=0", response.makeHttpHeaders());
    assertSubString("<h5> Wiki Page tags</h5>", body);
  }
View Full Code Here

    final MockRequest request = new MockRequest();
    request.setResource("page.child_page");

    final Responder responder = new WikiPageResponder();
    final SimpleResponse response = (SimpleResponse) responder.makeResponse(context, request);

    assertEquals(200, response.getStatus());

    final String body = response.getContent();

    assertSubString("child content", body);
  }
View Full Code Here

      final PageData data = noButtonsPage.getData();
      data.removeAttribute(attribute);
      noButtonsPage.commit(data);
    }

    SimpleResponse response = requestPage("NormalPage");
    assertSubString(">Edit</a>", response.getContent());
    assertSubString(">Search</a>", response.getContent());
    assertSubString(">Versions</a>", response.getContent());
    assertNotSubString(">Suite</a>", response.getContent());
    assertNotSubString(">Test</a>", response.getContent());

    response = requestPage("NoButtonPage");
    assertNotSubString(">Edit</a>", response.getContent());
    assertNotSubString(">Search</a>", response.getContent());
    assertNotSubString(">Versions</a>", response.getContent());
    assertNotSubString(">Suite</a>", response.getContent());
    assertNotSubString(">Test</a>", response.getContent());
  }
View Full Code Here

    WikiPageUtil.addPage(root, PathParser.parse("SetUp"), "setup");
    WikiPageUtil.addPage(root, PathParser.parse("TearDown"), "teardown");
    WikiPageUtil.addPage(root, PathParser.parse("SuiteSetUp"), "suite setup");
    WikiPageUtil.addPage(root, PathParser.parse("SuiteTearDown"), "suite teardown");

    SimpleResponse response = requestPage("NormalPage");
    String content = response.getContent();
    assertHasRegexp("header", content);
    assertHasRegexp("normal", content);
    assertHasRegexp("footer", content);
    assertDoesntHaveRegexp("setup", content);
    assertDoesntHaveRegexp("teardown", content);
    assertDoesntHaveRegexp("suite setup", content);
    assertDoesntHaveRegexp("suite teardown", content);

    response = requestPage("TestPage");
    content = response.getContent();
    assertHasRegexp("header", content);
    assertHasRegexp("test page", content);
    assertHasRegexp("footer", content);
    assertHasRegexp("setup", content);
    assertHasRegexp("teardown", content);
View Full Code Here

    Map<String,String> urlInputValues = new HashMap<String,String>();
    urlInputValues.put("normalParam", "normalValue");
    urlInputValues.put("headerParam", "headerValue");
    urlInputValues.put("footerParam", "footerValue");

    SimpleResponse response = requestPage("NormalPage", urlInputValues);
    String content = response.getContent();
    assertHasRegexp("header headerValue", content);
    assertHasRegexp("normal normalValue", content);
    assertHasRegexp("footer footerValue", content);


    urlInputValues = new HashMap<String,String>();
    urlInputValues.put("headerParam", "headerValue");
    urlInputValues.put("footerParam", "footerValue");
    urlInputValues.put("testPageParam", "testPageValue");
    urlInputValues.put("footerParam", "footerValue");
    urlInputValues.put("setupParam", "setupValue");
    urlInputValues.put("teardownParam", "teardownValue");
    urlInputValues.put("suiteSetupParam", "suiteSetupValue");
    urlInputValues.put("suiteTeardownParam", "suiteTeardownValue");


    response = requestPage("TestPage", urlInputValues);
    content = response.getContent();
    assertHasRegexp("header headerValue", content);
    assertHasRegexp("test page testPageValue", content);
    assertHasRegexp("footer footerValue", content);
    assertHasRegexp("setup setupValue", content);
    assertHasRegexp("teardown teardownValue", content);
View Full Code Here

  public void testGetPageData() throws Exception {
    Responder responder = new PageDataWikiPageResponder();
    MockRequest request = new MockRequest();
    request.setResource("PageOne");
    request.addInput("pageData", "");
    SimpleResponse response = (SimpleResponse) responder.makeResponse(FitNesseUtil.makeTestContext(root), request);
    assertEquals(pageOne.getData().getContent(), response.getContent());
  }
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.