예제 #1
0
 @Test
 public void createValidationRun() {
   // Prerequisites
   final ValidationStampSummary validationStamp = data.doCreateValidationStamp();
   final BuildSummary build = data.doCreateBuild(validationStamp.getBranch());
   // Creates a validation run
   ValidationRunSummary validationRun =
       data.asAdmin(
           new ControlClientCall<ValidationRunSummary>() {
             @Override
             public ValidationRunSummary onCall(ControlUIClient client) {
               return client.createValidationRun(
                   build.getBranch().getProject().getName(),
                   build.getBranch().getName(),
                   build.getName(),
                   validationStamp.getName(),
                   new ValidationRunCreationForm(
                       Status.PASSED, "Test validation run", PropertiesCreationForm.create()));
             }
           });
   // Checks
   assertNotNull(validationRun);
   assertEquals(
       build.getBranch().getProject().getName(),
       validationRun.getBuild().getBranch().getProject().getName());
   assertEquals(build.getBranch().getName(), validationRun.getBuild().getBranch().getName());
   assertEquals(build.getName(), validationRun.getBuild().getName());
   assertEquals(validationStamp.getName(), validationRun.getValidationStamp().getName());
   assertEquals(1, validationRun.getRunOrder());
   assertEquals(Status.PASSED, validationRun.getValidationRunStatus().getStatus());
 }
예제 #2
0
 @Test
 public void createPromotedRun() {
   // Prerequisites
   final PromotionLevelSummary promotionLevel = data.doCreatePromotionLevel();
   final BuildSummary build = data.doCreateBuild(promotionLevel.getBranch());
   // Controller user
   Account controller =
       data.doCreateUser(
           "it_cpr",
           "IT Create Promoted Run",
           "*****@*****.**",
           SecurityRoles.CONTROLLER,
           "builtin",
           "pwd");
   // Creates a promoted run
   PromotedRunSummary run =
       data.getClient()
           .asUser(
               "it_cpr",
               "pwd",
               new ControlClientCall<PromotedRunSummary>() {
                 @Override
                 public PromotedRunSummary onCall(ControlUIClient ui) {
                   return ui.createPromotedRun(
                       promotionLevel.getBranch().getProject().getName(),
                       promotionLevel.getBranch().getName(),
                       build.getName(),
                       promotionLevel.getName(),
                       new PromotedRunCreationForm(new DateTime(), "IT Create Promoted Run"));
                 }
               });
   // Checks
   assertNotNull(run);
   assertEquals(
       build.getBranch().getProject().getName(),
       run.getBuild().getBranch().getProject().getName());
   assertEquals(build.getBranch().getName(), run.getBuild().getBranch().getName());
   assertEquals(build.getName(), run.getBuild().getName());
   assertEquals(promotionLevel.getName(), run.getPromotionLevel().getName());
   assertEquals(controller.getFullName(), run.getSignature().getName());
 }
예제 #3
0
 @Test
 public void createBuild() {
   // Prerequisites
   final BranchSummary branch = data.doCreateBranch();
   // Creates a build
   final String buildName = data.uid("BLD");
   BuildSummary build =
       data.asAdmin(
           new ControlClientCall<BuildSummary>() {
             @Override
             public BuildSummary onCall(ControlUIClient client) {
               return client.createBuild(
                   branch.getProject().getName(),
                   branch.getName(),
                   new BuildCreationForm(
                       buildName, "Test build", PropertiesCreationForm.create()));
             }
           });
   // Checks
   assertNotNull(build);
   assertEquals(buildName, build.getName());
   assertEquals(branch.getName(), build.getBranch().getName());
   assertEquals(branch.getProject().getName(), build.getBranch().getProject().getName());
 }