Search in sources :

Example 6 with BuildPromotionEx

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

the class ProblemOccurrenceFinderTest method testBasic.

@Test
public void testBasic() throws Exception {
    final BuildTypeImpl buildType = registerBuildType("buildConf1", "project");
    final SFinishedBuild build10 = build().in(buildType).withProblem(createBuildProblem()).finish();
    checkExceptionOnItemSearch(BadRequestException.class, "No_match");
    checkExceptionOnItemsSearch(BadRequestException.class, "No_match");
    check("build:(id:" + build10.getBuildId() + ")", ((BuildPromotionEx) build10.getBuildPromotion()).getBuildProblems().get(0));
}
Also used : SFinishedBuild(jetbrains.buildServer.serverSide.SFinishedBuild) BuildPromotionEx(jetbrains.buildServer.serverSide.BuildPromotionEx) BuildTypeImpl(jetbrains.buildServer.serverSide.impl.BuildTypeImpl) Test(org.testng.annotations.Test)

Example 7 with BuildPromotionEx

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

the class ProblemOccurrenceFinderTest method testPaging.

@Test
public void testPaging() throws Exception {
    final BuildTypeImpl buildType = registerBuildType("buildConf1", "project");
    final BuildPromotionEx build10 = (BuildPromotionEx) build().in(buildType).withProblem(BuildProblemData.createBuildProblem("id1", "type1", "descr")).withProblem(BuildProblemData.createBuildProblem("id1", "type2", "descr")).withProblem(BuildProblemData.createBuildProblem("id1", "type3", "descr")).finish().getBuildPromotion();
    final BuildPromotionEx build15 = (BuildPromotionEx) build().in(buildType).finish().getBuildPromotion();
    final BuildPromotionEx build20 = (BuildPromotionEx) build().in(buildType).withProblem(BuildProblemData.createBuildProblem("id1", "type1", "descr")).finish().getBuildPromotion();
    final BuildPromotionEx build30 = (BuildPromotionEx) build().in(buildType).withProblem(BuildProblemData.createBuildProblem("id2", "type1", "descr")).withProblem(BuildProblemData.createBuildProblem("id1", "type2", "descr")).finish().getBuildPromotion();
    final BuildPromotionEx build40 = (BuildPromotionEx) build().in(buildType).withProblem(BuildProblemData.createBuildProblem("id1", "type2", "descr")).finish().getBuildPromotion();
    checkProblem("build:(item:(id:" + build10.getId() + "),item:(id:" + build30.getId() + "))", pd(1, "id1", "type1", build10.getId()), pd(2, "id1", "type2", build10.getId()), pd(3, "id1", "type3", build10.getId()), pd(4, "id2", "type1", build30.getId()), pd(2, "id1", "type2", build30.getId()));
    checkProblem("build:(item:(id:" + build10.getId() + "),item:(id:" + build30.getId() + ")),count:2", pd(1, "id1", "type1", build10.getId()), pd(2, "id1", "type2", build10.getId()));
    checkProblem("build:(item:(id:" + build10.getId() + "),item:(id:" + build30.getId() + ")),start:2,count:3", pd(3, "id1", "type3", build10.getId()), pd(4, "id2", "type1", build30.getId()), pd(2, "id1", "type2", build30.getId()));
}
Also used : BuildPromotionEx(jetbrains.buildServer.serverSide.BuildPromotionEx) BuildTypeImpl(jetbrains.buildServer.serverSide.impl.BuildTypeImpl) Test(org.testng.annotations.Test)

Aggregations

BuildPromotionEx (jetbrains.buildServer.serverSide.BuildPromotionEx)7 BuildTypeImpl (jetbrains.buildServer.serverSide.impl.BuildTypeImpl)6 Test (org.testng.annotations.Test)6 SFinishedBuild (jetbrains.buildServer.serverSide.SFinishedBuild)1 BuildArtifactHolder (jetbrains.buildServer.serverSide.artifacts.BuildArtifactHolder)1 BuildArtifacts (jetbrains.buildServer.serverSide.artifacts.BuildArtifacts)1 ArtifactsBrowserImpl (jetbrains.buildServer.web.artifacts.browser.ArtifactsBrowserImpl)1 NotNull (org.jetbrains.annotations.NotNull)1