public abstract class NoAppStartHttpServerCustomContextTypesTestingBase<R extends RequestContext<?>,W extends WebsocketContext<?>> extends AppBasedTestingBase<R,W>
Note that, by default, all routes are cleared
before each test! Even routes added by plugins...
To change this behavior, override the
clearRoutes()
method.
logger, spincastConfig| Constructor and Description |
|---|
NoAppStartHttpServerCustomContextTypesTestingBase() |
| Modifier and Type | Method and Description |
|---|---|
void |
beforeClass()
Don't forget to first call
super.beforeClass() |
protected void |
beforeStartServer()
Allows some initialization to be run once the Guice context
is created, but before the Server is started.
|
void |
beforeTest()
Ran before every test.
|
protected void |
callAppMainMethod()
Starts the application.
|
protected void |
clearRoutes() |
protected SpincastBootstrapper |
createBootstrapper() |
protected AppTestingConfigs |
getAppTestingConfigs()
We force test classes to provide information about
the required testing configurations.
|
protected String[] |
getMainArgs() |
protected abstract Class<? extends RequestContext<?>> |
getRequestContextImplementationClass() |
protected Class<? extends SpincastConfig> |
getTestingConfigImplementationClass2() |
protected abstract Class<? extends WebsocketContext<?>> |
getWebsocketContextImplementationClass() |
protected boolean |
removeSpincastRoutesToo()
Should the default Spincast Routes
be removed too? Or only the custom ones?
|
protected void |
startServer() |
afterClass, clearPreviousResponseCookies, CONNECT, CONNECT, CONNECT, createInjector, createTestUrl, createTestUrl, createTestUrl, createTestUrl, DELETE, DELETE, DELETE, formatDate, GET, GET, GET, getCookieFactory, getExtraExactBindingsToRemoveBeforePlugins, getExtraOverridingModule, 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, websocketaddExtraSystemProperties, afterClassLoops, afterTest, beforeClassException, createGuiceTweaker, createTestingDir, createTestingFilePath, createTestingFilePath, deleteTestingWritableTempDir, getExtraSystemProperties, getGuiceTweakerFromThreadLocal, getGuiceTweakerPluginsToDisable, getInjector, getSpincastConfig, getTestingWritableTempDir, isTestClassDisabledPostBeforeClass, isTestClassDisabledPreBeforeClass, resetSystemProperties, testFailurepublic NoAppStartHttpServerCustomContextTypesTestingBase()
protected final AppTestingConfigs getAppTestingConfigs()
AppBasedTestingBaseThe bindings for those components will be automatically created.
getAppTestingConfigs in class AppBasedTestingBase<R extends RequestContext<?>,W extends WebsocketContext<?>>null
to disable this process (you will then have to add the
required config bindings by yourself).protected Class<? extends SpincastConfig> getTestingConfigImplementationClass2()
protected final void callAppMainMethod()
AppBasedTestingBase
In this method, you should call your
application main() method.
There is no need to start the
Server here, since the target
application is supposed to do it by itself,
in general in an "@Inject init()"
method!
callAppMainMethod in class AppBasedTestingBase<R extends RequestContext<?>,W extends WebsocketContext<?>>protected SpincastBootstrapper createBootstrapper()
protected String[] getMainArgs()
public void beforeClass()
super.beforeClass()beforeClass in interface BeforeAfterClassMethodsProviderbeforeClass in class AppBasedTestingBase<R extends RequestContext<?>,W extends WebsocketContext<?>>protected void startServer()
protected void beforeStartServer()
public void beforeTest()
beforeTest in class SpincastTestBaseprotected void clearRoutes()
protected boolean removeSpincastRoutesToo()
protected abstract Class<? extends RequestContext<?>> getRequestContextImplementationClass()
protected abstract Class<? extends WebsocketContext<?>> getWebsocketContextImplementationClass()
Copyright © 2019. All rights reserved.