Class AbstractHttpServerImplementationTestCase

    • Constructor Detail

      • AbstractHttpServerImplementationTestCase

        public AbstractHttpServerImplementationTestCase()
    • Method Detail

      • getRequestCount

        protected int getRequestCount()

        Obtains the request count.

        Allows changing the number for server implementations that have higher overheads.

        Returns:
        Request count.
      • startRawHttpServer

        protected abstract java.lang.AutoCloseable startRawHttpServer​(HttpServerLocation serverLocation)
                                                               throws java.lang.Exception

        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.

        Parameters:
        serverLocation - HttpServerLocation.
        Returns:
        AutoCloseable To stop the server.
        Throws:
        java.lang.Exception - If fails to start the raw HTTP server.
      • getServerResponseHeaderValues

        protected abstract HttpHeader[] getServerResponseHeaderValues()
        Obtains the server response HttpHeader instances in the order they are sent from the server.
        Returns:
        Server response HttpHeader instances in the order they are sent from the server.
      • getServerNameSuffix

        protected abstract java.lang.String getServerNameSuffix()
        Obtains the Server HttpHeaderValue suffix.
        Returns:
        Server HttpHeaderValue suffix. May be null if no suffix.
      • setUp

        @BeforeEach
        public void setUp​(org.junit.jupiter.api.TestInfo testInfo)
                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • tearDown

        @AfterEach
        public void tearDown()
                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • startHttpServer

        protected void startHttpServer​(java.lang.Class<?> sectionServicer)
                                throws java.lang.Exception
        Starts the HttpServer.
        Parameters:
        sectionServicer - Class of the ClassSectionSource to service the HttpRequest.
        Throws:
        java.lang.Exception - If fails to start the HttpServer.
      • async

        @Test
        public void async()
                   throws java.lang.Exception
        Ensure able to service asynchronous servicing.
        Throws:
        java.lang.Exception - If test failure.
      • functionality

        @Test
        public void functionality()
                           throws java.lang.Exception
        Ensure able to send all details and receive all details.
        Throws:
        java.lang.Exception - If test failure.
      • rawSingleRequest

        @Test
        public void rawSingleRequest()
                              throws java.lang.Exception
        Ensure can handle raw single HTTP request.
        Throws:
        java.lang.Exception - If test failure.
      • singleRequest

        @Test
        public void singleRequest()
                           throws java.lang.Exception
        Ensure can send a single HTTP request.
        Throws:
        java.lang.Exception - If test failure.
      • singleSecureRequest

        @Test
        public void singleSecureRequest()
                                 throws java.lang.Exception
        Ensure can send a single HTTPS request.
        Throws:
        java.lang.Exception - If test failure.
      • singleBufferRequest

        @Test
        public void singleBufferRequest()
                                 throws java.lang.Exception
        Ensure can send a single HTTP ByteBuffer response.
        Throws:
        java.lang.Exception - If test failure.
      • singleSecureBufferRequest

        @Test
        public void singleSecureBufferRequest()
                                       throws java.lang.Exception
        Ensure can send a single HTTPS ByteBuffer response.
        Throws:
        java.lang.Exception - If test failure.
      • singleFileRequest

        @Test
        public void singleFileRequest()
                               throws java.lang.Exception
        Ensure can send a single HTTP StreamBuffer.FileBuffer response.
        Throws:
        java.lang.Exception - If test failure.
      • singleSecureFileRequest

        @Test
        public void singleSecureFileRequest()
                                     throws java.lang.Exception
        Ensure can send a single HTTPS StreamBuffer.FileBuffer response.
        Throws:
        java.lang.Exception - If test failure.
      • serverDateHeaders

        @Test
        public void serverDateHeaders()
                               throws java.lang.Exception
        Ensure send Server and Date HttpHeader values.
        Throws:
        java.lang.Exception - If test failure.
      • getServerName

        protected java.lang.String getServerName()
        Obtains the server name.
        Returns:
        Server name.
      • singleCloseFileRequest

        @Test
        public void singleCloseFileRequest()
                                    throws java.lang.Exception
        Ensure closes the FileChannel on write.
        Throws:
        java.lang.Exception - If test failure.
      • singleSecureCloseFileRequest

        @Test
        public void singleSecureCloseFileRequest()
                                          throws java.lang.Exception
        Ensure closes the FileChannel on write.
        Throws:
        java.lang.Exception - If test failure.
      • multipleIndividualRequests

        public void multipleIndividualRequests()
                                        throws java.lang.Exception
        Ensure can send multiple HTTP requests.
        Throws:
        java.lang.Exception - If test failure.
      • multipleIndividualSecureRequests

        public void multipleIndividualSecureRequests()
                                              throws java.lang.Exception
        Ensure can send multiple HTTPS requests.
        Throws:
        java.lang.Exception - If test failure.
      • notDecodeRequestUrl

        @Test
        public void notDecodeRequestUrl()
                                 throws java.lang.Exception
        Ensure does not decode characters (allows for routing to work correctly and not find query string / fragment incorrectly).
        Throws:
        java.lang.Exception - If test failure.
      • socket

        @Test
        public void socket()
                    throws java.lang.Exception
        Ensure raw request.
        Throws:
        java.lang.Exception - If test failure.
      • secureSocket

        @Test
        public void secureSocket()
                          throws java.lang.Exception
        Ensure raw secure request.
        Throws:
        java.lang.Exception - If test failure.
      • handleError

        @Test
        public void handleError()
                         throws java.lang.Exception
        Ensure can handle Escalation.
        Throws:
        java.lang.Exception - If test failure.
      • teamPressureOverload

        @Test
        public void teamPressureOverload()
                                  throws java.lang.Exception
        Ensure can handle pressure overloading the server.
        Throws:
        java.lang.Exception - If test failure.
      • cancelConnection

        @Test
        public void cancelConnection()
                              throws java.lang.Exception
        Ensure ProcessState instances for connection are cancelled on loss of connection.
        Throws:
        java.lang.Exception - If test failure.
      • secureCancelConnection

        @Test
        public void secureCancelConnection()
                                    throws java.lang.Exception
        Ensure ProcessState instances for connection are cancelled on loss of secure connection.
        Throws:
        java.lang.Exception - If test failure.
      • isHandleCancel

        protected boolean isHandleCancel()
        Indicates if handle cancel.
        Returns:
        true if handle cancel.
      • rawPipelineVerify

        @Test
        public void rawPipelineVerify()
                               throws java.lang.Exception
        Verify pipeline HTTP requests.
        Throws:
        java.lang.Exception - If test failure.
      • bytesPipelineVerify

        @Test
        public void bytesPipelineVerify()
                                 throws java.lang.Exception
        Verify pipeline HTTP requests.
        Throws:
        java.lang.Exception - If test failure.
      • bufferPipelineVerify

        @Test
        public void bufferPipelineVerify()
                                  throws java.lang.Exception
        Verify pipeline HTTP requests.
        Throws:
        java.lang.Exception - If test failure.
      • filePipelineVerify

        @Test
        public void filePipelineVerify()
                                throws java.lang.Exception
        Verify pipeline HTTP requests.
        Throws:
        java.lang.Exception - If test failure.
      • doPipelineVerifyTest

        public void doPipelineVerifyTest​(java.lang.Class<?> servicerClass)
                                  throws java.lang.Exception
        Undertakes verifying the pipeline tests.
        Parameters:
        servicerClass - Servicer Class.
        Throws:
        java.lang.Exception - If fails test.
      • rawPipelining

        public void rawPipelining()
                           throws java.lang.Exception
        Ensure can pipeline HTTP requests.
        Throws:
        java.lang.Exception - If test failure.
      • bytesPipelining

        public void bytesPipelining()
                             throws java.lang.Exception
        Ensure can pipeline HTTP requests.
        Throws:
        java.lang.Exception - If test failure.
      • bufferPipelining

        public void bufferPipelining()
                              throws java.lang.Exception
        Ensure can pipeline HTTP requests.
        Throws:
        java.lang.Exception - If test failure.
      • filePipelining

        public void filePipelining()
                            throws java.lang.Exception
        Ensure can pipeline HTTP requests.
        Throws:
        java.lang.Exception - If test failure.
      • rawThreadedHandler

        public void rawThreadedHandler()
                                throws java.lang.Exception
        Ensure can handle HTTP requests with threaded handler.
        Throws:
        java.lang.Exception - If test failure.
      • bytesThreadedHandler

        public void bytesThreadedHandler()
                                  throws java.lang.Exception
        Ensure can handle HTTP requests with threaded handler.
        Throws:
        java.lang.Exception - If test failure.
      • bufferThreadedHandler

        public void bufferThreadedHandler()
                                   throws java.lang.Exception
        Ensure can handle HTTP requests with threaded handler.
        Throws:
        java.lang.Exception - If test failure.
      • fileThreadedHandler

        public void fileThreadedHandler()
                                 throws java.lang.Exception
        Ensure can handle HTTP requests with threaded handler.
        Throws:
        java.lang.Exception - If test failure.
      • rawHeavyLoad

        public void rawHeavyLoad()
                          throws java.lang.Exception
        Ensure can service multiple requests pipelined.
        Throws:
        java.lang.Exception - If test failure.
      • bytesHeavyLoad

        public void bytesHeavyLoad()
                            throws java.lang.Exception
        Ensure can service multiple requests pipelined.
        Throws:
        java.lang.Exception - If test failure.
      • bufferHeavyLoad

        public void bufferHeavyLoad()
                             throws java.lang.Exception
        Ensure can service multiple requests pipelined.
        Throws:
        java.lang.Exception - If test failure.
      • fileHeavyLoad

        public void fileHeavyLoad()
                           throws java.lang.Exception
        Ensure can service multiple requests pipelined.
        Throws:
        java.lang.Exception - If test failure.
      • rawOverLoad

        public void rawOverLoad()
                         throws java.lang.Exception
        Ensure can service over requests pipelined.
        Throws:
        java.lang.Exception - If test failure.
      • bytesOverLoad

        public void bytesOverLoad()
                           throws java.lang.Exception
        Ensure can service overload requests pipelined.
        Throws:
        java.lang.Exception - If test failure.
      • bufferOverLoad

        public void bufferOverLoad()
                            throws java.lang.Exception
        Ensure can service overload requests pipelined.
        Throws:
        java.lang.Exception - If test failure.
      • fileOverLoad

        public void fileOverLoad()
                          throws java.lang.Exception
        Ensure can service overload requests pipelined.
        Throws:
        java.lang.Exception - If test failure.
      • doMultiClientLoadTest

        public void doMultiClientLoadTest​(java.lang.Class<?> servicerClass,
                                          int clientCount,
                                          int requestCount,
                                          java.lang.String resultName)
                                   throws java.lang.Exception
        Undertakes the multi-client pipelining test.
        Parameters:
        servicerClass - Servicer Class.
        clientCount - Number of simultaneous clients.
        requestCount - Number of requests per client.
        resultName - Name of result for comparison.
        Throws:
        java.lang.Exception - If test failure.