public abstract class SpincastGuiceBasedTestBase extends Object implements IBeforeAfterClassMethodsProvider
Uses a custom Junit runner,
OneInstancePerClassJUnitRunner.
This runner create a single instance of the test class for all of its tests,
instead of a new instance for each test. It also calls a beforeClass()
method before the tests are run and an afterClass() method after
they are run.
A class extending this will be part of a Guice context
(created using the createInjector method) and
the required dependencies will be injected into it.
| Constructor and Description |
|---|
SpincastGuiceBasedTestBase() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterClass() |
void |
beforeClass() |
protected abstract com.google.inject.Injector |
createInjector()
The test class must implement this method to create
the Guice injector.
|
protected String |
createTestingFilePath(String relativePath) |
protected void |
deleteTempDir() |
protected com.google.inject.Injector |
getInjector() |
protected ISpincastConfig |
getSpincastConfig() |
protected File |
getTestingWritableDir() |
protected void |
setSpincastConfig(ISpincastConfig spincastConfig) |
public void beforeClass()
beforeClass in interface IBeforeAfterClassMethodsProviderpublic void afterClass()
afterClass in interface IBeforeAfterClassMethodsProvider@Inject protected void setSpincastConfig(ISpincastConfig spincastConfig)
protected ISpincastConfig getSpincastConfig()
protected com.google.inject.Injector getInjector()
protected void deleteTempDir()
protected File getTestingWritableDir()
protected abstract com.google.inject.Injector createInjector()
main(...) method) or by
creating a custom Injector.Copyright © 2016. All rights reserved.