public.javadoc.org.spincast.testing.defaults.AppBasedWebsocketTestingBase.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spincast-website Show documentation
Show all versions of spincast-website Show documentation
Source code for the https://www.spincast.org website.
AppBasedWebsocketTestingBase (org.spincast:spincast-framework 1.14.0 API)
org.spincast.testing.defaults
Class AppBasedWebsocketTestingBase<R extends RequestContext<?>,W extends WebsocketContext<?>>
- java.lang.Object
-
- org.spincast.testing.core.SpincastTestBase
-
- org.spincast.testing.core.AppBasedTestingBase<DefaultRequestContext,W>
-
- org.spincast.testing.defaults.AppBasedWebsocketTestingBase<R,W>
-
- All Implemented Interfaces:
- BeforeAfterClassMethodsProvider, CanBeDisabled, RepeatedClassAfterMethodProvider, TestFailureListener
- Direct Known Subclasses:
- NoAppWebsocketTestingBase
public abstract class AppBasedWebsocketTestingBase<R extends RequestContext<?>,W extends WebsocketContext<?>>
extends AppBasedTestingBase<DefaultRequestContext,W>
Base class for WebSocket testing.
-
-
Field Summary
Fields
Modifier and Type
Field and Description
protected static org.slf4j.Logger
logger
protected SpincastHttpClientUtils
spincastHttpClientUtils
-
Fields inherited from class org.spincast.testing.core.SpincastTestBase
spincastConfig
-
Constructor Summary
Constructors
Constructor and Description
AppBasedWebsocketTestingBase()
-
Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type
Method and Description
void
beforeTest()
This method will be called before each test.
protected void
closeAllWebsocketEndpoints()
protected com.google.inject.Module
getExtraOverridingModule()
Can be overriden with something like :
protected com.google.inject.Module
getExtraOverridingModule3()
protected String
getSecSocketKey()
Generates a random String for the "Sec-WebSocket-Key"
Websocket header.
protected int
getServerPingIntervalSeconds()
protected SpincastHttpClientUtils
getSpincastHttpClientUtils()
protected SpincastUndertowConfig
getSpincastUndertowConfigImplementation()
protected String
getWebsocketTestExpectedWebsocketV13AcceptHeaderValue()
protected void
validateIsNotWebsocketUpgradeHttpResponse(HttpResponse response)
Validates the response is NOT a Websocket upgrade permission.
protected void
validateIsWebsocketUpgradeHttpResponse(String path,
HttpResponse response)
Validates the response is a Websocket upgrade permission.
protected 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
-
-
Field Detail
-
logger
protected static final org.slf4j.Logger logger
-
spincastHttpClientUtils
@Inject
protected SpincastHttpClientUtils spincastHttpClientUtils
-
Method Detail
-
getExtraOverridingModule
protected com.google.inject.Module getExtraOverridingModule()
Description copied from class: AppBasedTestingBase
Can be overriden with something like :
return Modules.override(super.getExtraOverridingModule()).with(new SpincastGuiceModuleBase() {
protected void configure() {
// ...
}
});
- Overrides:
getExtraOverridingModule
in class AppBasedTestingBase<DefaultRequestContext,W extends WebsocketContext<?>>
-
getExtraOverridingModule3
protected com.google.inject.Module getExtraOverridingModule3()
-
getSpincastUndertowConfigImplementation
protected SpincastUndertowConfig getSpincastUndertowConfigImplementation()
-
getSpincastHttpClientUtils
protected SpincastHttpClientUtils getSpincastHttpClientUtils()
-
beforeTest
public void beforeTest()
Description copied from class: SpincastTestBase
This method will be called before each test.
- Overrides:
beforeTest
in class 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,
HttpResponse response)
Validates the response is a Websocket upgrade permission.
-
validateIsNotWebsocketUpgradeHttpResponse
protected void validateIsNotWebsocketUpgradeHttpResponse(HttpResponse response)
Validates the response is NOT a Websocket upgrade permission.
-
websocket
protected WebsocketRequestBuilder websocket(String pathOrUrl,
boolean isFullUrl,
boolean isHttps)
- Overrides:
websocket
in class AppBasedTestingBase<DefaultRequestContext,W extends WebsocketContext<?>>
- Parameters:
sslInfo
- If not null, then the initial connection
is considered to be HTTPS and Websocket is served using SSL too.
Copyright © 2019. All rights reserved.