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 withHttpServlet.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractServletHttpServerImplementationTest.FixHeadersFilterFilterto fix theHttpHeaderinstances.protected static classAbstractServletHttpServerImplementationTest.ServerContextContext 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.Servicer, AbstractHttpServerImplementationTestCase.TeamMarker, AbstractHttpServerImplementationTestCase.TeamTwoMarker, AbstractHttpServerImplementationTestCase.ThreadedManagedObject, AbstractHttpServerImplementationTestCase.ThreadedServicer
-
-
Constructor Summary
Constructors Constructor Description AbstractServletHttpServerImplementationTest()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidconfigureServer(AbstractServletHttpServerImplementationTest.ServerContext context)Configures theServer.static org.eclipse.jetty.server.ServercreateServer(HttpServerLocation serverLocation, javax.net.ssl.SSLContext sslContext)Creates theServerfor theHttpServerLocation.protected HttpHeader[]getServerResponseHeaderValues()Obtains the server responseHttpHeaderinstances in the order they are sent from the server.protected booleanisHandleCancel()Indicates if handle cancel.protected java.lang.AutoCloseablestartHttpServer(OfficeFloorExtensionService officeFloorExtension, OfficeExtensionService officeExtension)Starts theHttpServer.protected java.lang.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, 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
-
-
-
-
Method Detail
-
createServer
public static org.eclipse.jetty.server.Server createServer(HttpServerLocation serverLocation, javax.net.ssl.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 java.lang.Exception
Configures theServer.- Parameters:
context-AbstractServletHttpServerImplementationTest.ServerContext.- Throws:
java.lang.Exception- If fails to configureServer.
-
startHttpServer
protected java.lang.AutoCloseable startHttpServer(OfficeFloorExtensionService officeFloorExtension, OfficeExtensionService officeExtension) throws java.lang.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:
java.lang.Exception- If fails to start theHttpServer.
-
startRawHttpServer
protected java.lang.AutoCloseable startRawHttpServer(HttpServerLocation serverLocation) throws java.lang.Exception
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:
java.lang.Exception- If fails to start the raw HTTP server.
-
getServerResponseHeaderValues
protected HttpHeader[] 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.
-
-