Class AbstractServletHttpServerImplementationTest
java.lang.Object
net.officefloor.server.http.AbstractHttpServerImplementationTestCase
net.officefloor.server.servlet.test.AbstractServletHttpServerImplementationTest
public abstract class AbstractServletHttpServerImplementationTest
extends AbstractHttpServerImplementationTestCase
Provide abstract test functionality for testing with
HttpServlet.- Author:
- Daniel Sagenschneider
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classFilterto fix theHttpHeaderinstances.protected static classContext for configuring theServer.Nested classes/interfaces inherited from class net.officefloor.server.http.AbstractHttpServerImplementationTestCase
AbstractHttpServerImplementationTestCase.AsyncServicer, AbstractHttpServerImplementationTestCase.BufferServicer, AbstractHttpServerImplementationTestCase.BytesServicer, AbstractHttpServerImplementationTestCase.CancelConnectionManagedObjectSource, AbstractHttpServerImplementationTestCase.CancelConnectionServicer, AbstractHttpServerImplementationTestCase.CloseFileServicer, AbstractHttpServerImplementationTestCase.CompareResult, AbstractHttpServerImplementationTestCase.EncodedUrlServicer, AbstractHttpServerImplementationTestCase.FailServicer, AbstractHttpServerImplementationTestCase.FileServicer, AbstractHttpServerImplementationTestCase.FunctionalityServicer, AbstractHttpServerImplementationTestCase.PipelineResult, AbstractHttpServerImplementationTestCase.PressureOverloadServicer, AbstractHttpServerImplementationTestCase.QualifiedServicer, AbstractHttpServerImplementationTestCase.Servicer, AbstractHttpServerImplementationTestCase.TeamMarker, AbstractHttpServerImplementationTestCase.TeamTwoMarker, AbstractHttpServerImplementationTestCase.ThreadedManagedObject, AbstractHttpServerImplementationTestCase.ThreadedServicer -
Field Summary
Fields inherited from class net.officefloor.server.http.AbstractHttpServerImplementationTestCase
CONNECTION_QUALIFIER_ONE, CONNECTION_QUALIFIER_TWO -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidConfigures theServer.static org.eclipse.jetty.server.ServercreateServer(HttpServerLocation serverLocation, SSLContext sslContext) Creates theServerfor theHttpServerLocation.protected HttpHeader[]Obtains the server responseHttpHeaderinstances in the order they are sent from the server.protected booleanIndicates if handle cancel.protected AutoCloseablestartHttpServer(OfficeFloorExtensionService officeFloorExtension, OfficeExtensionService officeExtension) Starts theHttpServer.protected AutoCloseablestartRawHttpServer(HttpServerLocation serverLocation) Starts a raw implementation of the underlying HTTP server.Methods inherited from class net.officefloor.server.http.AbstractHttpServerImplementationTestCase
async, bufferHeavyLoad, bufferOverLoad, bufferPipelineVerify, bufferPipelining, bufferThreadedHandler, bytesHeavyLoad, bytesOverLoad, bytesPipelineVerify, bytesPipelining, bytesThreadedHandler, cancelConnection, doMultiClientLoadTest, doPipelineVerifyTest, fileHeavyLoad, fileOverLoad, filePipelineVerify, filePipelining, fileThreadedHandler, functionality, getHttpServerImplementationClass, getRequestCount, getServerName, getServerNameSuffix, handleError, multipleIndividualRequests, multipleIndividualSecureRequests, newHttpHeader, notDecodeRequestUrl, qualified, rawHeavyLoad, rawOverLoad, rawPipelineVerify, rawPipelining, rawSingleRequest, rawThreadedHandler, secureCancelConnection, secureSingleThreadedHandlerRequest, secureSocket, serverDateHeaders, setUp, singleBufferRequest, singleCloseFileRequest, singleFileRequest, singleRequest, singleSecureBufferRequest, singleSecureCloseFileRequest, singleSecureFileRequest, singleSecureRequest, singleThreadedHandlerRequest, socket, startHttpServer, startHttpServer, teamPressureOverload, tearDown
-
Constructor Details
-
AbstractServletHttpServerImplementationTest
public AbstractServletHttpServerImplementationTest()
-
-
Method Details
-
createServer
public static org.eclipse.jetty.server.Server createServer(HttpServerLocation serverLocation, SSLContext sslContext) Creates theServerfor theHttpServerLocation.- Parameters:
serverLocation-HttpServerLocation.sslContext-SSLContext. May benullif no HTTPS required.- Returns:
- Configured but not started
Server.
-
configureServer
protected abstract void configureServer(AbstractServletHttpServerImplementationTest.ServerContext context) throws Exception Configures theServer.- Parameters:
context-AbstractServletHttpServerImplementationTest.ServerContext.- Throws:
Exception- If fails to configureServer.
-
startHttpServer
protected AutoCloseable startHttpServer(OfficeFloorExtensionService officeFloorExtension, OfficeExtensionService officeExtension) throws Exception Description copied from class:AbstractHttpServerImplementationTestCaseStarts theHttpServer.- Overrides:
startHttpServerin classAbstractHttpServerImplementationTestCase- Parameters:
officeFloorExtension-OfficeFloorExtensionServiceto configure theOfficeFloor.officeExtension-OfficeExtensionServiceto configure theOfficeFloor.- Returns:
AutoCloseableto stop the server.- Throws:
Exception- If fails to start theHttpServer.
-
startRawHttpServer
Description copied from class:AbstractHttpServerImplementationTestCaseStarts a raw implementation of the underlying HTTP server. This allows performance comparisons of adding in
OfficeFloorservicing overheads.The raw implementation is to return "hello world" in UTF-8 encoding for the response entity.
- Specified by:
startRawHttpServerin classAbstractHttpServerImplementationTestCase- Parameters:
serverLocation-HttpServerLocation.- Returns:
AutoCloseableTo stop the server.- Throws:
Exception- If fails to start the raw HTTP server.
-
getServerResponseHeaderValues
Description copied from class:AbstractHttpServerImplementationTestCaseObtains the server responseHttpHeaderinstances in the order they are sent from the server.- Specified by:
getServerResponseHeaderValuesin classAbstractHttpServerImplementationTestCase- Returns:
- Server response
HttpHeaderinstances in the order they are sent from the server.
-
isHandleCancel
protected boolean isHandleCancel()Description copied from class:AbstractHttpServerImplementationTestCaseIndicates if handle cancel.- Overrides:
isHandleCancelin classAbstractHttpServerImplementationTestCase- Returns:
trueif handle cancel.
-