Package jetbrains.buildServer.serverSide
Class BaseServerSpringContextTestCase
- java.lang.Object
-
- org.junit.Assert
-
- org.springframework.test.AbstractSpringContextTests
-
- org.springframework.test.AbstractSingleSpringContextTests
-
- org.springframework.test.AbstractDependencyInjectionSpringContextTests
-
- jetbrains.buildServer.TeamCitySpringTestBase
-
- jetbrains.buildServer.serverSide.BaseServerSpringContextTestCase
-
- All Implemented Interfaces:
WaitForAssertions
public class BaseServerSpringContextTestCase extends TeamCitySpringTestBase
- Author:
- Pavel.Sher Date: 04.08.2007
-
-
Field Summary
Fields Modifier and Type Field Description protected BuildAgentManagerEx
myAgentManager
protected AgentPersister
myAgentPersister
protected AgentTypeFinder
myAgentTypeFinder
protected AgentTypeManager
myAgentTypeManager
protected ArtifactDependencyFactory
myArtifactDependencyFactory
protected ConfigurationInitializer
myConfigurationInitializer
protected EventDispatcher<BuildServerListener>
myEventDispatcher
protected ProjectEx
myProject
protected BuildServerImpl
myServer
protected UserImpl
myUser
-
Fields inherited from class org.springframework.test.AbstractSingleSpringContextTests
applicationContext
-
Fields inherited from class org.springframework.test.AbstractSpringContextTests
logger
-
-
Constructor Summary
Constructors Constructor Description BaseServerSpringContextTestCase()
-
Method Summary
-
Methods inherited from class jetbrains.buildServer.TeamCitySpringTestBase
afterClass, contextKey, createApplicationContext, removeInternalProperty, setInternalProperty
-
Methods inherited from class org.springframework.test.AbstractDependencyInjectionSpringContextTests
getAutowireMode, injectDependencies, isDependencyCheck, prepareTestInstance
-
Methods inherited from class org.springframework.test.AbstractSingleSpringContextTests
createBeanDefinitionReader, 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
-
myServer
protected BuildServerImpl myServer
-
myProject
protected ProjectEx myProject
-
myUser
protected UserImpl myUser
-
myArtifactDependencyFactory
protected ArtifactDependencyFactory myArtifactDependencyFactory
-
myAgentManager
protected BuildAgentManagerEx myAgentManager
-
myAgentPersister
protected AgentPersister myAgentPersister
-
myAgentTypeFinder
protected AgentTypeFinder myAgentTypeFinder
-
myAgentTypeManager
protected AgentTypeManager myAgentTypeManager
-
myConfigurationInitializer
protected ConfigurationInitializer myConfigurationInitializer
-
myEventDispatcher
protected EventDispatcher<BuildServerListener> myEventDispatcher
-
-
Method Detail
-
getConfigLocations
protected 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)
-
setEventDispatcher
public void setEventDispatcher(EventDispatcher<BuildServerListener> eventDispatcher)
-
setAgentPersistenceFacade
public void setAgentPersistenceFacade(AgentPersister agentPersister)
-
setAgentTypeFinder
public void setAgentTypeFinder(AgentTypeFinder agentTypeFinder)
-
setAgentTypeManager
public void setAgentTypeManager(AgentTypeManager agentTypeManager)
-
setArtifactDependencyFactory
public void setArtifactDependencyFactory(ArtifactDependencyFactory artifactDependencyFactory)
-
setRolesManager
public void setRolesManager(RolesManagerImpl rolesManager)
-
setAgentManager
public void setAgentManager(BuildAgentManagerEx agentManager)
-
setVcsManager
public void setVcsManager(VcsManagerEx vcsManager)
-
getVcsManager
public VcsManagerEx getVcsManager()
-
setVcsHistory
public void setVcsHistory(VcsModificationHistoryEx vcsHistory)
-
setAuditLogFactory
public void setAuditLogFactory(AuditLogFactory auditLogFactory)
-
setAuditLogProvider
public void setAuditLogProvider(AuditLogProvider auditLogProvider)
-
setCriticalErrors
public void setCriticalErrors(CriticalErrors criticalErrors)
-
setRunTypeRegistry
public void setRunTypeRegistry(RunTypeRegistryImpl runTypeRegistry)
-
setVcsModificationsStorage
public void setVcsModificationsStorage(VcsModificationsStorage vcsModificationsStorage)
-
setVcsRootInstancesManager
public void setVcsRootInstancesManager(VcsRootInstancesManagerImpl vcsRootInstancesManager)
-
setExecutorServiceManager
public void setExecutorServiceManager(ExecutorServiceManager executorServiceManager)
-
setConfigurationInitializer
public void setConfigurationInitializer(ConfigurationInitializer configurationInitializer)
-
getAuditLogFactory
public AuditLogFactory getAuditLogFactory()
-
getAuditLogProvider
public AuditLogProvider getAuditLogProvider()
-
getCriticalErrors
public CriticalErrors getCriticalErrors()
-
getVcsHistory
public VcsModificationHistoryEx getVcsHistory()
-
getUserModel
public UserModel getUserModel()
-
getVcsModificationsStorage
public VcsModificationsStorage getVcsModificationsStorage()
-
getVcsRootInstancesManager
public VcsRootInstancesManagerImpl getVcsRootInstancesManager()
-
setUserModel
public void setUserModel(UserModel userModel)
-
getUserGroupManager
public UserGroupManager getUserGroupManager()
-
setUserGroupManager
public void setUserGroupManager(UserGroupManager userGroupManager)
-
getProjectFactory
public ProjectFactory getProjectFactory()
-
setProjectFactory
public void setProjectFactory(ProjectFactory projectFactory)
-
setBuildAgentMessagesQueue
public void setBuildAgentMessagesQueue(BuildAgentMessagesQueue buildAgentMessagesQueue)
-
setBuildServerLifecycleProcessor
public void setBuildServerLifecycleProcessor(BuildServerLifecycleProcessor buildServerLifecycleProcessor)
-
setupTeamCityDataDirectory
protected void setupTeamCityDataDirectory()
-
customizeBeanFactory
protected void customizeBeanFactory(org.springframework.beans.factory.support.DefaultListableBeanFactory beanFactory)
Description copied from class:AbstractSingleSpringContextTests
Customize the internal bean factory of the ApplicationContext used by this test. Called before bean definitions are read.The default implementation is empty. Can be overridden in subclasses to customize DefaultListableBeanFactory's standard settings.
- Overrides:
customizeBeanFactory
in classAbstractSingleSpringContextTests
- Parameters:
beanFactory
- the newly created bean factory for this context- See Also:
AbstractSingleSpringContextTests.loadContextLocations(java.lang.String[])
,AbstractSingleSpringContextTests.createApplicationContext(java.lang.String[])
,DefaultListableBeanFactory.setAllowBeanDefinitionOverriding(boolean)
,DefaultListableBeanFactory.setAllowEagerClassLoading(boolean)
,AbstractAutowireCapableBeanFactory.setAllowCircularReferences(boolean)
,AbstractAutowireCapableBeanFactory.setAllowRawInjectionDespiteWrapping(boolean)
-
setUpClass
@BeforeClass protected void setUpClass()
- Overrides:
setUpClass
in classTeamCitySpringTestBase
-
setUp1
@BeforeMethod public void setUp1() throws Throwable
- Overrides:
setUp1
in classTeamCitySpringTestBase
- Throws:
Throwable
-
enableDebug
protected void enableDebug()
-
tearDown1
@AfterMethod public void tearDown1() throws Exception
- Overrides:
tearDown1
in classTeamCitySpringTestBase
- Throws:
Exception
-
getServer
protected BuildServerImpl getServer()
-
getProjectManager
protected ProjectManagerEx getProjectManager()
-
setupSecurityContext
protected void setupSecurityContext(User user)
-
clearSecurityContext
protected void clearSecurityContext()
-
getUserFromContext
protected UserImpl getUserFromContext()
-
addGlobalRole
protected void addGlobalRole(@NotNull Role role)
-
removeGlobalRoles
protected void removeGlobalRoles()
-
removeProjectRoles
protected void removeProjectRoles(@NotNull String projectId)
-
setProjectManager
public void setProjectManager(ProjectManagerEx projectManager)
-
setBuildServer
public void setBuildServer(BuildServerImpl buildServer)
-
setVcsModificationChecker
public void setVcsModificationChecker(VcsModificationChecker vcsModificationChecker)
-
getVcsModificationChecker
public VcsModificationChecker getVcsModificationChecker()
-
setDependencyFactory
public void setDependencyFactory(DependencyFactory dependencyFactory)
-
createSnapshotDependency
protected Dependency createSnapshotDependency(SBuildType sourceBt)
-
addDependency
protected Dependency addDependency(@NotNull Dependent dependent, @NotNull SBuildType buildType)
-
createArtifactDependency
protected SArtifactDependency createArtifactDependency(SBuildType sourceBt)
-
getRolesManager
public RolesManagerImpl getRolesManager()
-
getTestRoles
public TestRoles getTestRoles()
-
createAndRegisterAgent
protected BuildAgentEx createAndRegisterAgent(String name)
-
createAgent
protected MockBuildAgent createAgent(String name)
-
logBuildMessages
protected void logBuildMessages(@NotNull SRunningBuild build, @NotNull List<BuildMessage1> messages)
-
testFailed
protected void testFailed(@NotNull SRunningBuild build, @NotNull String testName)
-
createBuild
@NotNull protected SFinishedBuild createBuild(@NotNull SBuildType bt)
-
getBuildAgentMessagesQueue
@NotNull public BuildAgentMessagesQueue getBuildAgentMessagesQueue()
-
finishBuild
@NotNull protected SFinishedBuild finishBuild(@NotNull SRunningBuild build)
-
-