public abstract class SpincastNoAppIntegrationTestBase<R extends RequestContext<?>,W extends WebsocketContext<?>> extends SpincastIntegrationTestBase<R,W>
In other words, instead of calling an application's
createApp(...) method to create the Guice context
and start the server, this class bootstarts eveything by itself
using Guice.createInjector(...) directly. The
HTTP/WebSocket server is started automatically.
Also, this class will clean everything related to routing
before each test (routes, static resources, etc.).
When you test an existing application,
by extending SpincastIntegrationTestBase directly,
you usually don't want to clean the routes of the application
before each test, since you want to test the application as it
is created. But here, you start each test with a fresh and
empty router.
| Constructor and Description |
|---|
SpincastNoAppIntegrationTestBase() |
| Modifier and Type | Method and Description |
|---|---|
void |
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 each test.
|
protected void |
clearRoutes() |
protected com.google.inject.Injector |
createInjector()
The test class must implement this method to create
the Guice injector.
|
protected String[] |
getMainArgsToUse() |
protected com.google.inject.Module |
getOverridingModule()
An overriding module to use?
|
abstract com.google.inject.Module |
getTestingModule()
The main Guice module to use.
|
protected boolean |
removeSpincastRoutesToo() |
protected void |
startServer() |
afterClass, CONNECT, CONNECT, CONNECT, createTestUrl, createTestUrl, createTestUrl, DELETE, DELETE, DELETE, formatDate, GET, GET, GET, getCookieFactory, getDefaultOverridingModule, getHttpClient, getRouter, getServer, HEAD, HEAD, HEAD, isDisableSllCetificateErrors, OPTIONS, OPTIONS, OPTIONS, parseDate, PATCH, PATCH, PATCH, POST, POST, POST, PUT, PUT, PUT, stopServer, TRACE, TRACE, TRACE, websocket, websocket, websocketafterClassLoops, afterTest, createTestingFilePath, createTestingFilePath, deleteTempDir, getInjector, getSpincastConfig, getTestingWritableDir, setSpincastConfig, testFailureprotected com.google.inject.Injector createInjector()
SpincastTestBasemain(...) method) or by
creating a custom Injector.createInjector in class SpincastTestBasepublic abstract com.google.inject.Module getTestingModule()
protected com.google.inject.Module getOverridingModule()
protected String[] getMainArgsToUse()
public void beforeClass()
beforeClass in interface BeforeAfterClassMethodsProviderbeforeClass in class SpincastTestBaseprotected void beforeStartServer()
public void beforeTest()
beforeTest in class SpincastTestBaseprotected void startServer()
protected void clearRoutes()
protected boolean removeSpincastRoutesToo()
Copyright © 2016. All rights reserved.