All Downloads are FREE. Search and download functionalities are using the official Maven repository.

public.javadoc.org.spincast.testing.core.SpincastTestBase.html Maven / Gradle / Ivy

There is a newer version: 2.2.0
Show newest version






SpincastTestBase (org.spincast:spincast-framework 1.0.0 API)












org.spincast.testing.core

Class SpincastTestBase

    • Field Detail

      • logger

        protected final org.slf4j.Logger logger
    • Constructor Detail

      • SpincastTestBase

        public SpincastTestBase()
    • Method Detail

      • addExtraSystemProperties

        protected void addExtraSystemProperties()
        Adds System properties as they are provided by the getExtraSystemProperties() method.
      • getExtraSystemProperties

        protected Map<String,String> getExtraSystemProperties()
        Extra System properties to set before the tests are run. Those will be automatically reset once the tests are done.
      • getExtraExactBindingsToRemoveBeforePlugins

        protected Set<com.google.inject.Key<?>> getExtraExactBindingsToRemoveBeforePlugins()
        Extra exact bindings to remvoe before the plugins are applied.
      • resetSystemProperties

        protected void resetSystemProperties()
        Resets System properties.
      • getGuiceTweakerFromThreadLocal

        protected GuiceTweaker getGuiceTweakerFromThreadLocal()
      • validateCreatedInjector

        protected void validateCreatedInjector(com.google.inject.Injector guice)
        Validates the created Injector, before the dependencies are injected in the test class.
      • createGuiceTweaker

        protected GuiceTweaker createGuiceTweaker()
      • tweakConfigurations

        protected void tweakConfigurations(GuiceTweaker guiceTweaker)
      • isDisableBindCurrentClass

        protected boolean isDisableBindCurrentClass()
      • getGuiceTweakerExtraPlugins

        protected List<SpincastPlugin> getGuiceTweakerExtraPlugins()
        Extra plugins to be added by the Guice Tweaker.
      • getGuiceTweakerExtraOverridingModule

        protected com.google.inject.Module getGuiceTweakerExtraOverridingModule()
        If an overriding Module is to be added using the Guice tweaker.

        Can be overriden with something like :

         return Modules.override(super.getGuiceTweakerExtraOverridingModule()).with(new SpincastGuiceModuleBase() {
             protected void configure() {
                 // ...
             }
         });
         
      • getTestingConfigImplementationClass

        protected Class<? extends SpincastConfig> getTestingConfigImplementationClass()
        The implementation to use for the SpincastConfig binding, when running tests.
      • beforeTest

        public void beforeTest()
        This method will be called before each test.
      • afterTest

        public void afterTest()
        This method will be called after each test.
      • afterClass

        public void afterClass()
        Description copied from interface: BeforeAfterClassMethodsProvider
        Called after the tests of the class are ran.

        This will only be called if the beforeClass() method completed successfully, so you can be sure that the instanciation of the class is complete here.

        Specified by:
        afterClass in interface BeforeAfterClassMethodsProvider
      • afterClassLoops

        public void afterClassLoops()
        Description copied from interface: RepeatedClassAfterMethodProvider
        Called after all the loops of the class as specified by the @repeat annotation.

        This will only be called if the beforeClass() method completed successfully, so you can be sure that the instanciation of the class is complete here.

        Specified by:
        afterClassLoops in interface RepeatedClassAfterMethodProvider
      • testFailure

        public void testFailure(org.junit.runner.notification.Failure failure)
        You can override this method to be informed when a test fails.
        Specified by:
        testFailure in interface TestFailureListener
      • getInjector

        protected com.google.inject.Injector getInjector()
        Returns the Guice injector.
      • deleteTestingWritableTempDir

        protected void deleteTestingWritableTempDir()
        Deletes the testing writable temp directory.
      • getTestingWritableTempDir

        protected File getTestingWritableTempDir()
        Returns the directory that can be used to create files and subdirectories during testing.

        This directory will be deleted when the tests are done.

      • createTestingFilePath

        protected String createTestingFilePath(String relativePath)
        Returns the absolute path to use, given the relative one, to create a temporary test file.

        This file will be deleted when the tests are done.

      • createTestingFilePath

        protected String createTestingFilePath()
        Returns a unique path to use to create a temporary test file.

        This file will be deleted when the tests are done.

      • createTestingDir

        protected File createTestingDir()
        Create a temp directory.

        This directory will be deleted when the tests are done.

      • createInjector

        protected abstract com.google.inject.Injector createInjector()
        The test class must implement this method to create the Guice injector. It can be done by starting a real application (with a main(...) method) or by creating a custom Injector.

Copyright © 2019. All rights reserved.





© 2015 - 2024 Weber Informatics LLC | Privacy Policy