コード例 #1
0
 @Test
 public void testCanGenerateReportTrueWithNoChanges() {
   final List<String> changedFiles = Collections.emptyList();
   JacocoReportChangesMojo mojo =
       new JacocoReportChangesMojo() {
         public java.util.List<String> loadIncludes() throws MojoExecutionException {
           return changedFiles;
         };
       };
   assertTrue(mojo.canGenerateReport(true));
 }
コード例 #2
0
 @Test
 public void testCanGenerateReportWithChanges() {
   final List<String> changedFiles = Arrays.asList("a", "b", "c");
   JacocoReportChangesMojo mojo =
       new JacocoReportChangesMojo() {
         public java.util.List<String> loadIncludes() throws MojoExecutionException {
           return changedFiles;
         };
       };
   assertTrue(mojo.canGenerateReport(true));
 }
コード例 #3
0
 @Test
 public void testCanGenerateReportWithLoadError() {
   JacocoReportChangesMojo mojo =
       new JacocoReportChangesMojo() {
         public java.util.List<String> loadIncludes() throws MojoExecutionException {
           throw new MojoExecutionException("Test");
         };
       };
   mojo.setSkipGenerationWhenNoChangesFound(true);
   assertFalse(mojo.canGenerateReport(true));
 }
コード例 #4
0
 @Test
 public void testCanGenerateReportReturnsFalseWhenSuperReturnsFalse()
     throws MojoExecutionException {
   final List<String> changedFiles = Arrays.asList("a", "b", "c");
   JacocoReportChangesMojo mojo =
       new JacocoReportChangesMojo() {
         public java.util.List<String> loadIncludes() throws MojoExecutionException {
           return changedFiles;
         };
       };
   mojo.setJacocoSkip(true);
   mojo.injectDefaults();
   assertFalse(mojo.canGenerateReport());
 }