public final class DefaultClientDriverJettyHandler extends org.eclipse.jetty.server.handler.AbstractHandler implements ClientDriverJettyHandler
ClientDriverInternalException is usually thrown.org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener| Constructor and Description |
|---|
DefaultClientDriverJettyHandler(RequestMatcher matcher)
Constructor which accepts a
RequestMatcher. |
| Modifier and Type | Method and Description |
|---|---|
ClientDriverExpectation |
addExpectation(ClientDriverRequest request,
ClientDriverResponse response)
Add in a
ClientDriverRequest/ ClientDriverResponse pair. |
void |
checkForUnexpectedRequests()
This method will throw a ClientDriverFailedExpectationException if there have been any unexpected requests.
|
void |
checkForUnmatchedExpectations()
This method will throw a ClientDriverFailedExpectationException if any expectations have not been met.
|
void |
handle(String target,
org.eclipse.jetty.server.Request baseRequest,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
void |
noFailFastOnUnexpectedRequest()
Should not fail fast on unexpected requests, but will fail later when running
ClientDriverJettyHandler.checkForUnexpectedRequests(). |
void |
reset()
Resets the expectations so the current ClientDriver instance can be reused.
|
void |
verify(ClientDriverRequest request,
int times) |
destroy, doStart, doStop, dumpThis, getServer, setServeraddBean, addBean, addBean, addEventListener, addManaged, contains, dump, dump, dump, dump, dump, dumpBeans, dumpObject, dumpStdErr, getBean, getBeans, getBeans, isManaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBean, updateBeansaddLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stoppublic DefaultClientDriverJettyHandler(RequestMatcher matcher)
RequestMatcher.matcher - The RequestMatcher to use.public void handle(String target, org.eclipse.jetty.server.Request baseRequest, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException
This implementation uses the expected ClientDriverRequest/ ClientDriverResponse pairs to serve its requests. If an unexpected request comes in, a
ClientDriverInternalException is thrown.
handle in interface org.eclipse.jetty.server.HandlerIOExceptionjavax.servlet.ServletExceptionpublic void checkForUnexpectedRequests()
ClientDriverJettyHandlercheckForUnexpectedRequests in interface ClientDriverJettyHandlerpublic void checkForUnmatchedExpectations()
ClientDriverJettyHandlercheckForUnmatchedExpectations in interface ClientDriverJettyHandlerpublic void noFailFastOnUnexpectedRequest()
ClientDriverJettyHandlerClientDriverJettyHandler.checkForUnexpectedRequests().noFailFastOnUnexpectedRequest in interface ClientDriverJettyHandlerpublic void reset()
ClientDriverJettyHandlerreset in interface ClientDriverJettyHandlerpublic ClientDriverExpectation addExpectation(ClientDriverRequest request, ClientDriverResponse response)
ClientDriverRequest/ ClientDriverResponse pair.addExpectation in interface ClientDriverJettyHandlerrequest - The expected requestresponse - The response to serve to that requestpublic void verify(ClientDriverRequest request, int times)
verify in interface ClientDriverJettyHandlerCopyright © 2016. All Rights Reserved.