Package org.spincast.testing.defaults
Class NoAppWebsocketTestingBase
java.lang.Object
org.spincast.testing.core.SpincastTestBase
org.spincast.testing.core.AppBasedTestingBase<DefaultRequestContext,W>
org.spincast.testing.defaults.AppBasedWebsocketTestingBase<DefaultRequestContext,DefaultWebsocketContext>
org.spincast.testing.defaults.NoAppWebsocketTestingBase
- All Implemented Interfaces:
BeforeAfterClassMethodsProvider,CanBeDisabled,RepeatedClassAfterMethodProvider,TestFailureListener
public abstract class NoAppWebsocketTestingBase
extends AppBasedWebsocketTestingBase<DefaultRequestContext,DefaultWebsocketContext>
Base class for WebSocket testing without an App.
-
Field Summary
FieldsFields inherited from class org.spincast.testing.defaults.AppBasedWebsocketTestingBase
spincastHttpClientUtilsFields inherited from class org.spincast.testing.core.SpincastTestBase
spincastConfig -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled before the tests of the class are ran.protected voidAllows some initialization to be run once the Guice context is created, but before the Server is started.voidRan before every test.protected final voidStarts the application.protected voidprotected final AppTestingConfigsWe force test classes to provide information about the required testing configurations.protected String[]protected Class<? extends SpincastConfig>protected booleanShould the default Spincast Routes be removed too? Or only the custom ones?protected voidMethods inherited from class org.spincast.testing.defaults.AppBasedWebsocketTestingBase
closeAllWebsocketEndpoints, getExtraOverridingModule, getExtraOverridingModule3, getSecSocketKey, getServerPingIntervalSeconds, getSpincastHttpClientUtils, getSpincastUndertowConfigImplementation, getWebsocketTestExpectedWebsocketV13AcceptHeaderValue, validateIsNotWebsocketUpgradeHttpResponse, validateIsWebsocketUpgradeHttpResponse, websocketMethods inherited from class org.spincast.testing.core.AppBasedTestingBase
afterClass, clearPreviousResponseCookies, CONNECT, CONNECT, CONNECT, createInjector, createTestUrl, createTestUrl, createTestUrl, createTestUrl, DELETE, DELETE, DELETE, formatDate, GET, GET, GET, 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, websocketMethods 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 Details
-
logger
protected static final org.slf4j.Logger logger
-
-
Constructor Details
-
NoAppWebsocketTestingBase
public NoAppWebsocketTestingBase()
-
-
Method Details
-
getAppTestingConfigs
Description copied from class:AppBasedTestingBaseWe force test classes to provide information about the required testing configurations.The bindings for those components will be automatically created.
- Specified by:
getAppTestingConfigsin classAppBasedTestingBase<DefaultRequestContext,DefaultWebsocketContext> - Returns:
- the testing configs informations or
nullto disable this process (you will then have to add the required config bindings by yourself).
-
getTestingConfigImplClass
-
callAppMainMethod
protected final void callAppMainMethod()Description copied from class:AppBasedTestingBaseStarts the application.In this method, you should call your application
main()method.There is no need to start the
Serverhere, since the target application is supposed to do it by itself, in general in an "@Inject init()" method!- Specified by:
callAppMainMethodin classAppBasedTestingBase<DefaultRequestContext,DefaultWebsocketContext>
-
getMainArgs
-
beforeClass
public void beforeClass()Description copied from interface:BeforeAfterClassMethodsProviderCalled before the tests of the class are ran.- Specified by:
beforeClassin interfaceBeforeAfterClassMethodsProvider- Overrides:
beforeClassin classAppBasedTestingBase<DefaultRequestContext,DefaultWebsocketContext>
-
startServer
protected void startServer() -
beforeStartServer
protected void beforeStartServer()Allows some initialization to be run once the Guice context is created, but before the Server is started. -
beforeTest
public void beforeTest()Ran before every test.- Overrides:
beforeTestin classAppBasedWebsocketTestingBase<DefaultRequestContext,DefaultWebsocketContext>
-
clearRoutes
protected void clearRoutes() -
removeSpincastRoutesToo
protected boolean removeSpincastRoutesToo()Should the default Spincast Routes be removed too? Or only the custom ones?
-