Package jetbrains.buildServer
Class BaseSpringTestCase
- java.lang.Object
-
- org.junit.Assert
-
- All Implemented Interfaces:
WaitForAssertions
- Direct Known Subclasses:
BaseAgentSpringTestCase
,SpringContextTestCase
public abstract class BaseSpringTestCase extends TeamCitySpringTestBase
-
-
Field Summary
Fields Modifier and Type Field Description protected TestLogger
myTestLogger
protected ThreadMonitor4Tests
myThreadMonitor4Tests
-
Fields inherited from class org.springframework.test.AbstractSingleSpringContextTests
applicationContext
-
Fields inherited from class org.springframework.test.AbstractSpringContextTests
logger
-
-
Constructor Summary
Constructors Constructor Description BaseSpringTestCase()
-
Method Summary
-
Methods inherited from class jetbrains.buildServer.TeamCitySpringTestBase
afterClass, contextKey, createApplicationContext
-
Methods inherited from class org.springframework.test.AbstractDependencyInjectionSpringContextTests
getAutowireMode, injectDependencies, isDependencyCheck, prepareTestInstance
-
Methods inherited from class org.springframework.test.AbstractSingleSpringContextTests
createBeanDefinitionReader, customizeBeanFactory, getApplicationContext, loadContext, loadContextLocations, onSetUp, onTearDown, setDirty, setUp, tearDown
-
Methods inherited from class org.springframework.test.AbstractSpringContextTests
contextKeyString, getContext, getContextKeyToContextMap, isContextKeyEmpty, setDirty
-
Methods inherited from class org.junit.Assert
assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertThat, assertThat, assertThrows, assertThrows, assertTrue, assertTrue, fail, fail
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jetbrains.buildServer.WaitForAssertions
waitFor, waitFor, waitForAssert, waitForAssert, waitForAssert, waitForAssert
-
-
-
-
Field Detail
-
myTestLogger
protected final TestLogger myTestLogger
-
myThreadMonitor4Tests
protected ThreadMonitor4Tests myThreadMonitor4Tests
-
-
Method Detail
-
setUpClass
@BeforeClass protected void setUpClass()
- Overrides:
setUpClass
in classTeamCitySpringTestBase
-
setUp1
@BeforeMethod public void setUp1() throws Throwable
- Overrides:
setUp1
in classTeamCitySpringTestBase
- Throws:
Throwable
-
tearDown1
@AfterMethod public void tearDown1() throws Exception
- Overrides:
tearDown1
in classTeamCitySpringTestBase
- Throws:
Exception
-
isRaiseLogErrorsAtTearDown
protected boolean isRaiseLogErrorsAtTearDown()
-
setRaiseLogErrorsAtTearDown
protected void setRaiseLogErrorsAtTearDown(boolean raiseLogErrorsAtTearDown)
-
getConfigLocations
protected final String[] getConfigLocations()
Description copied from class:AbstractSingleSpringContextTests
Subclasses can override this method to return the locations of their config files, unless they overrideAbstractSingleSpringContextTests.contextKey()
andAbstractSingleSpringContextTests.loadContext(Object)
instead.A plain path will be treated as class path location, e.g.: "org/springframework/whatever/foo.xml". Note however that you may prefix path locations with standard Spring resource prefixes. Therefore, a config location path prefixed with "classpath:" with behave the same as a plain path, but a config location such as "file:/some/path/path/location/appContext.xml" will be treated as a filesystem location.
The default implementation builds config locations for the config paths specified through
#getConfigPaths()
.- Overrides:
getConfigLocations
in classAbstractSingleSpringContextTests
- Returns:
- an array of config locations
- See Also:
#getConfigPaths()
,ResourceLoader.getResource(String)
-
attachSpringConfigurations
protected void attachSpringConfigurations(@NotNull Collection<String> configs)
-
configureSpringContextFromAnnotations
protected List<String> configureSpringContextFromAnnotations() throws IOException
- Throws:
IOException
-
gatherAnnotations
@NotNull protected <T extends Annotation> List<T> gatherAnnotations(@NotNull Class<T> annotationType)
-
generateBeansDefinitions
@NotNull protected List<String> generateBeansDefinitions(@Nullable SpringContextXmlBean[] beans) throws IOException
- Throws:
IOException
-
createSpringConfig
protected File createSpringConfig(Collection<Class<?>> classes, String... beans) throws IOException
- Throws:
IOException
-
createSpringConfigXml
public static String createSpringConfigXml(Collection<Pair<String,Class<?>>> classes, String... beans)
-
createTempFile
protected final File createTempFile(String content) throws IOException
- Throws:
IOException
-
createTempFile
protected final File createTempFile() throws IOException
- Throws:
IOException
-
createTempFile
protected final File createTempFile(int size) throws IOException
- Throws:
IOException
-
createTempDir
@NotNull public final File createTempDir() throws IOException
- Throws:
IOException
-
enableDebug
protected final void enableDebug()
-
clearFailure
protected final boolean clearFailure()
-
getLoggedFailure
protected final Throwable getLoggedFailure()
-
dumpFile
public static void dumpFile(File file)
-
assertCollectionsEqual
public static <T> void assertCollectionsEqual(Collection<T> actual, Collection<T> expected) throws junit.framework.ComparisonFailure
- Throws:
junit.framework.ComparisonFailure
-
setInternalProperty
protected void setInternalProperty(@NotNull String propKey, @NotNull String value)
- Overrides:
setInternalProperty
in classTeamCitySpringTestBase
-
removeInternalProperty
protected void removeInternalProperty(@NotNull String propKey)
- Overrides:
removeInternalProperty
in classTeamCitySpringTestBase
-
getTestFiles
public TestFiles getTestFiles()
-
cleanupTestFiles
@AfterMethod public void cleanupTestFiles()
-
-