Esempio n. 1
0
 @Test
 public void shouldThrowExceptionIfPipelineDoesNotContainAnyBuildPlans() throws Exception {
   try {
     useConfig(ConfigFileFixture.STAGE_WITH_NO_JOBS);
     goConfigFileDao.load();
     fail("Should throw Exception about duplicated job name");
   } catch (Exception e) {
     assertThat(
         e.getMessage(),
         containsString(
             "The content of element 'jobs' is not complete. One of '{job}' is expected"));
   }
 }
Esempio n. 2
0
 @Test
 public void shouldThrowExceptionIfBuildPlansExistWithTheSameNameWithinAPipeline()
     throws Exception {
   try {
     useConfig(ConfigFileFixture.JOBS_WITH_SAME_NAME);
     goConfigFileDao.load();
     fail("Should throw Exception about duplicated job name");
   } catch (Exception e) {
     assertThat(
         e.getMessage(),
         containsString(
             "Duplicate unique value [unit] declared "
                 + "for identity constraint \"uniqueJob\" of element \"jobs\""));
   }
 }
Esempio n. 3
0
 @Test(expected = RuntimeException.class)
 public void shouldThrowExceptionIfMultiplePipelinesExistWithTheSameName() throws Exception {
   useConfig(ConfigFileFixture.PIPELINES_WITH_SAME_NAME);
   goConfigFileDao.load();
 }