Package it.tidalwave.util.test
Class SpringTestHelper
java.lang.Object
it.tidalwave.util.test.BaseTestHelper
it.tidalwave.util.test.SpringTestHelper
A facility that provides some common tasks for testing, such as creating a Spring context and manipulating files.
- Since:
- 3.2-ALPHA-18
- Author:
- Fabrizio Giudici
-
Nested Class Summary
Nested classes/interfaces inherited from class it.tidalwave.util.test.BaseTestHelper
BaseTestHelper.TestResource
-
Field Summary
Fields inherited from class it.tidalwave.util.test.BaseTestHelper
test
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.context.ApplicationContext
createSpringContext
(String... configurationFiles) Creates a Spring context configured with the given files.org.springframework.context.ApplicationContext
createSpringContext
(Consumer<? super org.springframework.context.support.GenericApplicationContext> modifier, String... configurationFiles) Creates a Spring context configured with the given files.org.springframework.context.ApplicationContext
createSpringContext
(Map<String, Object> properties, String... configurationFiles) Creates a Spring context configured with the given files.org.springframework.context.ApplicationContext
createSpringContext
(Map<String, Object> properties, Consumer<? super org.springframework.context.support.GenericApplicationContext> modifier, String... configurationFiles) Creates a Spring context configured with the given files.Methods inherited from class it.tidalwave.util.test.BaseTestHelper
readStringFromResource, resourceFileFor, testResourceFor
-
Constructor Details
-
SpringTestHelper
-
-
Method Details
-
createSpringContext
@Nonnull public org.springframework.context.ApplicationContext createSpringContext(@Nonnull String... configurationFiles) Creates a Spring context configured with the given files. A further configuration file is appended, namedtest-class-simple-name/TestBeans.xml
.- Parameters:
configurationFiles
- the configuration files- Returns:
- the Spring
ApplicationContext
-
createSpringContext
@Nonnull public org.springframework.context.ApplicationContext createSpringContext(@Nonnull Map<String, Object> properties, @Nonnull String... configurationFiles) Creates a Spring context configured with the given files. A further configuration file is appended, namedtest-class-simple-name/TestBeans.xml
.- Parameters:
properties
- the propertiesconfigurationFiles
- the configuration files- Returns:
- the Spring
ApplicationContext
-
createSpringContext
@Nonnull public org.springframework.context.ApplicationContext createSpringContext(@Nonnull Consumer<? super org.springframework.context.support.GenericApplicationContext> modifier, @Nonnull String... configurationFiles) Creates a Spring context configured with the given files. A further configuration file is appended, namedtest-class-simple-name/TestBeans.xml
.- Parameters:
modifier
- a processor to modify the contents of the contextconfigurationFiles
- the configuration files- Returns:
- the Spring
ApplicationContext
-
createSpringContext
@Nonnull public org.springframework.context.ApplicationContext createSpringContext(@Nonnull Map<String, Object> properties, @Nonnull Consumer<? super org.springframework.context.support.GenericApplicationContext> modifier, @Nonnull String... configurationFiles) Creates a Spring context configured with the given files. A further configuration file is appended, namedtest-class-simple-name/TestBeans.xml
.- Parameters:
properties
- the propertiesmodifier
- a processor to modify the contents of the contextconfigurationFiles
- the configuration files- Returns:
- the Spring
ApplicationContext
-