Search in sources :

Example 1 with TestName2Index

use of jetbrains.buildServer.serverSide.TestName2Index in project teamcity-rest by JetBrains.

the class InvestigationFinderTest method testTestInvestigationModel.

@Test
public void testTestInvestigationModel() throws Exception {
    createFailingBuild();
    final TestName testName = new TestName(FAIL_TEST2_NAME);
    myFixture.getResponsibilityFacadeEx().setTestNameResponsibility(testName, myProject.getProjectId(), createRespEntry(ResponsibilityEntry.State.TAKEN, myUser));
    final PagedSearchResult<InvestigationWrapper> ivestigationWrappers = myInvestigationFinder.getItems((String) null);
    final Investigations investigations = new Investigations(ivestigationWrappers.myEntries, null, Fields.LONG, getBeanContext(myServer));
    assertEquals(1, investigations.count.longValue());
    final Investigation investigation = investigations.items.get(0);
    final TestName2Index testName2Index = myFixture.getSingletonService(TestName2Index.class);
    assertEquals("assignmentProject:(id:" + myProject.getExternalId() + "),test:(id:" + testName2Index.findTestNameId(testName) + ")", investigation.id);
    assertEquals("TAKEN", investigation.state);
    assertEquals((Long) myUser.getId(), investigation.assignee.getId());
    assertEquals("The comment", investigation.assignment.text);
    assertEquals(null, investigation.target.anyProblem);
    assertEquals(null, investigation.target.problems);
    assertEquals(FAIL_TEST2_NAME, investigation.target.tests.items.get(0).name);
    assertEquals(null, investigation.scope.buildTypes);
    assertEquals(myProject.getExternalId(), investigation.scope.project.id);
}
Also used : TestName(jetbrains.buildServer.tests.TestName) InvestigationWrapper(jetbrains.buildServer.server.rest.data.investigations.InvestigationWrapper) Investigation(jetbrains.buildServer.server.rest.model.buildType.Investigation) TestName2Index(jetbrains.buildServer.serverSide.TestName2Index) Investigations(jetbrains.buildServer.server.rest.model.buildType.Investigations) Test(org.testng.annotations.Test)

Example 2 with TestName2Index

use of jetbrains.buildServer.serverSide.TestName2Index in project teamcity-rest by JetBrains.

the class BaseTestScopesCollectorTest method setUp.

@BeforeMethod(alwaysRun = true)
@Override
protected void setUp() throws Exception {
    super.setUp();
    myTimeCondition = new TimeCondition(myFixture);
    myFixture.addService(myTimeCondition);
    myPermissionChecker = new PermissionChecker(myServer.getSecurityContext(), myProjectManager);
    myFixture.addService(myPermissionChecker);
    myProjectFinder = new ProjectFinder(myProjectManager, myPermissionChecker, myServer);
    myFixture.addService(myProjectFinder);
    myGroupFinder = new UserGroupFinder(getUserGroupManager());
    myFixture.addService(myGroupFinder);
    myUserFinder = new UserFinder(getUserModelEx(), myGroupFinder, myProjectFinder, myTimeCondition, myFixture.getRolesManager(), myPermissionChecker, myServer.getSecurityContext(), myServer);
    myAgentFinder = new AgentFinder(myAgentManager, myFixture);
    myFixture.addService(myAgentFinder);
    myBuildTypeFinder = new BuildTypeFinder(myProjectManager, myProjectFinder, myAgentFinder, myPermissionChecker, myFixture);
    myBranchFinder = new BranchFinder(myBuildTypeFinder, myFixture);
    final VcsRootIdentifiersManagerImpl vcsRootIdentifiersManager = myFixture.getSingletonService(VcsRootIdentifiersManagerImpl.class);
    myVcsRootFinder = new VcsRootFinder(myFixture.getVcsManager(), myProjectFinder, myBuildTypeFinder, myProjectManager, vcsRootIdentifiersManager, myPermissionChecker);
    myFixture.addService(myVcsRootFinder);
    myBuildPromotionFinder = new BuildPromotionFinder(myFixture.getBuildPromotionManager(), myFixture.getBuildQueue(), myServer, myVcsRootFinder, myProjectFinder, myBuildTypeFinder, myUserFinder, myAgentFinder, myBranchFinder, myTimeCondition, myPermissionChecker, null, myFixture);
    myFixture.addService(myBuildPromotionFinder);
    myBuildFinder = new BuildFinder(myFixture, myBuildTypeFinder, myProjectFinder, myUserFinder, myBuildPromotionFinder, myAgentFinder);
    final TestName2Index testName2Index = myFixture.getSingletonService(TestName2Index.class);
    final ProblemMutingService problemMutingService = myFixture.getSingletonService(ProblemMutingService.class);
    myTestFinder = new TestFinder(myProjectFinder, myBuildTypeFinder, myBuildPromotionFinder, myFixture.getTestManager(), testName2Index, myFixture.getCurrentProblemsManager(), problemMutingService);
    myFixture.addService(myTestFinder);
    TestScopeFilterProducer testScopesFilterProducer = new TestScopeFilterProducer(myBuildTypeFinder);
    final CurrentProblemsManager currentProblemsManager = myServer.getSingletonService(CurrentProblemsManager.class);
    myTestOccurrenceFinder = new TestOccurrenceFinder(myServer.getSecurityContext(), myTestFinder, myBuildFinder, myBuildTypeFinder, myProjectFinder, myFixture.getTestsHistory(), currentProblemsManager, myBranchFinder, testScopesFilterProducer);
    myFixture.addService(myTestOccurrenceFinder);
    myTestScopesCollector = new TestScopesCollector(myTestOccurrenceFinder, testScopesFilterProducer);
}
Also used : TestScopesCollector(jetbrains.buildServer.server.rest.data.problem.scope.TestScopesCollector) CurrentProblemsManager(jetbrains.buildServer.serverSide.CurrentProblemsManager) VcsRootIdentifiersManagerImpl(jetbrains.buildServer.serverSide.identifiers.VcsRootIdentifiersManagerImpl) TestName2Index(jetbrains.buildServer.serverSide.TestName2Index) TestOccurrenceFinder(jetbrains.buildServer.server.rest.data.problem.TestOccurrenceFinder) TestScopeFilterProducer(jetbrains.buildServer.server.rest.data.problem.scope.TestScopeFilterProducer) TestFinder(jetbrains.buildServer.server.rest.data.problem.TestFinder) ProblemMutingService(jetbrains.buildServer.serverSide.mute.ProblemMutingService) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 3 with TestName2Index

use of jetbrains.buildServer.serverSide.TestName2Index in project teamcity-rest by JetBrains.

the class BaseFinderTest method initFinders.

protected void initFinders() {
    myVcsManager = myFixture.getVcsManager();
    myFixture.addService(myVcsManager);
    myFixture.addService(myProjectManager);
    myPermissionChecker = new PermissionChecker(myServer.getSecurityContext(), myProjectManager);
    myFixture.addService(myPermissionChecker);
    myTimeCondition = new TimeCondition(myFixture);
    myFixture.addService(myTimeCondition);
    myProjectFinder = new ProjectFinder(myProjectManager, myPermissionChecker, myServer);
    myFixture.addService(myProjectFinder);
    myAgentFinder = new AgentFinder(myAgentManager, myFixture);
    myFixture.addService(myAgentFinder);
    myAgentPoolFinder = new AgentPoolFinder(myFixture.getAgentPoolManager(), myAgentFinder, myFixture);
    myFixture.addService(myAgentPoolFinder);
    myBuildTypeFinder = new BuildTypeFinder(myProjectManager, myProjectFinder, myAgentFinder, myPermissionChecker, myServer);
    myFixture.addService(myBuildTypeFinder);
    final VcsRootIdentifiersManagerImpl vcsRootIdentifiersManager = myFixture.getSingletonService(VcsRootIdentifiersManagerImpl.class);
    myVcsRootFinder = new VcsRootFinder(myVcsManager, myProjectFinder, myBuildTypeFinder, myProjectManager, vcsRootIdentifiersManager, myPermissionChecker);
    myFixture.addService(myVcsRootFinder);
    myVcsRootInstanceFinder = new VcsRootInstanceFinder(myVcsRootFinder, myVcsManager, myProjectFinder, myBuildTypeFinder, myProjectManager, myFixture.getSingletonService(VersionedSettingsManager.class), myTimeCondition, myPermissionChecker, myServer);
    myFixture.addService(myVcsRootInstanceFinder);
    myGroupFinder = new UserGroupFinder(getUserGroupManager());
    myFixture.addService(myGroupFinder);
    myUserFinder = new UserFinder(getUserModelEx(), myGroupFinder, myProjectFinder, myTimeCondition, myFixture.getRolesManager(), myPermissionChecker, myServer.getSecurityContext(), myServer);
    myFixture.addService(myUserFinder);
    myBranchFinder = new BranchFinder(myBuildTypeFinder, myFixture);
    myBuildPromotionFinder = new BuildPromotionFinder(myFixture.getBuildPromotionManager(), myFixture.getBuildQueue(), myServer, myVcsRootFinder, myProjectFinder, myBuildTypeFinder, myUserFinder, myAgentFinder, myBranchFinder, myTimeCondition, myPermissionChecker, null, myFixture);
    myFixture.addService(myBuildPromotionFinder);
    myBuildFinder = new BuildFinder(myServer, myBuildTypeFinder, myProjectFinder, myUserFinder, myBuildPromotionFinder, myAgentFinder);
    myFixture.addService(myBuildFinder);
    final TestName2Index testName2Index = myFixture.getSingletonService(TestName2Index.class);
    final ProblemMutingService problemMutingService = myFixture.getSingletonService(ProblemMutingService.class);
    myTestFinder = new TestFinder(myProjectFinder, myBuildTypeFinder, myBuildPromotionFinder, myFixture.getTestManager(), testName2Index, myFixture.getCurrentProblemsManager(), problemMutingService);
    myFixture.addService(myTestFinder);
    TestScopeFilterProducer filterProducer = new TestScopeFilterProducer(myBuildTypeFinder);
    final CurrentProblemsManager currentProblemsManager = myServer.getSingletonService(CurrentProblemsManager.class);
    myTestOccurrenceFinder = new TestOccurrenceFinder(myServer.getSecurityContext(), myTestFinder, myBuildFinder, myBuildTypeFinder, myProjectFinder, myFixture.getTestsHistory(), currentProblemsManager, myBranchFinder, filterProducer);
    myFixture.addService(myTestOccurrenceFinder);
    final BuildProblemManager buildProblemManager = myFixture.getSingletonService(BuildProblemManager.class);
    myProblemFinder = new ProblemFinder(myProjectFinder, myBuildPromotionFinder, buildProblemManager, myProjectManager, myFixture, problemMutingService);
    myFixture.addService(myProblemFinder);
    myProblemOccurrenceFinder = new ProblemOccurrenceFinder(myProjectFinder, myBuildFinder, myProblemFinder, buildProblemManager, myProjectManager, myFixture);
    myFixture.addService(myProblemOccurrenceFinder);
    final ResponsibilityFacadeEx responsibilityFacade = myFixture.getResponsibilityFacadeEx();
    myInvestigationFinder = new InvestigationFinder(myProjectFinder, myBuildTypeFinder, myProblemFinder, myTestFinder, myUserFinder, responsibilityFacade, responsibilityFacade, responsibilityFacade);
    myFixture.addService(myInvestigationFinder);
    myMuteFinder = new MuteFinder(myProjectFinder, myTimeCondition, myPermissionChecker, problemMutingService, (LowLevelProblemMutingServiceImpl) myFixture.getSingletonService(LowLevelProblemMutingService.class), myFixture);
    myFixture.addService(myMuteFinder);
    myQueuedBuildFinder = new QueuedBuildFinder(myServer.getQueue(), myProjectFinder, myBuildTypeFinder, myUserFinder, myAgentFinder, myAgentPoolFinder, myFixture.getBuildPromotionManager(), myServer);
    myFixture.addService(myQueuedBuildFinder);
    myChangeFinder = new ChangeFinder(myProjectFinder, myBuildFinder, myBuildPromotionFinder, myBuildTypeFinder, myVcsRootFinder, myVcsRootInstanceFinder, myUserFinder, myVcsManager, myFixture.getVcsHistory(), myBranchFinder, myFixture, myPermissionChecker);
    myFixture.addService(myChangeFinder);
    myFixture.addService(new HealthItemFinder(myFixture.getSingletonService(HealthStatusProvider.class), myFixture.getSingletonService(HealthStatusReportLocator.class), myFixture));
}
Also used : LowLevelProblemMutingService(jetbrains.buildServer.serverSide.mute.LowLevelProblemMutingService) ResponsibilityFacadeEx(jetbrains.buildServer.responsibility.ResponsibilityFacadeEx) VcsRootIdentifiersManagerImpl(jetbrains.buildServer.serverSide.identifiers.VcsRootIdentifiersManagerImpl) InvestigationFinder(jetbrains.buildServer.server.rest.data.investigations.InvestigationFinder) MuteFinder(jetbrains.buildServer.server.rest.data.mutes.MuteFinder) LowLevelProblemMutingService(jetbrains.buildServer.serverSide.mute.LowLevelProblemMutingService) ProblemMutingService(jetbrains.buildServer.serverSide.mute.ProblemMutingService) BuildProblemManager(jetbrains.buildServer.serverSide.problems.BuildProblemManager) CurrentProblemsManager(jetbrains.buildServer.serverSide.CurrentProblemsManager) TestName2Index(jetbrains.buildServer.serverSide.TestName2Index) TestOccurrenceFinder(jetbrains.buildServer.server.rest.data.problem.TestOccurrenceFinder) ProblemOccurrenceFinder(jetbrains.buildServer.server.rest.data.problem.ProblemOccurrenceFinder) TestScopeFilterProducer(jetbrains.buildServer.server.rest.data.problem.scope.TestScopeFilterProducer) TestFinder(jetbrains.buildServer.server.rest.data.problem.TestFinder) ProblemFinder(jetbrains.buildServer.server.rest.data.problem.ProblemFinder) LowLevelProblemMutingServiceImpl(jetbrains.buildServer.serverSide.mute.LowLevelProblemMutingServiceImpl)

Aggregations

TestName2Index (jetbrains.buildServer.serverSide.TestName2Index)3 TestFinder (jetbrains.buildServer.server.rest.data.problem.TestFinder)2 TestOccurrenceFinder (jetbrains.buildServer.server.rest.data.problem.TestOccurrenceFinder)2 TestScopeFilterProducer (jetbrains.buildServer.server.rest.data.problem.scope.TestScopeFilterProducer)2 CurrentProblemsManager (jetbrains.buildServer.serverSide.CurrentProblemsManager)2 VcsRootIdentifiersManagerImpl (jetbrains.buildServer.serverSide.identifiers.VcsRootIdentifiersManagerImpl)2 ProblemMutingService (jetbrains.buildServer.serverSide.mute.ProblemMutingService)2 ResponsibilityFacadeEx (jetbrains.buildServer.responsibility.ResponsibilityFacadeEx)1 InvestigationFinder (jetbrains.buildServer.server.rest.data.investigations.InvestigationFinder)1 InvestigationWrapper (jetbrains.buildServer.server.rest.data.investigations.InvestigationWrapper)1 MuteFinder (jetbrains.buildServer.server.rest.data.mutes.MuteFinder)1 ProblemFinder (jetbrains.buildServer.server.rest.data.problem.ProblemFinder)1 ProblemOccurrenceFinder (jetbrains.buildServer.server.rest.data.problem.ProblemOccurrenceFinder)1 TestScopesCollector (jetbrains.buildServer.server.rest.data.problem.scope.TestScopesCollector)1 Investigation (jetbrains.buildServer.server.rest.model.buildType.Investigation)1 Investigations (jetbrains.buildServer.server.rest.model.buildType.Investigations)1 LowLevelProblemMutingService (jetbrains.buildServer.serverSide.mute.LowLevelProblemMutingService)1 LowLevelProblemMutingServiceImpl (jetbrains.buildServer.serverSide.mute.LowLevelProblemMutingServiceImpl)1 BuildProblemManager (jetbrains.buildServer.serverSide.problems.BuildProblemManager)1 TestName (jetbrains.buildServer.tests.TestName)1