Class World
java.lang.Object
com.google.inject.AbstractModule
org.jenkinsci.test.acceptance.guice.World
- All Implemented Interfaces:
com.google.inject.Module
public class World
extends com.google.inject.AbstractModule
Holder of the Guice world for running tests. Singleton.
Hides the details of how a Guice injector is created.
In this test harness, Guice has two important scopes. One is the singleton scope that lives
for the entire duration of the VM (thus covering all the tests that are run.) This is the
Singleton
scope. The other scope is TestScope
, which is for each test case
that runs.
- Author:
- Kohsuke Kawaguchi
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
void
static World
get()
com.google.inject.Injector
void
startTestScope
(String testName) Call this method when a new test starts, to reset theTestScope
.Methods inherited from class com.google.inject.AbstractModule
addError, addError, addError, bind, bind, bind, bindConstant, binder, bindInterceptor, bindListener, bindListener, bindScope, configure, convertToTypes, currentStage, getMembersInjector, getMembersInjector, getProvider, getProvider, install, requestInjection, requestInjection, requestStaticInjection, requireBinding, requireBinding
-
Method Details
-
getClassLoader
-
getInjector
public com.google.inject.Injector getInjector() -
startTestScope
Call this method when a new test starts, to reset theTestScope
. -
endTestScope
public void endTestScope() -
configure
protected void configure()- Overrides:
configure
in classcom.google.inject.AbstractModule
-
get
-