Class InjectedTestCase

  • All Implemented Interfaces:
    com.google.inject.Module, junit.framework.Test

    public abstract class InjectedTestCase
    extends junit.framework.TestCase
    implements com.google.inject.Module
    Abstract JUnit3 TestCase that automatically binds and injects itself.
    • Constructor Detail

      • InjectedTestCase

        public InjectedTestCase()
    • Method Detail

      • setUp

        protected void setUp()
                      throws Exception
        Overrides:
        setUp in class junit.framework.TestCase
        Throws:
        Exception
      • tearDown

        protected void tearDown()
                         throws Exception
        Overrides:
        tearDown in class junit.framework.TestCase
        Throws:
        Exception
      • configure

        public void configure​(com.google.inject.Binder binder)
        Custom injection bindings.
        Specified by:
        configure in interface com.google.inject.Module
        Parameters:
        binder - The Guice binder
      • configure

        public void configure​(Properties properties)
        Custom property values.
        Parameters:
        properties - The test properties
      • lookup

        public final <T> T lookup​(Class<T> type)
      • lookup

        public final <T> T lookup​(Class<T> type,
                                  String name)
      • lookup

        public final <T> T lookup​(Class<T> type,
                                  Annotation qualifier)
      • getBasedir

        public final String getBasedir()