@Override public Serializable exportState() throws IOException { return this.delegate.exportState(); }
@Override public HttpRequest getClientRequest() { return this.delegate.getClientRequest(); } }
@Override public HttpRequest getRequest() { return this.delegate.getRequest(); }
@Override public MockHttpResponse send(Throwable escalation) { // Send the response try { this.delegate.getServiceFlowCallback().run(escalation); } catch (Throwable ex) { throw OfficeFrameTestCase.fail(ex); } // Return the response return this.response; }
ProcessAwareServerHttpConnectionManagedObject<ByteBuffer> connection = new ProcessAwareServerHttpConnectionManagedObject<>( serverLocation, isSecure, methodSupplier, requestUriSupplier, requestVersion, requestHeaders, requestEntity, null, null, true, responseWriter, bufferPool);
@Override public HttpResponse getResponse() { return this.delegate.getResponse(); }
@Override public void importState(Serializable momento) throws IllegalArgumentException, IOException { this.delegate.importState(momento); }
@Override public boolean isSecure() { return this.delegate.isSecure(); }
@Override public HttpServerLocation getServerLocation() { return this.delegate.getServerLocation(); }
@Override public void configureHttpServer(HttpServerImplementationContext context) { @SuppressWarnings("unchecked") Class<ProcessAwareServerHttpConnectionManagedObject<ByteBuffer>> managedObjectType = (Class<ProcessAwareServerHttpConnectionManagedObject<ByteBuffer>>) (Object) ProcessAwareServerHttpConnectionManagedObject.class; this.serviceInput = context.getExternalServiceInput(managedObjectType, ProcessAwareServerHttpConnectionManagedObject.getCleanupEscalationHandler()); }
/** * Sends the {@link MockHttpRequestBuilder}. * * @param request {@link MockHttpRequestBuilder}. * @param callback {@link MockHttpRequestCallback} to receive the * {@link MockHttpResponse}. */ public void send(MockHttpRequestBuilder request, MockHttpRequestCallback callback) { // Create the server HTTP connection ProcessAwareServerHttpConnectionManagedObject<ByteBuffer> connection = createServerHttpConnection(request, this, callback); // Service the request this.serviceInput.service(connection, connection.getServiceFlowCallback()); }
/** * Instantiate. * * @param request {@link MockHttpRequestBuilderImpl} for the * {@link MockHttpResponse}. */ private MockHttpResponseBuilderImpl(MockHttpRequestBuilderImpl request) { this.request = request; MockStreamBufferPool bufferPool = new MockStreamBufferPool(); HttpServerLocation serverLocation = new MockHttpServer(); ProcessAwareServerHttpConnectionManagedObject<ByteBuffer> serverHttpConnection = new ProcessAwareServerHttpConnectionManagedObject<>( serverLocation, false, () -> HttpMethod.GET, () -> "/", HttpVersion.HTTP_1_1, null, null, null, null, true, new MockHttpResponseWriter(this.request, this, null), bufferPool); this.delegate = new ProcessAwareHttpResponse<>(serverHttpConnection, HttpVersion.HTTP_1_1, new MockProcessAwareContext()); }