@Before publicvoid setupTest() { // Set up the socket wrapper
EasyMock.expect(socketWrapper.getSocketBufferHandler()).andReturn(new SocketBufferHandler(0, 0, false));
EasyMock.replay(socketWrapper); // Cast to make the method visible
((AbstractProcessor) processor).setSocketWrapper(socketWrapper);
}
@Test publicvoid test100ContinueExpectationImmediately() throws IOException { // Tests that response.sendAcknowledgement is only called when // request.setContinueHandlingResponsePolicy is called.
request.setExpectation(true);
// Configure the mock to verify that a network write is made.
configureMockForOneAcknowledgementWrite(socketWrapper);
// Verify that acknowledgement is not written to network.
EasyMock.verify(socketWrapper);
}
@Test publicvoid test100ContinueExpectationOnRequestBodyRead() throws IOException { // Tests that response.sendAcknowledgement is only called when // request.doRead is called.
request.setExpectation(true);
// Configure the mock to verify that no network write is made.
configureMockForNoAcknowledgementWrite(socketWrapper);
// Verify that acknowledgement is written to network.
EasyMock.verify(socketWrapper);
}
@Test publicvoid testNoExpectationWithOnRequestBodyReadPolicy() throws IOException { // When expectation is false, sendAcknowledgement must never be called.
request.setExpectation(false);
// Configure the mock to verify that no network write is made.
configureMockForNoAcknowledgementWrite(socketWrapper);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.