Search in sources :

Example 1 with TestNameResponsibilityFacade

use of jetbrains.buildServer.responsibility.TestNameResponsibilityFacade in project teamcity-rest by JetBrains.

the class TestOccurrenceFinderTest method testInvestigationState.

@Test
public void testInvestigationState() throws Exception {
    final BuildTypeImpl buildType = registerBuildType("buildConf1", "project1");
    final SFinishedBuild build = build().in(buildType).withTest("aaa_active", false).withTest("bbb_fixed", false).withTest("ccc_given_up", false).withTest("ddd_none", false).finish();
    long activeNameId = myFixture.getSingletonService(TestName2Index.class).getOrSaveTestNameId("aaa_active");
    long fixedNameId = myFixture.getSingletonService(TestName2Index.class).getOrSaveTestNameId("bbb_fixed");
    long givenUpNameId = myFixture.getSingletonService(TestName2Index.class).getOrSaveTestNameId("ccc_given_up");
    SUser user = createUser("user");
    ProjectEx project = myServer.getProjectManager().getRootProject().findProjectByName("project1");
    TestNameResponsibilityEntryImpl activeEntry = new TestNameResponsibilityEntryImpl(new TestName("aaa_active"), activeNameId, ResponsibilityEntry.State.TAKEN, user, user, new Date(), "Please, fix", project, ResponsibilityEntry.RemoveMethod.MANUALLY);
    TestNameResponsibilityEntryImpl fixedEntry = new TestNameResponsibilityEntryImpl(new TestName("bbb_fixed"), fixedNameId, ResponsibilityEntry.State.FIXED, user, user, new Date(), "Please, fix", project, ResponsibilityEntry.RemoveMethod.MANUALLY);
    TestNameResponsibilityEntryImpl givenUpEntry = new TestNameResponsibilityEntryImpl(new TestName("ccc_given_up"), givenUpNameId, ResponsibilityEntry.State.GIVEN_UP, user, user, new Date(), "Please, fix", project, ResponsibilityEntry.RemoveMethod.MANUALLY);
    TestNameResponsibilityFacade testNameResponsibilityFacade = myFixture.getSingletonService(TestNameResponsibilityFacade.class);
    testNameResponsibilityFacade.setTestNameResponsibility(new TestName("aaa_active"), project.getProjectId(), activeEntry);
    testNameResponsibilityFacade.setTestNameResponsibility(new TestName("bbb_fixed"), project.getProjectId(), fixedEntry);
    testNameResponsibilityFacade.setTestNameResponsibility(new TestName("ccc_given_up"), project.getProjectId(), givenUpEntry);
    TestRunData activeRunData = t("aaa_active", Status.FAILURE, 1);
    TestRunData fixedRunData = t("bbb_fixed", Status.FAILURE, 2);
    TestRunData givenUpRunData = t("ccc_given_up", Status.FAILURE, 3);
    TestRunData noneRunData = t("ddd_none", Status.FAILURE, 4);
    check("currentlyFailing:true,currentlyInvestigated:true", TEST_MATCHER, activeRunData);
    check("currentlyFailing:true,currentlyInvestigated:false", TEST_MATCHER, fixedRunData, givenUpRunData, noneRunData);
    check("currentlyFailing:true,investigationState:active", TEST_MATCHER, activeRunData);
    check("currentlyFailing:true,investigationState:fixed", TEST_MATCHER, fixedRunData);
    check("currentlyFailing:true,investigationState:givenUp", TEST_MATCHER, givenUpRunData);
    check("currentlyFailing:true,investigationState:none", TEST_MATCHER, noneRunData);
    check("currentlyFailing:true", TEST_MATCHER, activeRunData, fixedRunData, givenUpRunData, noneRunData);
}
Also used : ProjectEx(jetbrains.buildServer.serverSide.impl.ProjectEx) TestName(jetbrains.buildServer.tests.TestName) TestNameResponsibilityFacade(jetbrains.buildServer.responsibility.TestNameResponsibilityFacade) SUser(jetbrains.buildServer.users.SUser) TestNameResponsibilityEntryImpl(jetbrains.buildServer.responsibility.impl.TestNameResponsibilityEntryImpl) BuildTypeImpl(jetbrains.buildServer.serverSide.impl.BuildTypeImpl) Date(java.util.Date) Test(org.testng.annotations.Test)

Aggregations

Date (java.util.Date)1 TestNameResponsibilityFacade (jetbrains.buildServer.responsibility.TestNameResponsibilityFacade)1 TestNameResponsibilityEntryImpl (jetbrains.buildServer.responsibility.impl.TestNameResponsibilityEntryImpl)1 BuildTypeImpl (jetbrains.buildServer.serverSide.impl.BuildTypeImpl)1 ProjectEx (jetbrains.buildServer.serverSide.impl.ProjectEx)1 TestName (jetbrains.buildServer.tests.TestName)1 SUser (jetbrains.buildServer.users.SUser)1 Test (org.testng.annotations.Test)1