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 isTestScope
, which is for each test case that runs.- Author:
- Kohsuke Kawaguchi
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
configure()
void
endTestScope()
static World
get()
ClassLoader
getClassLoader()
com.google.inject.Injector
getInjector()
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 Detail
-
getClassLoader
public ClassLoader getClassLoader()
-
getInjector
public com.google.inject.Injector getInjector()
-
startTestScope
public void startTestScope(String testName)
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
public static World get()
-
-