Package fitnesse.http

Examples of fitnesse.http.MockRequest


  }

  @Test
  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


  }

  @Test
  public void testException() throws Exception {
    exception = new Exception("test exception");
    response = (ChunkedResponse)responder.makeResponse(context, new MockRequest());
    MockResponseSender sender = new MockResponseSender();
    sender.doSending(response);
    String responseSender = sender.sentData();
    assertSubString("test exception", responseSender);
  }
View Full Code Here

    assertSubString("test exception", responseSender);
  }

  @Test
  public void chunkingShouldBeTurnedOffIfnochunkParameterIsPresent() throws Exception {
    MockRequest request = new MockRequest();
    request.addInput("nochunk", null);
    response = (ChunkedResponse)responder.makeResponse(context, request);
    assertTrue(response.isChunkingTurnedOff());
  }
View Full Code Here

  protected FitNesseContext context;

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

  }

  @Test
  public void testFitNesseGetsShutdown() throws Exception {
    ShutdownResponder responder = new ShutdownResponder();
    responder.makeResponse(context, new MockRequest());
    Thread.sleep(200);
    assertFalse(context.fitNesse.isRunning());
  }
View Full Code Here

  public MockRequest request;
  private FitNesseContext context;

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

  private MockRequest request;

  @Before
  public void setUp() throws Exception {
    root = InMemoryPage.makeRoot("RooT");
    request = new MockRequest();
  }
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

    assertTrue("Should have absolute link", hasSubString(expected, output));
  }

  @Test
  public void testLoggingDataCreation() {
    MockRequest request = new MockRequest();
    SimpleResponse response = new SimpleResponse(200);
    MockSocket socket = new MockSocket("something");

    socket.setHost("1.2.3.4");
    request.setRequestLine("GET / HTTP/1.1");
    response.setContent("abc");
    request.setCredentials("billy", "bob");

    LogData data = FitNesseExpediter.makeLogData(socket, request, response);

    assertEquals("1.2.3.4", data.host);
    assertNotNull(data.time);
View Full Code Here

  @Test
  public void testAuthenticationGetsCalled() throws Exception {
    context = FitNesseUtil.makeTestContext(context.root, new StoneWallAuthenticator());
    expediter = new FitNesseExpediter(socket, context);
    MockRequest request = new MockRequest();
    Response response = expediter.createGoodResponse(request);
    assertEquals(401, response.getStatus());
  }
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.