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 Type
    Method
    Description
    protected void
     
    void
     
    static World
    get()
     
     
    com.google.inject.Injector
     
    void
    Call this method when a new test starts, to reset the TestScope.

    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • 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 the TestScope.
    • endTestScope

      public void endTestScope()
    • configure

      protected void configure()
      Overrides:
      configure in class com.google.inject.AbstractModule
    • get

      public static World get()