Package fitnesse.http

Examples of fitnesse.http.MockRequest


  private MockRequest request;

  @Before
  public void setUp() throws Exception {
    factory = new ResponderFactory("testDir");
    request = new MockRequest();
  }
View Full Code Here


    checkResponderKey("responder=railroad", "railroad");
    checkResponderKey("", "");
  }

  private void checkResponderKey(String queryString, String key) {
    MockRequest request = new MockRequest();
    request.setQueryString(queryString);
    assertEquals(key, factory.getResponderKey(request));
  }
View Full Code Here

    firstFilePath = context.getRootPagePath() + "/files/testResults/TestFolder/firstFakeFile"
            .replace('/', File.separatorChar);
    secondFilePath = context.getRootPagePath() + "/files/testResults/TestFolder/secondFakeFile"
            .replace('/', File.separatorChar);

    request = new MockRequest();
    mockedComparer = mock(HistoryComparer.class);

    responder = new HistoryComparerResponder(mockedComparer);
    responder.testing = true;
    mockedComparer.resultContent = new ArrayList<String>();
View Full Code Here

        response.getContent());
  }

  @Test
  public void shouldReturnErrorPageIfFilesAreInvalid() throws Exception {
    request = new MockRequest();
    request.addInput("TestResult_firstFile", "");
    request.addInput("TestResult_secondFile", "");
    request.setResource("TestFolder");
    SimpleResponse response = (SimpleResponse) responder.makeResponse(context,
        request);
View Full Code Here

  }

  @Test
  public void shouldReturnErrorPageIfThereAreTooFewInputFiles()
      throws Exception {
    request = new MockRequest();
    request.addInput("TestResult_firstFile", "");
    request.setResource("TestFolder");
    SimpleResponse response = (SimpleResponse) responder.makeResponse(context,
        request);
    assertEquals(400, response.getStatus());
View Full Code Here

  MockRequest request;
  private FitNesseContext context;

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

  }

  @Test
  public void testResponse() throws Exception {
    Responder responder = new ErrorResponder(new Exception("some error message"));
    SimpleResponse response = (SimpleResponse) responder.makeResponse(context, new MockRequest());

    assertEquals(400, response.getStatus());

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

  }

  @Test
  public void testWithMessage() throws Exception {
    Responder responder = new ErrorResponder("error Message");
    SimpleResponse response = (SimpleResponse) responder.makeResponse(context, new MockRequest());
    String body = response.getContent();

    assertSubString("error Message", body);
  }
View Full Code Here

  protected FitNesseContext context;

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

  public void setUp() throws Exception {
    factory = new ResponderFactory("testDir");
    factory.addResponder("mock", MockResponder.class);
    factory.addFilter("mock", new MockFilter());

    request = new MockRequest();
    request.addInput("responder", "mock");
    context = FitNesseUtil.makeTestContext();
  }
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.