Class AppBasedWebsocketTestingBase<R extends org.spincast.core.exchange.RequestContext<?>,W extends org.spincast.core.websocket.WebsocketContext<?>>

java.lang.Object
org.spincast.testing.core.SpincastTestBase
org.spincast.testing.core.AppBasedTestingBase<org.spincast.core.exchange.DefaultRequestContext,W>
org.spincast.testing.defaults.AppBasedWebsocketTestingBase<R,W>
All Implemented Interfaces:
org.spincast.testing.junitrunner.BeforeAfterClassMethodsProvider, org.spincast.testing.junitrunner.CanBeDisabled, org.spincast.testing.junitrunner.RepeatedClassAfterMethodProvider, org.spincast.testing.junitrunner.TestFailureListener
Direct Known Subclasses:
NoAppWebsocketTestingBase

public abstract class AppBasedWebsocketTestingBase<R extends org.spincast.core.exchange.RequestContext<?>,W extends org.spincast.core.websocket.WebsocketContext<?>> extends org.spincast.testing.core.AppBasedTestingBase<org.spincast.core.exchange.DefaultRequestContext,W>
Base class for WebSocket testing.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected static final org.slf4j.Logger
     
    protected org.spincast.plugins.httpclient.utils.SpincastHttpClientUtils
     

    Fields inherited from class org.spincast.testing.core.SpincastTestBase

    spincastConfig
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    protected void
     
    protected com.google.inject.Module
     
    protected com.google.inject.Module
     
    protected String
    Generates a random String for the "Sec-WebSocket-Key" Websocket header.
    protected int
     
    protected org.spincast.plugins.httpclient.utils.SpincastHttpClientUtils
     
    protected org.spincast.plugins.undertow.config.SpincastUndertowConfig
     
    protected String
     
    protected void
    validateIsNotWebsocketUpgradeHttpResponse(org.spincast.plugins.httpclient.HttpResponse response)
    Validates the response is NOT a Websocket upgrade permission.
    protected void
    validateIsWebsocketUpgradeHttpResponse(String path, org.spincast.plugins.httpclient.HttpResponse response)
    Validates the response is a Websocket upgrade permission.
    protected org.spincast.plugins.httpclient.websocket.builders.WebsocketRequestBuilder
    websocket(String pathOrUrl, boolean isFullUrl, boolean isHttps)
     

    Methods inherited from class org.spincast.testing.core.AppBasedTestingBase

    afterClass, beforeClass, callAppMainMethod, clearPreviousResponseCookies, CONNECT, CONNECT, CONNECT, createInjector, createTestUrl, createTestUrl, createTestUrl, createTestUrl, DELETE, DELETE, DELETE, formatDate, GET, GET, GET, getAppTestingConfigs, getCookieFactory, getExtraExactBindingsToRemoveBeforePlugins, getExtraPlugins, getGuiceTweakerExtraOverridingModule, getGuiceTweakerExtraPlugins, getHttpClient, getPreviousResponseCookie, getPreviousResponseCookies, getRouter, getServer, getTestingConfigImplementationClass, HEAD, HEAD, HEAD, isDisableBindCurrentClass, isDisableSllCetificateErrors, isIgnoreMethodsAnnotatedWithInjectDuringConfigurationsTweaking, isSetSecureFalseOnCookiesFromBag, OPTIONS, OPTIONS, OPTIONS, parseDate, PATCH, PATCH, PATCH, POST, POST, POST, PUT, PUT, PUT, saveResponseCookies, stopServer, TRACE, TRACE, TRACE, tweakConfigurations, validateCreatedInjector, websocket, websocket

    Methods inherited from class org.spincast.testing.core.SpincastTestBase

    addExtraSystemProperties, afterClassLoops, afterTest, beforeClassException, createGuiceTweaker, createTestingDir, createTestingFilePath, createTestingFilePath, deleteTestingWritableTempDir, getExtraSystemProperties, getGuiceTweakerFromThreadLocal, getGuiceTweakerPluginsToDisable, getInjector, getSpincastConfig, getTestingWritableTempDir, isTestClassDisabledPostBeforeClass, isTestClassDisabledPreBeforeClass, resetSystemProperties, testFailure

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • logger

      protected static final org.slf4j.Logger logger
    • spincastHttpClientUtils

      @Inject protected org.spincast.plugins.httpclient.utils.SpincastHttpClientUtils spincastHttpClientUtils
  • Constructor Details

    • AppBasedWebsocketTestingBase

      public AppBasedWebsocketTestingBase()
  • Method Details

    • getExtraOverridingModule

      protected com.google.inject.Module getExtraOverridingModule()
      Overrides:
      getExtraOverridingModule in class org.spincast.testing.core.AppBasedTestingBase<org.spincast.core.exchange.DefaultRequestContext,W extends org.spincast.core.websocket.WebsocketContext<?>>
    • getExtraOverridingModule3

      protected com.google.inject.Module getExtraOverridingModule3()
    • getSpincastUndertowConfigImplementation

      protected org.spincast.plugins.undertow.config.SpincastUndertowConfig getSpincastUndertowConfigImplementation()
    • getSpincastHttpClientUtils

      protected org.spincast.plugins.httpclient.utils.SpincastHttpClientUtils getSpincastHttpClientUtils()
    • beforeTest

      public void beforeTest()
      Overrides:
      beforeTest in class org.spincast.testing.core.SpincastTestBase
    • getServerPingIntervalSeconds

      protected int getServerPingIntervalSeconds()
    • closeAllWebsocketEndpoints

      protected void closeAllWebsocketEndpoints()
    • getWebsocketTestExpectedWebsocketV13AcceptHeaderValue

      protected String getWebsocketTestExpectedWebsocketV13AcceptHeaderValue()
    • getSecSocketKey

      protected String getSecSocketKey()
      Generates a random String for the "Sec-WebSocket-Key" Websocket header.
    • validateIsWebsocketUpgradeHttpResponse

      protected void validateIsWebsocketUpgradeHttpResponse(String path, org.spincast.plugins.httpclient.HttpResponse response)
      Validates the response is a Websocket upgrade permission.
    • validateIsNotWebsocketUpgradeHttpResponse

      protected void validateIsNotWebsocketUpgradeHttpResponse(org.spincast.plugins.httpclient.HttpResponse response)
      Validates the response is NOT a Websocket upgrade permission.
    • websocket

      protected org.spincast.plugins.httpclient.websocket.builders.WebsocketRequestBuilder websocket(String pathOrUrl, boolean isFullUrl, boolean isHttps)
      Overrides:
      websocket in class org.spincast.testing.core.AppBasedTestingBase<org.spincast.core.exchange.DefaultRequestContext,W extends org.spincast.core.websocket.WebsocketContext<?>>
      Parameters:
      sslInfo - If not null, then the initial connection is considered to be HTTPS and Websocket is served using SSL too.