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 class
AbstractServletHttpServerImplementationTest.FixHeadersFilter
Filter
to fix theHttpHeader
instances.protected static class
AbstractServletHttpServerImplementationTest.ServerContext
Context 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 void
configureServer(AbstractServletHttpServerImplementationTest.ServerContext context)
Configures theServer
.static org.eclipse.jetty.server.Server
createServer(HttpServerLocation serverLocation, javax.net.ssl.SSLContext sslContext)
Creates theServer
for theHttpServerLocation
.protected HttpHeader[]
getServerResponseHeaderValues()
Obtains the server responseHttpHeader
instances in the order they are sent from the server.protected boolean
isHandleCancel()
Indicates if handle cancel.protected java.lang.AutoCloseable
startHttpServer(OfficeFloorExtensionService officeFloorExtension, OfficeExtensionService officeExtension)
Starts theHttpServer
.protected java.lang.AutoCloseable
startRawHttpServer(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 theServer
for theHttpServerLocation
.- Parameters:
serverLocation
-HttpServerLocation
.sslContext
-SSLContext
. May benull
if 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:AbstractHttpServerImplementationTestCase
Starts theHttpServer
.- Overrides:
startHttpServer
in classAbstractHttpServerImplementationTestCase
- Parameters:
officeFloorExtension
-OfficeFloorExtensionService
to configure theOfficeFloor
.officeExtension
-OfficeExtensionService
to configure theOfficeFloor
.- Returns:
AutoCloseable
to 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:AbstractHttpServerImplementationTestCase
Starts a raw implementation of the underlying HTTP server. This allows performance comparisons of adding in
OfficeFloor
servicing overheads.The raw implementation is to return "hello world" in UTF-8 encoding for the response entity.
- Specified by:
startRawHttpServer
in classAbstractHttpServerImplementationTestCase
- Parameters:
serverLocation
-HttpServerLocation
.- Returns:
AutoCloseable
To stop the server.- Throws:
java.lang.Exception
- If fails to start the raw HTTP server.
-
getServerResponseHeaderValues
protected HttpHeader[] getServerResponseHeaderValues()
Description copied from class:AbstractHttpServerImplementationTestCase
Obtains the server responseHttpHeader
instances in the order they are sent from the server.- Specified by:
getServerResponseHeaderValues
in classAbstractHttpServerImplementationTestCase
- Returns:
- Server response
HttpHeader
instances in the order they are sent from the server.
-
isHandleCancel
protected boolean isHandleCancel()
Description copied from class:AbstractHttpServerImplementationTestCase
Indicates if handle cancel.- Overrides:
isHandleCancel
in classAbstractHttpServerImplementationTestCase
- Returns:
true
if handle cancel.
-
-