Search in sources :

Example 1 with SQueuedBuild

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

the class ChangeStatusTest method testQueued.

public void testQueued() {
    final BuildTypeImpl buildConf = registerBuildType("buildConf1", "project");
    VcsRootInstance root1 = prepareSingleVscRoot(buildConf);
    SVcsModification m20 = myFixture.addModification(modification().in(root1).version("20").parentVersions("10"));
    SQueuedBuild queuedBuild = build().in(buildConf).onModifications(m20).addToQueue();
    ChangeStatus status = new ChangeStatus(myFixture.getChangeStatusProvider().getMergedChangeStatus(m20), Fields.ALL_NESTED, getBeanContext(myFixture));
    queuedBuild.removeFromQueue(myUser, "comment");
    assertEquals(0, (int) status.getFinished());
    assertEquals(0, (int) status.getSuccessful());
    assertEquals(0, (int) status.getFailed());
    assertEquals(0, (int) status.getPendingBuildTypes());
    assertEquals(1, (int) status.getQueuedBuildsCount());
}
Also used : SVcsModification(jetbrains.buildServer.vcs.SVcsModification) ChangeStatus(jetbrains.buildServer.server.rest.model.change.ChangeStatus) BuildTypeImpl(jetbrains.buildServer.serverSide.impl.BuildTypeImpl) SQueuedBuild(jetbrains.buildServer.serverSide.SQueuedBuild) VcsRootInstance(jetbrains.buildServer.vcs.VcsRootInstance)

Aggregations

ChangeStatus (jetbrains.buildServer.server.rest.model.change.ChangeStatus)1 SQueuedBuild (jetbrains.buildServer.serverSide.SQueuedBuild)1 BuildTypeImpl (jetbrains.buildServer.serverSide.impl.BuildTypeImpl)1 SVcsModification (jetbrains.buildServer.vcs.SVcsModification)1 VcsRootInstance (jetbrains.buildServer.vcs.VcsRootInstance)1