Class BaseSecondaryNodeTest
- java.lang.Object
-
- junit.framework.Assert
-
- jetbrains.buildServer.MockSupport
-
- jetbrains.buildServer.AfterTestHook
-
- jetbrains.buildServer.BaseTestCase
-
- jetbrains.buildServer.serverSide.db.BaseDatabaseTestCase
-
- jetbrains.buildServer.serverSide.impl.BaseServerTestCase
-
- jetbrains.buildServer.serverSide.impl.BaseSecondaryNodeTest
-
- All Implemented Interfaces:
WaitForAssertions
,org.testng.IHookable
,org.testng.ITestNGListener
- Direct Known Subclasses:
BaseSecondaryNodeWebTest
public abstract class BaseSecondaryNodeTest extends BaseServerTestCase
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
BaseSecondaryNodeTest.MainServerAction
static interface
BaseSecondaryNodeTest.MainServerFunction<T>
-
Nested classes/interfaces inherited from class jetbrains.buildServer.serverSide.impl.BaseServerTestCase
BaseServerTestCase.TestBuildServerImpl
-
Nested classes/interfaces inherited from class jetbrains.buildServer.serverSide.db.BaseDatabaseTestCase
BaseDatabaseTestCase.SQLWork
-
Nested classes/interfaces inherited from class jetbrains.buildServer.BaseTestCase
BaseTestCase.UnderLockedFile
-
-
Field Summary
Fields Modifier and Type Field Description protected Heartbeat
myHeartbeat
protected BuildTypeEx
myMainBuildType
protected ProjectEx
myMainProject
protected UserEx
myMainUser
protected UserEx
mySecondaryNodeUser
protected static String
SECONDARY_NODE_ID
protected static String
SECONDARY_SERVER_URL
-
Fields inherited from class jetbrains.buildServer.serverSide.impl.BaseServerTestCase
myAgentManager, myAuditLogFactory, myBuildAgent, myBuildType, myDb, myFixture, myIdSequences, myLoginConfiguration, myProject, myProjectManager, myServer, myWebLinks, NOOP_COUNTER
-
Fields inherited from class jetbrains.buildServer.serverSide.db.BaseDatabaseTestCase
dbType, ourDialect, ourQueryBuilder
-
Fields inherited from class jetbrains.buildServer.BaseTestCase
IS_WINDOWS, myTestLogger, OS_NAME
-
Fields inherited from class jetbrains.buildServer.MockSupport
ANYTHING, NOT_NULL, NULL
-
-
Constructor Summary
Constructors Constructor Description BaseSecondaryNodeTest()
-
Method Summary
-
Methods inherited from class jetbrains.buildServer.serverSide.impl.BaseServerTestCase
addDependency, addErrorMessage, addErrorMessage, addRole2LoggedInUser, addToQueue, assertParameterContained, assertRawParameterValue, blockProjectsPersister, build, buildPatchFromDir, checkOS, clearQueue, configurePlugins, containsSimilarArtifactDependency, copyBuildTypeConfig, copyProjectConfig, copyTemplateConfig, copyVcsRootConfig, createAdmin, createAdvancedProfileData, createBuild, createBuild, createBuild, createBuild, createBuild, createBuild, createBuild, createBuild, createBuildInBranch, createBuildInBranch, createBuildInBranch, createBuildInBranch, createBuildProblem, createBuildTypeTemplate, createBuildTypeTemplate, createBuildWithBuildDurationStatistic, createBuildWithBuildProblem, createBuildWithBuildProblems, createBuildWithBuildProblems, createBuildWithBuildProblemsInBranch, createBuildWithChanges, createBuildWithFailedTest, createBuildWithPassedTest, createCloudAgentType, createCustomBuild, createDependencyChain, createDependencyTrigger, createFailedBuild, createFailedBuildWithPassedTest, createInternalErrorBuild, createInternalErrorBuild, createInternalErrorBuildInBranch, createPersonalBuild, createProject, createProject, createPromotionOnModifications, createPromotionOnModifications, createPromotionWithChange, createPromotionWithDesiredBranch, createRespEntry, createRespEntry, createRunningBuild, createRunningBuildInBranch, createSimpleProfile, createSimpleProfile, createSimpleProfileData, createTest, createTriggerDescriptor, createTriggerDescriptor, createUser, createUser, createVcsRoot, createVcsUser, createVirtualProject, deleteLicenses, disableAllAgents, disableRunningBuildsUpdate, doCompilationProblem, dumpBuildState, enableFailOnAnyError, enableRunningBuildsUpdate, findBuildProblem, finishAllBuilds, finishAllQueuedBuilds, finishBuild, finishBuild, finishBuild, finishBuild, flushQueueAndWait, getAgentWorkingDirectoryState, getAllBuildProblems, getEventDispatcher, getFlushedBuildLog, getOrCreateUser, getParameterFactory, getPersonalBuildManager, getProblemId, getProjectAdminRole, getProjectDevRole, getProjectViewerRole, getQueue, getQueue, getRootProject, getRunningBuild, getRunningBuild, getSummaryFactory, getSuperUserRole, getSysAdminRole, getTestId, getTestNameId, getTestNames, getTestRoles, getTestsFromNames, getUserChangesFacade, getUserGroupManager, getUserModelEx, getXpathValue, hexEncodedPublicKey, initServer, logAgentTimezone, logout, makeBuildHanging, makeLoggedIn, makeProjectAccessible, makeProjectAccessible, makeProjectsAccessible, makeProjectsVisible, makeProjectVisible, muteBuildProblemInProject, muteBuildProblemInProject, muteBuildProblemInProject, muteTestsInBt, muteTestsInProject, muteTestsInProject, nTimes, nTimesApply, persist, publishModifications, queueAndWaitForFreeze, queueAndWaitForFreeze, recreateBuildServer, recreateBuildServer, recreateBuildServer, registerAndEnableAgent, registerBuildType, registerBuildType, registerBuildType, registerBuildType, registerBuildType, registerTemplateBasedBuildType, registerTwoTemplatesBasedBuildType, reloadQueue, removeRolesFromLoggedInUser, resolveInProject, runBuildOnModifications, runFailedBuildOnModifications, runningImpl, runningImpl, runSuccessfulBuildOnModifications, runTestsInRunningBuild, runTestsInRunningBuild, runTestsInRunningBuild, setActiveBranchNames, setActiveBranchNames, setBranchSpec, setDefaultLoginModule, setDurationEstimatesFor, setProblemResponsibilty, setReleaseDate, setResponsibilityForBuildType, setResponsibilityForTests, setResponsibilityForTests, setSelectedLoginModule, setUp000, shutdownServer, simulateJavaScriptEncryption, singletonBuildFeature, startBuild, startBuild, startBuild, startBuild, startBuild, startBuild, startBuildInBranch, startBuildInBranch, startBuildInBranch, startBuildWithChanges, switchToEnterpriseMode, switchToProfessionalMode, tearDownFixture, testFailed, testFailed, testNames2Objects, testSuccessful, testSuccessful, tid, unloadFinishedBuildPromotions, unmuteTests, unregisterAgent, unregisterBuildType, updateActiveBuildBranches, vcsSupport, vcsTrigger, waitForBuildToFail, withDisabledResponsibilities
-
Methods inherited from class jetbrains.buildServer.serverSide.db.BaseDatabaseTestCase
assertNoTableRows, cleanupTable, cleanupTables, cleanupTables, countTableRows, createEmptyServerPath, dumpTable, dumpTable, dumpTables, dumpTables, ensureCleanSchema, ensureCleanTable, ensureCleanTable, ensureNoTables, ensureSingleRowTable, executeScript, populateTablesWithSimpleData, provideDatabaseHsql2Only, provideDatabaseMsOnly, provideDatabaseTypeMySQLOnly, provideDatabaseTypeNotHSQL, provideDatabaseTypeNotMySQL, provideDatabaseTypeSupportI18n, provideWithCurrentDatabaseType, runTwoQueries, runTwoThreads, setUpClassStatic, withDBF, withDBF
-
Methods inherited from class jetbrains.buildServer.BaseTestCase
assertArraysEqual, assertArraysEqual, assertContains, assertContains, assertContains, assertContains, assertContains, assertContainsAll, assertContainsAny, assertContainsWithCount, assertEmpty, assertEmpty, assertEquals, assertEquals, assertEquals, assertEquals, assertEqualsIgnoreNonBMP, assertExceptionThrown, assertExceptionThrown, assertExceptionThrown, assertExceptionThrown, assertExceptionThrown, assertGreater, assertGreater, assertGreaterOrEquals, assertHasWithCount, assertInstanceOf, assertListEquals, assertMap, assertMapping, assertMatches, assertMatches, assertMeaningTextEquals, assertNotContains, assertNotContains, assertNotContains, assertNotEmpty, assertNull2, assertSameElements, assertSameElements, assertSameElements, assertSetEquals, assertTime, assertTime, assertTimestampEquals, assertXmlEqual, assertXmlEqual, averageExecutionTime, checkOrderedCollection, checkOrderedCollection, checkUnorderedCollection, checkUnorderedCollection, clearFailure, createMap, createSet, createTempDir, createTempFile, createTempFile, createTempFile, createTestLogger, doUnderLockedDirectory, doUnderLockedFile, doUnderUnreadableLockedFile, dumpCollection, dumpFile, dumpItems, enableAndRecordDebugLog, enableDebug, enableDebug, enableInfo, env, getLoggedFailure, getName, getProjectDir, getTestDataFile, getTestFiles, getTestFilesDataPath, hasCustomInternalProperty, isPropertyDefined, listFilesOrDie, listFilesOrDie, log, provideWithBooleans, provideWithLinuxMacWindows, provideWithWindowsOnly, registerAsTempFile, removeInternalProperty, resetAllFields, resetFields2Null, runAndReportMemoryAllocations, runAsync, runAsync, runAsyncAndFailOnException, setInternalProperty, setInternalProperty, setInternalProperty, setLogLevel, setName, setUpClass, setupSuite, startThreadsAsync, threadDump, toProvide, trueFalseDataProvider, waitFor, waitFor, waitFor, writeTextToFile
-
Methods inherited from class jetbrains.buildServer.AfterTestHook
finishAfterTestHook, initializeAfterTestHook, run
-
Methods inherited from class jetbrains.buildServer.MockSupport
and, arrayContaining, arrayContaining, arrayContaining, arrayContaining, arrayContaining, arrayContaining, arrayContaining, arrayContaining, arrayContaining, arrayContaining, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, atLeastOnce, collectionContaining, collectionContaining, compatibleType, contains, containsInAnyOrder, containsInAnyOrder, containsInOrder, containsInOrder, defaultMockNameForType, doAll, doAll, doAll, doAll, endsWith, eq, eq, eq, eq, eq, eq, eq, eq, eq, eq, exactly, hasProperty, hasProperty, isA, isGreaterThan, isIn, isIn, isLessThan, mapContaining, mapContaining, mapWithKey, mapWithKey, mapWithValue, mapWithValue, mock, mock, never, never, newDummy, newDummy, newDummy, not, not, once, onConsecutiveCalls, onConsecutiveCalls, onConsecutiveCalls, onConsecutiveCalls, or, returnIterator, returnIterator, returnValue, returnValue, returnValue, returnValue, returnValue, returnValue, returnValue, returnValue, returnValue, same, setUpMocks, startsWith, stringContains, tearDownMocks, throwException, toString, verify
-
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
-
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
-
SECONDARY_SERVER_URL
protected static final String SECONDARY_SERVER_URL
- See Also:
- Constant Field Values
-
SECONDARY_NODE_ID
protected static final String SECONDARY_NODE_ID
- See Also:
- Constant Field Values
-
myMainProject
protected ProjectEx myMainProject
-
myMainBuildType
protected BuildTypeEx myMainBuildType
-
myMainUser
protected UserEx myMainUser
-
mySecondaryNodeUser
protected UserEx mySecondaryNodeUser
-
myHeartbeat
protected Heartbeat myHeartbeat
-
-
Method Detail
-
setUp
@BeforeMethod public void setUp() throws Exception
- Overrides:
setUp
in classBaseServerTestCase
- Throws:
Exception
-
startBuildOnMainNode
protected RunningBuildEx startBuildOnMainNode() throws Exception
- Throws:
Exception
-
startBuildOnMainNode
protected RunningBuildEx startBuildOnMainNode(@NotNull SBuildType buildTypeOnMainNode) throws Exception
- Throws:
Exception
-
awaitBuildOnCurrentNode
@NotNull protected RunningBuildEx awaitBuildOnCurrentNode(long buildId)
-
ensureAssignedToCurrentNode
protected void ensureAssignedToCurrentNode(@NotNull SBuild build) throws Exception
- Throws:
Exception
-
setupCurrentNodeProperties
protected void setupCurrentNodeProperties()
-
setupMainNodeProperties
protected void setupMainNodeProperties()
Sets up additional main node properties that must be present before node initialization. For example properties responsible for periodical tasks execution and delays
-
initMainServerTestCaseVars
protected void initMainServerTestCaseVars(BuildServerCreator mainServerFixture)
-
performAfterTestVerification
protected void performAfterTestVerification()
Description copied from class:AfterTestHook
You should implement this method if you want to perform any checks after test was run. You shouldn't do it in theAfterMethod
because any exception there will result in that TestNG skip all following tests.- Overrides:
performAfterTestVerification
in classBaseTestCase
-
tearDown
@AfterMethod(alwaysRun=true) public void tearDown() throws Exception
- Overrides:
tearDown
in classBaseServerTestCase
- Throws:
Exception
-
mainServerAction
protected void mainServerAction(@NotNull BaseSecondaryNodeTest.MainServerAction action) throws Exception
- Throws:
Exception
-
mainServerFunc
protected <T> T mainServerFunc(@NotNull BaseSecondaryNodeTest.MainServerFunction<T> action) throws Exception
- Throws:
Exception
-
mainServerFunc
protected <T> T mainServerFunc(@NotNull BaseSecondaryNodeTest.MainServerFunction<T> action, boolean postProcess) throws Exception
- Throws:
Exception
-
mainServerAsyncFunc
protected void mainServerAsyncFunc(@NotNull BaseSecondaryNodeTest.MainServerFunction<Void> action) throws Exception
- Throws:
Exception
-
reconfigureMainServerExecutor
protected void reconfigureMainServerExecutor(int numThreads)
-
updateBothNodes
protected void updateBothNodes(@NotNull Consumer<BuildServerCreator> fixtureUpdater) throws Exception
- Throws:
Exception
-
shutdownMainServerAndWait
protected void shutdownMainServerAndWait() throws Exception
- Throws:
Exception
-
enableMainServerResponsibility
protected void enableMainServerResponsibility()
-
assertDoesNotHaveRecursiveEvents
protected void assertDoesNotHaveRecursiveEvents()
-
enableResponsibility
protected void enableResponsibility(@NotNull NodeResponsibility... responsibilities) throws Exception
- Throws:
Exception
-
enableRunningBuildsForCurrentNode
protected void enableRunningBuildsForCurrentNode() throws Exception
- Throws:
Exception
-
setMainNodeResponsibilityStatus
protected void setMainNodeResponsibilityStatus(boolean enabled, @NotNull NodeResponsibility... responsibilities) throws Exception
- Throws:
Exception
-
disableResponsibility
protected void disableResponsibility(@NotNull NodeResponsibility... responsibilities) throws Exception
- Throws:
Exception
-
setResponsibilityProperty
protected void setResponsibilityProperty(@NotNull NodeResponsibility responsibility, @NotNull String propName, @NotNull String propVal)
-
waitForFinishedBuild
@NotNull protected SFinishedBuild waitForFinishedBuild(long buildId)
-
-