├── .gitignore ├── cobertura-test-prep ├── pom.xml └── src │ ├── main │ └── java │ │ └── Circle.java │ └── test │ └── java │ └── CircleTest.java ├── config └── maven_checks.xml ├── doc ├── CoberturaDiagrams.pdf └── additionalMavenDocs.pdf ├── pom.xml └── src ├── it ├── check-failure │ ├── invoker.properties │ ├── pom.xml │ ├── src │ │ ├── main │ │ │ └── java │ │ │ │ └── Circle.java │ │ └── test │ │ │ └── java │ │ │ └── CircleTest.java │ └── verify.groovy ├── check-failure_no_halt │ ├── invoker.properties │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── Circle.java │ │ └── test │ │ └── java │ │ └── CircleTest.java ├── check-it │ ├── invoker.properties │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── codehaus │ │ │ └── mojo │ │ │ └── cobertura │ │ │ └── its │ │ │ └── App.java │ │ └── test │ │ └── java │ │ └── org │ │ └── codehaus │ │ └── mojo │ │ └── cobertura │ │ └── its │ │ └── AppTest.java ├── check-no_check_parameter │ ├── invoker.properties │ ├── pom.xml │ ├── src │ │ ├── main │ │ │ └── java │ │ │ │ └── Circle.java │ │ └── test │ │ │ └── java │ │ │ └── CircleTest.java │ └── verify.groovy ├── check-no_datafile │ ├── invoker.properties │ ├── pom.xml │ └── verify.groovy ├── check-pass │ ├── invoker.properties │ ├── pom.xml │ ├── src │ │ ├── main │ │ │ └── java │ │ │ │ └── Circle.java │ │ └── test │ │ │ └── java │ │ │ └── CircleTest.java │ └── verify.groovy ├── check-regex_failure │ ├── invoker.properties │ ├── pom.xml │ ├── src │ │ ├── main │ │ │ └── java │ │ │ │ └── Circle.java │ │ └── test │ │ │ └── java │ │ │ └── CircleTest.java │ └── verify.groovy ├── check-regex_pass │ ├── invoker.properties │ ├── pom.xml │ ├── src │ │ ├── main │ │ │ └── java │ │ │ │ └── Circle.java │ │ └── test │ │ │ └── java │ │ │ └── CircleTest.java │ └── verify.groovy ├── clean │ ├── invoker.properties │ ├── pom.xml │ ├── setup.groovy │ └── verify.groovy ├── fork-it │ ├── invoker.properties │ ├── pom.xml │ ├── src │ │ ├── main │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── codehaus │ │ │ │ └── mojo │ │ │ │ └── cobertura │ │ │ │ └── its │ │ │ │ └── App.java │ │ └── test │ │ │ └── java │ │ │ └── org │ │ │ └── codehaus │ │ │ └── mojo │ │ │ └── cobertura │ │ │ └── its │ │ │ ├── Common.java │ │ │ ├── Test1.java │ │ │ ├── Test2.java │ │ │ └── Test3.java │ └── verify.groovy ├── instrument-default │ ├── invoker.properties │ ├── pom.xml │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── Circle.java │ └── verify.groovy ├── instrument-instrumentation │ ├── invoker.properties │ ├── pom.xml │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── Circle.java │ └── verify.groovy ├── mcobertura-118 │ ├── invoker.properties │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── moc │ │ │ └── CoberturaTask.java │ │ └── resources │ │ └── test.properties ├── mcobertura-176 │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── net │ │ │ └── cobertura │ │ │ ├── GithubIssues.java │ │ │ └── SerializeAsNumber.java │ │ └── test │ │ └── java │ │ └── net │ │ └── cobertura │ │ └── GitHubIssueTest.java ├── mcobertura-189 │ ├── invoker.properties │ ├── pom.xml │ ├── src │ │ ├── main │ │ │ └── java │ │ │ │ └── Foo.java │ │ └── test │ │ │ └── java │ │ │ └── FooTestCase.java │ └── verify.groovy ├── mcobertura-26 │ ├── invoker.properties │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── moc │ │ └── CoberturaTask.java ├── mcobertura-52 │ ├── invoker.properties │ ├── pom.xml │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── org │ │ │ └── example │ │ │ └── MyFirstTest.java │ └── verify.groovy ├── mcobertura-65 │ ├── invoker.properties │ ├── pom.xml │ ├── proj1 │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── org │ │ │ └── codehaus │ │ │ └── mojo │ │ │ └── cobertura │ │ │ └── it │ │ │ └── Proj1Code.java │ ├── proj2 │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── codehaus │ │ │ │ └── mojo │ │ │ │ └── cobertura │ │ │ │ └── it │ │ │ │ └── Proj2Code.java │ │ │ └── test │ │ │ └── java │ │ │ └── org │ │ │ └── codehaus │ │ │ └── mojo │ │ │ └── cobertura │ │ │ └── it │ │ │ └── Proj2Test.java │ ├── src │ │ └── site │ │ │ └── site.xml │ └── verify.groovy ├── parentpom-it │ ├── childpom-it │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── codehaus │ │ │ │ └── mojo │ │ │ │ └── cobertura │ │ │ │ └── its │ │ │ │ └── App.java │ │ │ └── test │ │ │ └── java │ │ │ └── org │ │ │ └── codehaus │ │ │ └── mojo │ │ │ └── cobertura │ │ │ └── its │ │ │ └── AppTest.java │ ├── invoker.properties │ └── pom.xml ├── report-it │ ├── invoker.properties │ ├── pom.xml │ ├── src │ │ ├── main │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── codehaus │ │ │ │ └── mojo │ │ │ │ └── cobertura │ │ │ │ └── its │ │ │ │ └── App.java │ │ └── test │ │ │ └── java │ │ │ └── org │ │ │ └── codehaus │ │ │ └── mojo │ │ │ └── cobertura │ │ │ └── its │ │ │ └── AppTest.java │ └── verify.groovy └── settings.xml ├── main ├── java │ └── org │ │ └── codehaus │ │ └── mojo │ │ └── cobertura │ │ ├── AbstractCoberturaMojo.java │ │ ├── CoberturaCheckIntegrationTestMojo.java │ │ ├── CoberturaCheckMojo.java │ │ ├── CoberturaCleanMojo.java │ │ ├── CoberturaDatafileDumpMojo.java │ │ ├── CoberturaInstrumentMojo.java │ │ ├── CoberturaMojoUtils.java │ │ ├── CoberturaReportIntegrationTestMojo.java │ │ ├── CoberturaReportMojo.java │ │ ├── configuration │ │ ├── ConfigCheck.java │ │ ├── ConfigInstrumentation.java │ │ ├── MaxHeapSizeUtil.java │ │ └── Regex.java │ │ └── tasks │ │ ├── AbstractTask.java │ │ ├── CheckTask.java │ │ ├── CommandLineArguments.java │ │ ├── InstrumentTask.java │ │ └── ReportTask.java └── resources │ ├── META-INF │ └── maven │ │ └── lifecycle.xml │ ├── cobertura-plugin │ ├── log4j-debug.properties │ ├── log4j-error.properties │ └── log4j-info.properties │ ├── cobertura-report.properties │ ├── cobertura-report_de.properties │ ├── cobertura-report_en.properties │ └── cobertura-report_nl.properties ├── site ├── apt │ ├── examples │ │ └── report-formats.apt │ ├── index.apt.vm │ ├── instrumentingDeploymentArtifact.apt │ └── usage.apt.vm ├── fml │ └── faq.fml ├── resources │ └── sample-maven-shared-io-report │ │ ├── cobertura │ │ └── index.html │ │ ├── css │ │ ├── help.css │ │ ├── main.css │ │ ├── maven-base.css │ │ ├── maven-theme.css │ │ ├── print.css │ │ ├── sortabletable.css │ │ ├── source-viewer.css │ │ └── tooltip.css │ │ ├── frame-packages.html │ │ ├── frame-sourcefiles-org.apache.maven.shared.io.download.html │ │ ├── frame-sourcefiles-org.apache.maven.shared.io.location.html │ │ ├── frame-sourcefiles-org.apache.maven.shared.io.logging.html │ │ ├── frame-sourcefiles-org.apache.maven.shared.io.scan.html │ │ ├── frame-sourcefiles-org.apache.maven.shared.io.scan.mapping.html │ │ ├── frame-sourcefiles.html │ │ ├── frame-summary-org.apache.maven.shared.io.download.html │ │ ├── frame-summary-org.apache.maven.shared.io.location.html │ │ ├── frame-summary-org.apache.maven.shared.io.logging.html │ │ ├── frame-summary-org.apache.maven.shared.io.scan.html │ │ ├── frame-summary-org.apache.maven.shared.io.scan.mapping.html │ │ ├── frame-summary.html │ │ ├── help.html │ │ ├── images │ │ ├── add.gif │ │ ├── blank.png │ │ ├── collapsed.gif │ │ ├── downsimple.png │ │ ├── expanded.gif │ │ ├── external-classic.png │ │ ├── external.png │ │ ├── file.gif │ │ ├── fix.gif │ │ ├── folder-closed.gif │ │ ├── folder-open.gif │ │ ├── help_logo.gif │ │ ├── icon_alert.gif │ │ ├── icon_alertsml.gif │ │ ├── icon_arrowfolder1_sml.gif │ │ ├── icon_arrowfolder2_sml.gif │ │ ├── icon_arrowfolderclosed1_sml.gif │ │ ├── icon_arrowfolderopen2_sml.gif │ │ ├── icon_arrowmembers1_sml.gif │ │ ├── icon_arrowmembers2_sml.gif │ │ ├── icon_arrowusergroups1_sml.gif │ │ ├── icon_arrowusergroups2_sml.gif │ │ ├── icon_arrowwaste1_sml.gif │ │ ├── icon_arrowwaste2_sml.gif │ │ ├── icon_confirmsml.gif │ │ ├── icon_doc_lrg.gif │ │ ├── icon_doc_sml.gif │ │ ├── icon_error_lrg.gif │ │ ├── icon_error_sml.gif │ │ ├── icon_folder_lrg.gif │ │ ├── icon_folder_sml.gif │ │ ├── icon_help_lrg.gif │ │ ├── icon_help_sml.gif │ │ ├── icon_info_lrg.gif │ │ ├── icon_info_sml.gif │ │ ├── icon_infosml.gif │ │ ├── icon_members_lrg.gif │ │ ├── icon_members_sml.gif │ │ ├── icon_sortdown.gif │ │ ├── icon_sortleft.gif │ │ ├── icon_sortright.gif │ │ ├── icon_sortup.gif │ │ ├── icon_success_lrg.gif │ │ ├── icon_success_sml.gif │ │ ├── icon_usergroups_lrg.gif │ │ ├── icon_usergroups_sml.gif │ │ ├── icon_warning_lrg.gif │ │ ├── icon_warning_sml.gif │ │ ├── icon_waste_lrg.gif │ │ ├── icon_waste_sml.gif │ │ ├── logos │ │ │ └── maven-feather.png │ │ ├── newwindow-classic.png │ │ ├── newwindow.png │ │ ├── none.png │ │ ├── nw_maj.gif │ │ ├── nw_maj_hi.gif │ │ ├── nw_maj_rond.gif │ │ ├── nw_med.gif │ │ ├── nw_med_hi.gif │ │ ├── nw_med_rond.gif │ │ ├── nw_min.gif │ │ ├── nw_min_036.gif │ │ ├── nw_min_hi.gif │ │ ├── pdf.gif │ │ ├── poweredby_036.gif │ │ ├── product_logo.gif │ │ ├── remove.gif │ │ ├── se_maj_rond.gif │ │ ├── strich.gif │ │ ├── sw_maj_rond.gif │ │ ├── sw_med_rond.gif │ │ ├── sw_min.gif │ │ ├── update.gif │ │ └── upsimple.png │ │ ├── index.html │ │ ├── js │ │ ├── customsorttypes.js │ │ ├── popup.js │ │ ├── sortabletable.js │ │ └── stringbuilder.js │ │ ├── org.apache.maven.shared.io.download.DefaultDownloadManager.html │ │ ├── org.apache.maven.shared.io.download.DownloadFailedException.html │ │ ├── org.apache.maven.shared.io.download.DownloadManager.html │ │ ├── org.apache.maven.shared.io.location.ArtifactLocation.html │ │ ├── org.apache.maven.shared.io.location.ArtifactLocatorStrategy.html │ │ ├── org.apache.maven.shared.io.location.ClasspathResourceLocatorStrategy.html │ │ ├── org.apache.maven.shared.io.location.FileLocation.html │ │ ├── org.apache.maven.shared.io.location.FileLocatorStrategy.html │ │ ├── org.apache.maven.shared.io.location.Location.html │ │ ├── org.apache.maven.shared.io.location.Locator.html │ │ ├── org.apache.maven.shared.io.location.LocatorStrategy.html │ │ ├── org.apache.maven.shared.io.location.URLLocation.html │ │ ├── org.apache.maven.shared.io.location.URLLocatorStrategy.html │ │ ├── org.apache.maven.shared.io.logging.DefaultMessageHolder.html │ │ ├── org.apache.maven.shared.io.logging.MessageHolder.html │ │ ├── org.apache.maven.shared.io.logging.MessageLevels.html │ │ ├── org.apache.maven.shared.io.logging.MessageSink.html │ │ ├── org.apache.maven.shared.io.logging.MojoLogSink.html │ │ ├── org.apache.maven.shared.io.logging.MultiChannelMessageHolder.html │ │ ├── org.apache.maven.shared.io.logging.PlexusLoggerSink.html │ │ ├── org.apache.maven.shared.io.scan.AbstractResourceInclusionScanner.html │ │ ├── org.apache.maven.shared.io.scan.InclusionScanException.html │ │ ├── org.apache.maven.shared.io.scan.ResourceInclusionScanner.html │ │ ├── org.apache.maven.shared.io.scan.SimpleResourceInclusionScanner.html │ │ ├── org.apache.maven.shared.io.scan.StaleResourceScanner.html │ │ ├── org.apache.maven.shared.io.scan.mapping.SingleTargetMapping.html │ │ ├── org.apache.maven.shared.io.scan.mapping.SourceMapping.html │ │ └── org.apache.maven.shared.io.scan.mapping.SuffixMapping.html └── site.xml └── test ├── classes ├── Circle.class └── CircleTest.class ├── java └── org │ └── codehaus │ └── mojo │ └── cobertura │ ├── AbstractCoberturaTestCase.java │ ├── CoberturaInstrumentMojoTest.java │ ├── CoberturaReportMojoTest.java │ ├── configuration │ ├── ConfigCheckTest.java │ ├── ConfigInstrumentationTest.java │ └── MaxHeapSizeUtilTest.java │ ├── stubs │ ├── ArtifactStub.java │ ├── CheckMavenProjectStub.java │ ├── CleanMavenProjectStub.java │ ├── InstrumentMavenProjectStub.java │ ├── ReportEmptySrcMavenProjectStub.java │ └── ReportMavenProjectStub.java │ └── tasks │ ├── CheckTaskTest.java │ ├── InstrumentTaskTest.java │ └── ReportTaskTest.java ├── plugin-configs ├── check-halt-plugin-config.xml ├── instrument-instrumentation-plugin-config.xml ├── instrument-plugin-config.xml ├── report-empty-src-plugin-config.xml └── report-plugin-config.xml └── sources ├── check.ser └── report.ser /.gitignore: -------------------------------------------------------------------------------- 1 | # generated files 2 | bin/ 3 | build/ 4 | nbproject/ 5 | gen/ 6 | generated/ 7 | libs/ 8 | obj/ 9 | external/ 10 | target/ 11 | *.releaseBackup 12 | 13 | # Eclipse project files 14 | #.classpath 15 | #.metadata 16 | #.project 17 | .loadpath 18 | tmp/** 19 | tmp/**/* 20 | 21 | # Locally stored "Eclipse launch configurations" 22 | *.launch 23 | 24 | 25 | # IntelliJ project files 26 | *.iml 27 | *.ipr 28 | *.iws 29 | .idea/ 30 | 31 | *.suo 32 | 33 | # NetBeans project files 34 | nbactions.xml 35 | nb-configuration.xml 36 | 37 | # gradle files 38 | .gradle/ 39 | 40 | # Mac and emacs files 41 | .DS_Store 42 | *~ 43 | *.bak 44 | 45 | # ProGuard output 46 | proguard-mapping.txt 47 | proguard-seeds.txt 48 | proguard-usage.txt 49 | 50 | # generated files 51 | bin/ 52 | build/ 53 | nbproject/ 54 | gen/ 55 | generated/ 56 | libs/ 57 | obj/ 58 | external/ 59 | target/ 60 | integration/ 61 | *.releaseBackup 62 | -------------------------------------------------------------------------------- /cobertura-test-prep/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | 7 | 2.0.4 8 | 9 | 10 | org.codehaus.mojo.test 11 | cobertura-test-prep 12 | jar 13 | 1.0 14 | 15 | Test Prep Project for Maven Cobertura Plugin 16 | 17 | 2005 18 | 19 | 20 | 21 | carlos 22 | Carlos Sanchez 23 | carlos@apache.org 24 | 25 | Java Developer 26 | 27 | 28 | 29 | joakime 30 | Joakim Erdfelt 31 | joakim@erdfelt.net 32 | 33 | Java Developer 34 | 35 | -5 36 | 37 | 38 | 39 | 40 | 41 | junit 42 | junit 43 | 4.13.2 44 | test 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | org.apache.maven.plugins 53 | maven-surefire-plugin 54 | 2.3 55 | 56 | true 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | org.codehaus.mojo 68 | cobertura-maven-plugin 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /cobertura-test-prep/src/main/java/Circle.java: -------------------------------------------------------------------------------- 1 | public class Circle 2 | { 3 | private double radius; 4 | 5 | private int x, y; 6 | 7 | public Circle( int x, int y, double radius ) 8 | { 9 | this.x = x; 10 | this.y = y; 11 | this.radius = radius; 12 | } 13 | 14 | public int getX() 15 | { 16 | return x; 17 | } 18 | 19 | public int getY() 20 | { 21 | return y; 22 | } 23 | 24 | public double getRadius() 25 | { 26 | return radius; 27 | } 28 | 29 | public double getDiameter() 30 | { 31 | return radius * 2; 32 | } 33 | 34 | public double getArea() 35 | { 36 | return ( Math.PI * ( radius * radius ) ); 37 | } 38 | 39 | public double getCircumference() 40 | { 41 | return ( Math.PI * getDiameter() ); 42 | } 43 | } -------------------------------------------------------------------------------- /cobertura-test-prep/src/test/java/CircleTest.java: -------------------------------------------------------------------------------- 1 | import junit.framework.TestCase; 2 | 3 | public class CircleTest 4 | extends TestCase 5 | { 6 | private Circle circle; 7 | 8 | // Intentionally create bug here. 9 | public void setUp() 10 | { 11 | circle = new Circle( 2, 3, 2.5 ); 12 | } 13 | 14 | public void testX() 15 | { 16 | assertEquals( "Test X", 2, circle.getX() ); 17 | } 18 | 19 | public void testY() 20 | { 21 | assertEquals( "Test Y", 3, circle.getY() ); 22 | } 23 | 24 | public void testRadius() 25 | { 26 | assertEquals( "Test radius", 2.5, circle.getRadius(), 0.1 ); 27 | } 28 | 29 | public void testDiameter() 30 | { 31 | assertEquals( "Test Diameter", 5, circle.getDiameter(), 0.1 ); 32 | } 33 | 34 | public void tearDown() 35 | { 36 | circle = null; 37 | } 38 | } -------------------------------------------------------------------------------- /doc/CoberturaDiagrams.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/doc/CoberturaDiagrams.pdf -------------------------------------------------------------------------------- /doc/additionalMavenDocs.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/doc/additionalMavenDocs.pdf -------------------------------------------------------------------------------- /src/it/check-failure/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals=cobertura:check 2 | 3 | invoker.buildResult = failure -------------------------------------------------------------------------------- /src/it/check-failure/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | org.codehaus.mojo.cobertura.its 5 | check-failure 6 | 1.0-SNAPSHOT 7 | check-failure 8 | 9 | 10 | 11 | 12 | org.codehaus.mojo 13 | cobertura-maven-plugin 14 | @pom.version@ 15 | 16 | 17 | 100 18 | 100 19 | true 20 | 100 21 | 100 22 | 100 23 | 100 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | junit 33 | junit 34 | 4.13.2 35 | test 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /src/it/check-failure/src/main/java/Circle.java: -------------------------------------------------------------------------------- 1 | public class Circle 2 | { 3 | private double radius; 4 | 5 | private int x, y; 6 | 7 | public Circle( int x, int y, double radius ) 8 | { 9 | this.x = x; 10 | this.y = y; 11 | this.radius = radius; 12 | } 13 | 14 | public int getX() 15 | { 16 | return x; 17 | } 18 | 19 | public int getY() 20 | { 21 | return y; 22 | } 23 | 24 | public double getRadius() 25 | { 26 | return radius; 27 | } 28 | 29 | public double getDiameter() 30 | { 31 | return radius * 2; 32 | } 33 | 34 | public double getArea() 35 | { 36 | return ( Math.PI * ( radius * radius ) ); 37 | } 38 | 39 | public double getCircumference() 40 | { 41 | return ( Math.PI * getDiameter() ); 42 | } 43 | } -------------------------------------------------------------------------------- /src/it/check-failure/src/test/java/CircleTest.java: -------------------------------------------------------------------------------- 1 | import junit.framework.TestCase; 2 | 3 | public class CircleTest 4 | extends TestCase 5 | { 6 | private Circle circle; 7 | 8 | // Intentionally create bug here. 9 | public void setUp() 10 | { 11 | circle = new Circle( 2, 3, 2.5 ); 12 | } 13 | 14 | public void testX() 15 | { 16 | assertEquals( "Test X", 2, circle.getX() ); 17 | } 18 | 19 | public void testY() 20 | { 21 | assertEquals( "Test Y", 3, circle.getY() ); 22 | } 23 | 24 | public void testRadius() 25 | { 26 | assertEquals( "Test radius", 2.5, circle.getRadius(), 0.1 ); 27 | } 28 | 29 | public void testDiameter() 30 | { 31 | assertEquals( "Test Diameter", 5, circle.getDiameter(), 0.1 ); 32 | } 33 | 34 | public void tearDown() 35 | { 36 | circle = null; 37 | } 38 | } -------------------------------------------------------------------------------- /src/it/check-failure/verify.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | f1 = new File(basedir, 'build.log') 18 | assert f1.exists() 19 | assert f1.getText().contains('Circle failed coverage check.') 20 | assert f1.getText().contains(' failed coverage check.') 21 | assert f1.getText().contains('project failed coverage check.') 22 | assert f1.getText().contains('Coverage check failed. See messages above.') -------------------------------------------------------------------------------- /src/it/check-failure_no_halt/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals=cobertura:check -------------------------------------------------------------------------------- /src/it/check-failure_no_halt/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | org.codehaus.mojo.cobertura.its 5 | check-failure_no_halt 6 | 1.0-SNAPSHOT 7 | check-failure_no_halt 8 | 9 | 10 | 11 | junit 12 | junit 13 | 4.13.2 14 | test 15 | 16 | 17 | 18 | 19 | 20 | 21 | org.codehaus.mojo 22 | cobertura-maven-plugin 23 | @pom.version@ 24 | 25 | 26 | false 27 | 100 28 | 100 29 | 100 30 | 100 31 | 100 32 | 100 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /src/it/check-failure_no_halt/src/main/java/Circle.java: -------------------------------------------------------------------------------- 1 | public class Circle 2 | { 3 | private double radius; 4 | 5 | private int x, y; 6 | 7 | public Circle( int x, int y, double radius ) 8 | { 9 | this.x = x; 10 | this.y = y; 11 | this.radius = radius; 12 | } 13 | 14 | public int getX() 15 | { 16 | return x; 17 | } 18 | 19 | public int getY() 20 | { 21 | return y; 22 | } 23 | 24 | public double getRadius() 25 | { 26 | return radius; 27 | } 28 | 29 | public double getDiameter() 30 | { 31 | return radius * 2; 32 | } 33 | 34 | public double getArea() 35 | { 36 | return ( Math.PI * ( radius * radius ) ); 37 | } 38 | 39 | public double getCircumference() 40 | { 41 | return ( Math.PI * getDiameter() ); 42 | } 43 | } -------------------------------------------------------------------------------- /src/it/check-failure_no_halt/src/test/java/CircleTest.java: -------------------------------------------------------------------------------- 1 | import junit.framework.TestCase; 2 | 3 | public class CircleTest 4 | extends TestCase 5 | { 6 | private Circle circle; 7 | 8 | // Intentionally create bug here. 9 | public void setUp() 10 | { 11 | circle = new Circle( 2, 3, 2.5 ); 12 | } 13 | 14 | public void testX() 15 | { 16 | assertEquals( "Test X", 2, circle.getX() ); 17 | } 18 | 19 | public void testY() 20 | { 21 | assertEquals( "Test Y", 3, circle.getY() ); 22 | } 23 | 24 | public void testRadius() 25 | { 26 | assertEquals( "Test radius", 2.5, circle.getRadius(), 0.1 ); 27 | } 28 | 29 | public void testDiameter() 30 | { 31 | assertEquals( "Test Diameter", 5, circle.getDiameter(), 0.1 ); 32 | } 33 | 34 | public void tearDown() 35 | { 36 | circle = null; 37 | } 38 | } -------------------------------------------------------------------------------- /src/it/check-it/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals=clean verify 2 | 3 | invoker.buildResult = failure -------------------------------------------------------------------------------- /src/it/check-it/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | org.codehaus.mojo.cobertura.its 5 | simple-it-check 6 | jar 7 | 1.0-SNAPSHOT 8 | simple-it 9 | http://maven.apache.org 10 | 11 | 12 | junit 13 | junit 14 | 4.13.2 15 | test 16 | 17 | 18 | 19 | 20 | 21 | 22 | org.codehaus.mojo 23 | cobertura-maven-plugin 24 | @pom.version@ 25 | 26 | 27 | 28 | check 29 | 30 | 31 | 32 | 95 33 | 95 34 | true 35 | 95 36 | 95 37 | 85 38 | 85 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /src/it/check-it/src/main/java/org/codehaus/mojo/cobertura/its/App.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.mojo.cobertura.its; 2 | 3 | /** 4 | * Hello world! 5 | * 6 | */ 7 | public class App 8 | { 9 | 10 | public boolean foo() 11 | { 12 | System.out.println( " hello toto, in english hello foo" ); 13 | return true; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/it/check-it/src/test/java/org/codehaus/mojo/cobertura/its/AppTest.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.mojo.cobertura.its; 2 | 3 | import junit.framework.Test; 4 | import junit.framework.TestCase; 5 | import junit.framework.TestSuite; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class AppTest 11 | extends TestCase 12 | { 13 | /** 14 | * Create the test case 15 | * 16 | * @param testName name of the test case 17 | */ 18 | public AppTest( String testName ) 19 | { 20 | super( testName ); 21 | } 22 | 23 | /** 24 | * @return the suite of tests being tested 25 | */ 26 | public static Test suite() 27 | { 28 | return new TestSuite( AppTest.class ); 29 | } 30 | 31 | /** 32 | * Rigourous Test :-) 33 | */ 34 | public void testApp() 35 | { 36 | assertTrue( true ); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/it/check-no_check_parameter/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals=clean cobertura:check 2 | invoker.buildResult=failure -------------------------------------------------------------------------------- /src/it/check-no_check_parameter/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | org.codehaus.mojo.cobertura.its 5 | check-no_check_parameter 6 | 1.0-SNAPSHOT 7 | check-no_check_parameter 8 | 9 | 10 | 11 | 12 | org.codehaus.mojo 13 | cobertura-maven-plugin 14 | @pom.version@ 15 | 16 | 17 | 18 | 19 | 20 | 21 | junit 22 | junit 23 | 4.13.2 24 | test 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/it/check-no_check_parameter/src/main/java/Circle.java: -------------------------------------------------------------------------------- 1 | public class Circle 2 | { 3 | private double radius; 4 | 5 | private int x, y; 6 | 7 | public Circle( int x, int y, double radius ) 8 | { 9 | this.x = x; 10 | this.y = y; 11 | this.radius = radius; 12 | } 13 | 14 | public int getX() 15 | { 16 | return x; 17 | } 18 | 19 | public int getY() 20 | { 21 | return y; 22 | } 23 | 24 | public double getRadius() 25 | { 26 | return radius; 27 | } 28 | 29 | public double getDiameter() 30 | { 31 | return radius * 2; 32 | } 33 | 34 | public double getArea() 35 | { 36 | return ( Math.PI * ( radius * radius ) ); 37 | } 38 | 39 | public double getCircumference() 40 | { 41 | return ( Math.PI * getDiameter() ); 42 | } 43 | } -------------------------------------------------------------------------------- /src/it/check-no_check_parameter/src/test/java/CircleTest.java: -------------------------------------------------------------------------------- 1 | import junit.framework.TestCase; 2 | 3 | public class CircleTest 4 | extends TestCase 5 | { 6 | private Circle circle; 7 | 8 | // Intentionally create bug here. 9 | public void setUp() 10 | { 11 | circle = new Circle( 2, 3, 2.5 ); 12 | } 13 | 14 | public void testX() 15 | { 16 | assertEquals( "Test X", 2, circle.getX() ); 17 | } 18 | 19 | public void testY() 20 | { 21 | assertEquals( "Test Y", 3, circle.getY() ); 22 | } 23 | 24 | public void testRadius() 25 | { 26 | assertEquals( "Test radius", 2.5, circle.getRadius(), 0.1 ); 27 | } 28 | 29 | public void testDiameter() 30 | { 31 | assertEquals( "Test Diameter", 5, circle.getDiameter(), 0.1 ); 32 | } 33 | 34 | public void tearDown() 35 | { 36 | circle = null; 37 | } 38 | } -------------------------------------------------------------------------------- /src/it/check-no_check_parameter/verify.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | f1 = new File(basedir, 'build.log') 18 | assert f1.exists() 19 | assert f1.getText().contains('Caused by: org.apache.maven.plugin.PluginParameterException:') -------------------------------------------------------------------------------- /src/it/check-no_datafile/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals=cobertura:check 2 | invoker.debug=true -------------------------------------------------------------------------------- /src/it/check-no_datafile/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | org.codehaus.mojo.cobertura.its 5 | check-no_datafile 6 | 1.0-SNAPSHOT 7 | check-no_datafile 8 | 9 | 10 | 11 | 12 | org.codehaus.mojo 13 | cobertura-maven-plugin 14 | @pom.version@ 15 | 16 | 17 | 95 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/it/check-no_datafile/verify.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | f1 = new File(basedir, 'build.log') 18 | assert f1.exists() 19 | assert f1.getText().contains('Cannot perform check, instrumentation not performed - skipping.') -------------------------------------------------------------------------------- /src/it/check-pass/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals=cobertura:check -------------------------------------------------------------------------------- /src/it/check-pass/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | org.codehaus.mojo.cobertura.its 5 | check-pass 6 | 1.0-SNAPSHOT 7 | check-pass 8 | 9 | 10 | 11 | 12 | org.codehaus.mojo 13 | cobertura-maven-plugin 14 | @pom.version@ 15 | 16 | 17 | 90 18 | 80 19 | true 20 | 90 21 | 80 22 | 80 23 | 90 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | junit 33 | junit 34 | 4.13.2 35 | test 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /src/it/check-pass/src/main/java/Circle.java: -------------------------------------------------------------------------------- 1 | public class Circle 2 | { 3 | private double radius; 4 | 5 | private int x, y; 6 | 7 | public Circle( int x, int y, double radius ) 8 | { 9 | this.x = x; 10 | this.y = y; 11 | this.radius = radius; 12 | } 13 | 14 | public int getX() 15 | { 16 | return x; 17 | } 18 | 19 | public int getY() 20 | { 21 | return y; 22 | } 23 | 24 | public double getRadius() 25 | { 26 | return radius; 27 | } 28 | 29 | public double getDiameter() 30 | { 31 | return radius * 2; 32 | } 33 | 34 | public double getArea() 35 | { 36 | return ( Math.PI * ( radius * radius ) ); 37 | } 38 | 39 | public double getCircumference() 40 | { 41 | return ( Math.PI * getDiameter() ); 42 | } 43 | } -------------------------------------------------------------------------------- /src/it/check-pass/src/test/java/CircleTest.java: -------------------------------------------------------------------------------- 1 | import junit.framework.TestCase; 2 | 3 | public class CircleTest 4 | extends TestCase 5 | { 6 | private Circle circle; 7 | 8 | // Intentionally create bug here. 9 | public void setUp() 10 | { 11 | circle = new Circle( 2, 3, 2.5 ); 12 | } 13 | 14 | public void testX() 15 | { 16 | assertEquals( "Test X", 2, circle.getX() ); 17 | } 18 | 19 | public void testY() 20 | { 21 | assertEquals( "Test Y", 3, circle.getY() ); 22 | } 23 | 24 | public void testRadius() 25 | { 26 | assertEquals( "Test radius", 2.5, circle.getRadius(), 0.1 ); 27 | } 28 | 29 | public void testDiameter() 30 | { 31 | assertEquals( "Test Diameter", 5, circle.getDiameter(), 0.1 ); 32 | } 33 | 34 | public void tearDown() 35 | { 36 | circle = null; 37 | } 38 | } -------------------------------------------------------------------------------- /src/it/check-pass/verify.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | f1 = new File(basedir, 'build.log') 18 | assert f1.exists() 19 | assert f1.getText().contains('All checks passed.') -------------------------------------------------------------------------------- /src/it/check-regex_failure/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals=cobertura:check 2 | 3 | invoker.buildResult = failure -------------------------------------------------------------------------------- /src/it/check-regex_failure/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | org.codehaus.mojo.cobertura.its 5 | check-regex_failure 6 | 1.0-SNAPSHOT 7 | check-regex_failure 8 | 9 | 10 | 11 | junit 12 | junit 13 | 4.13.2 14 | test 15 | 16 | 17 | 18 | 19 | 20 | 21 | org.codehaus.mojo 22 | cobertura-maven-plugin 23 | @pom.version@ 24 | 25 | 26 | 50 27 | 50 28 | true 29 | 50 30 | 50 31 | 50 32 | 50 33 | 34 | 35 | Circle* 36 | 100 37 | 100 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /src/it/check-regex_failure/src/main/java/Circle.java: -------------------------------------------------------------------------------- 1 | public class Circle 2 | { 3 | private double radius; 4 | 5 | private int x, y; 6 | 7 | public Circle( int x, int y, double radius ) 8 | { 9 | this.x = x; 10 | this.y = y; 11 | this.radius = radius; 12 | } 13 | 14 | public int getX() 15 | { 16 | return x; 17 | } 18 | 19 | public int getY() 20 | { 21 | return y; 22 | } 23 | 24 | public double getRadius() 25 | { 26 | return radius; 27 | } 28 | 29 | public double getDiameter() 30 | { 31 | return radius * 2; 32 | } 33 | 34 | public double getArea() 35 | { 36 | return ( Math.PI * ( radius * radius ) ); 37 | } 38 | 39 | public double getCircumference() 40 | { 41 | return ( Math.PI * getDiameter() ); 42 | } 43 | } -------------------------------------------------------------------------------- /src/it/check-regex_failure/src/test/java/CircleTest.java: -------------------------------------------------------------------------------- 1 | import junit.framework.TestCase; 2 | 3 | public class CircleTest 4 | extends TestCase 5 | { 6 | private Circle circle; 7 | 8 | // Intentionally create bug here. 9 | public void setUp() 10 | { 11 | circle = new Circle( 2, 3, 2.5 ); 12 | } 13 | 14 | public void testX() 15 | { 16 | assertEquals( "Test X", 2, circle.getX() ); 17 | } 18 | 19 | public void testY() 20 | { 21 | assertEquals( "Test Y", 3, circle.getY() ); 22 | } 23 | 24 | public void testRadius() 25 | { 26 | assertEquals( "Test radius", 2.5, circle.getRadius(), 0.1 ); 27 | } 28 | 29 | public void testDiameter() 30 | { 31 | assertEquals( "Test Diameter", 5, circle.getDiameter(), 0.1 ); 32 | } 33 | 34 | public void tearDown() 35 | { 36 | circle = null; 37 | } 38 | } -------------------------------------------------------------------------------- /src/it/check-regex_failure/verify.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | f1 = new File(basedir, 'build.log') 18 | assert f1.exists() 19 | assert f1.getText().contains('Circle failed coverage check.') 20 | assert f1.getText().contains('Coverage check failed. See messages above.') -------------------------------------------------------------------------------- /src/it/check-regex_pass/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals=cobertura:check -------------------------------------------------------------------------------- /src/it/check-regex_pass/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | org.codehaus.mojo.cobertura.its 5 | check-regex_pass 6 | 1.0-SNAPSHOT 7 | check-regex_pass 8 | 9 | 10 | 11 | junit 12 | junit 13 | 4.13.2 14 | test 15 | 16 | 17 | 18 | 19 | 20 | 21 | org.codehaus.mojo 22 | cobertura-maven-plugin 23 | @pom.version@ 24 | 25 | 26 | 50 27 | 50 28 | true 29 | 50 30 | 50 31 | 50 32 | 50 33 | 34 | 35 | Circle* 36 | 90 37 | 80 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /src/it/check-regex_pass/src/main/java/Circle.java: -------------------------------------------------------------------------------- 1 | public class Circle 2 | { 3 | private double radius; 4 | 5 | private int x, y; 6 | 7 | public Circle( int x, int y, double radius ) 8 | { 9 | this.x = x; 10 | this.y = y; 11 | this.radius = radius; 12 | } 13 | 14 | public int getX() 15 | { 16 | return x; 17 | } 18 | 19 | public int getY() 20 | { 21 | return y; 22 | } 23 | 24 | public double getRadius() 25 | { 26 | return radius; 27 | } 28 | 29 | public double getDiameter() 30 | { 31 | return radius * 2; 32 | } 33 | 34 | public double getArea() 35 | { 36 | return ( Math.PI * ( radius * radius ) ); 37 | } 38 | 39 | public double getCircumference() 40 | { 41 | return ( Math.PI * getDiameter() ); 42 | } 43 | } -------------------------------------------------------------------------------- /src/it/check-regex_pass/src/test/java/CircleTest.java: -------------------------------------------------------------------------------- 1 | import junit.framework.TestCase; 2 | 3 | public class CircleTest 4 | extends TestCase 5 | { 6 | private Circle circle; 7 | 8 | // Intentionally create bug here. 9 | public void setUp() 10 | { 11 | circle = new Circle( 2, 3, 2.5 ); 12 | } 13 | 14 | public void testX() 15 | { 16 | assertEquals( "Test X", 2, circle.getX() ); 17 | } 18 | 19 | public void testY() 20 | { 21 | assertEquals( "Test Y", 3, circle.getY() ); 22 | } 23 | 24 | public void testRadius() 25 | { 26 | assertEquals( "Test radius", 2.5, circle.getRadius(), 0.1 ); 27 | } 28 | 29 | public void testDiameter() 30 | { 31 | assertEquals( "Test Diameter", 5, circle.getDiameter(), 0.1 ); 32 | } 33 | 34 | public void tearDown() 35 | { 36 | circle = null; 37 | } 38 | } -------------------------------------------------------------------------------- /src/it/check-regex_pass/verify.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | f1 = new File(basedir, 'build.log') 18 | assert f1.exists() 19 | assert f1.getText().contains('All checks passed.') -------------------------------------------------------------------------------- /src/it/clean/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals=cobertura:clean -------------------------------------------------------------------------------- /src/it/clean/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | org.codehaus.mojo.cobertura.its 5 | clean 6 | 1.0-SNAPSHOT 7 | clean 8 | 9 | 10 | 11 | 12 | org.codehaus.mojo 13 | cobertura-maven-plugin 14 | @pom.version@ 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/it/clean/setup.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | //create dummy .ser file, ready to be deleted 17 | f1 = new File(basedir, 'target/cobertura/cobertura.ser') 18 | f1.parentFile.mkdirs() 19 | assert f1.createNewFile() -------------------------------------------------------------------------------- /src/it/clean/verify.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | f1 = new File(basedir, 'target/cobertura/cobertura.ser') 17 | assert !f1.exists() 18 | -------------------------------------------------------------------------------- /src/it/fork-it/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals=clean verify 2 | invoker.buildResult = success -------------------------------------------------------------------------------- /src/it/fork-it/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | org.codehaus.mojo.cobertura.its 5 | fork-it-check 6 | jar 7 | 1.0-SNAPSHOT 8 | fork-it 9 | http://maven.apache.org 10 | 11 | 12 | junit 13 | junit 14 | 4.13.2 15 | test 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | org.apache.maven.plugins 24 | maven-surefire-plugin 25 | 26 | always 27 | 28 | 29 | 30 | 31 | 32 | 33 | org.codehaus.mojo 34 | cobertura-maven-plugin 35 | @pom.version@ 36 | 37 | 38 | 39 | check 40 | 41 | 42 | 43 | 95 44 | 95 45 | true 46 | 95 47 | 95 48 | 85 49 | 85 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /src/it/fork-it/src/main/java/org/codehaus/mojo/cobertura/its/App.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.mojo.cobertura.its; 2 | 3 | /** 4 | * Hello world! 5 | * 6 | */ 7 | public class App 8 | { 9 | 10 | public boolean foo() 11 | { 12 | System.out.println( " hello toto, in english hello foo" ); 13 | return true; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/it/fork-it/src/test/java/org/codehaus/mojo/cobertura/its/Common.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.codehaus.mojo.cobertura.its; 18 | 19 | import java.io.File; 20 | import java.io.FileWriter; 21 | import java.io.IOException; 22 | import java.lang.management.ManagementFactory; 23 | 24 | import junit.framework.TestCase; 25 | 26 | /** 27 | * 28 | */ 29 | public class Common extends TestCase { 30 | public void setUp() throws IOException 31 | { 32 | String fileName = getClass().getName() + "-pid"; 33 | File target = new File("target"); 34 | if (! (target.exists() && target.isDirectory()) ) { 35 | target = new File ("."); 36 | } 37 | File pidFile = new File(target, fileName); 38 | FileWriter fw = new FileWriter(pidFile); 39 | // DGF little known trick... this is guaranteed to be unique to the PID 40 | // In fact, it usually contains the pid and the local host name! 41 | String pid = ManagementFactory.getRuntimeMXBean().getName(); 42 | fw.write( pid ); 43 | fw.flush(); 44 | fw.close(); 45 | } 46 | 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/it/fork-it/src/test/java/org/codehaus/mojo/cobertura/its/Test1.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.codehaus.mojo.cobertura.its; 18 | 19 | /** 20 | * the point of this is to run the before method. 21 | */ 22 | public class Test1 extends Common { 23 | 24 | public void testFoo1() { 25 | App a = new App(); 26 | a.foo(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/it/fork-it/src/test/java/org/codehaus/mojo/cobertura/its/Test2.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.codehaus.mojo.cobertura.its; 17 | 18 | /** 19 | * the point of this is to run the before method. 20 | */ 21 | public class Test2 extends Common { 22 | 23 | public void testFoo2() { 24 | App a = new App(); 25 | a.foo(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/it/fork-it/src/test/java/org/codehaus/mojo/cobertura/its/Test3.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.codehaus.mojo.cobertura.its; 18 | 19 | /** 20 | * the point of this is to run the before method. 21 | */ 22 | public class Test3 extends Common { 23 | 24 | public void testFoo3() { 25 | App a = new App(); 26 | a.foo(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/it/fork-it/verify.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | f1 = new File(basedir, 'target/org.codehaus.mojo.cobertura.its.Test1-pid'); 21 | assert f1.exists(); 22 | f2 = new File(basedir, 'target/org.codehaus.mojo.cobertura.its.Test2-pid'); 23 | assert f2.exists(); 24 | f3 = new File(basedir, 'target/org.codehaus.mojo.cobertura.its.Test3-pid'); 25 | assert f3.exists(); 26 | assert f1.getText() != f2.getText(); 27 | assert f1.getText() != f3.getText(); 28 | assert f2.getText() != f3.getText(); 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/it/instrument-default/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals=clean compile cobertura:instrument -------------------------------------------------------------------------------- /src/it/instrument-default/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | org.codehaus.mojo.cobertura.its 5 | instrument-default 6 | 1.0-SNAPSHOT 7 | instrument-default 8 | 9 | 10 | 11 | junit 12 | junit 13 | 4.13.2 14 | test 15 | 16 | 17 | 18 | 19 | 20 | 21 | org.codehaus.mojo 22 | cobertura-maven-plugin 23 | @pom.version@ 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/it/instrument-default/src/main/java/Circle.java: -------------------------------------------------------------------------------- 1 | public class Circle 2 | { 3 | private double radius; 4 | 5 | private int x, y; 6 | 7 | public Circle( int x, int y, double radius ) 8 | { 9 | this.x = x; 10 | this.y = y; 11 | this.radius = radius; 12 | } 13 | 14 | public int getX() 15 | { 16 | return x; 17 | } 18 | 19 | public int getY() 20 | { 21 | return y; 22 | } 23 | 24 | public double getRadius() 25 | { 26 | return radius; 27 | } 28 | 29 | public double getDiameter() 30 | { 31 | return radius * 2; 32 | } 33 | 34 | public double getArea() 35 | { 36 | return ( Math.PI * ( radius * radius ) ); 37 | } 38 | 39 | public double getCircumference() 40 | { 41 | return ( Math.PI * getDiameter() ); 42 | } 43 | } -------------------------------------------------------------------------------- /src/it/instrument-default/verify.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | f1 = new File(basedir, 'target/generated-classes/cobertura/Circle.class') 18 | assert f1.exists() -------------------------------------------------------------------------------- /src/it/instrument-instrumentation/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals=clean compile cobertura:instrument -------------------------------------------------------------------------------- /src/it/instrument-instrumentation/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | org.codehaus.mojo.cobertura.its 5 | instrument-instrumentation 6 | 1.0-SNAPSHOT 7 | instrument-instrumentation 8 | 9 | 10 | 11 | junit 12 | junit 13 | 4.13.2 14 | test 15 | 16 | 17 | 18 | 19 | 20 | 21 | org.codehaus.mojo 22 | cobertura-maven-plugin 23 | @pom.version@ 24 | 25 | 26 | 27 | **/*Circle.class 28 | **/*Shape.class 29 | 30 | 31 | **/*Square.class 32 | **/*NoEdge.class 33 | 34 | 35 | **/*.java 36 | **/*.xml 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /src/it/instrument-instrumentation/src/main/java/Circle.java: -------------------------------------------------------------------------------- 1 | public class Circle 2 | { 3 | private double radius; 4 | 5 | private int x, y; 6 | 7 | public Circle( int x, int y, double radius ) 8 | { 9 | this.x = x; 10 | this.y = y; 11 | this.radius = radius; 12 | } 13 | 14 | public int getX() 15 | { 16 | return x; 17 | } 18 | 19 | public int getY() 20 | { 21 | return y; 22 | } 23 | 24 | public double getRadius() 25 | { 26 | return radius; 27 | } 28 | 29 | public double getDiameter() 30 | { 31 | return radius * 2; 32 | } 33 | 34 | public double getArea() 35 | { 36 | return ( Math.PI * ( radius * radius ) ); 37 | } 38 | 39 | public double getCircumference() 40 | { 41 | return ( Math.PI * getDiameter() ); 42 | } 43 | } -------------------------------------------------------------------------------- /src/it/instrument-instrumentation/verify.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | f1 = new File(basedir, 'target/generated-classes/cobertura/Circle.class') 18 | assert f1.exists() -------------------------------------------------------------------------------- /src/it/mcobertura-118/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals=clean process-classes -------------------------------------------------------------------------------- /src/it/mcobertura-118/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | org.codehaus.mojo.cobertura-maven-plugin.test 5 | mcobertura-118 6 | 0.0.1-SNAPSHOT 7 | 8 | c:\hello\sailor 9 | 10 | 11 | 12 | 13 | src/main/resources 14 | true 15 | 16 | 17 | 18 | 19 | org.codehaus.mojo 20 | cobertura-maven-plugin 21 | @pom.version@ 22 | 23 | 24 | process-classes 25 | 26 | instrument 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/it/mcobertura-118/src/main/java/moc/CoberturaTask.java: -------------------------------------------------------------------------------- 1 | package moc; 2 | 3 | public class CoberturaTask 4 | { 5 | 6 | /** 7 | * @param args 8 | */ 9 | public static void main( String[] args ) 10 | { 11 | CoberturaTask task = new CoberturaTask(); 12 | task.doGreet(); 13 | } 14 | 15 | protected String doGreet() 16 | { 17 | if ( Math.random() > 0.5 ) 18 | { 19 | return "Hello"; 20 | } 21 | else 22 | { 23 | return "Goodbye"; 24 | } 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/it/mcobertura-118/src/main/resources/test.properties: -------------------------------------------------------------------------------- 1 | test.property=${test.property} 2 | -------------------------------------------------------------------------------- /src/it/mcobertura-176/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | net.cobertura 5 | bugtest 6 | 0.0.1-SNAPSHOT 7 | 8 | 9 | junit 10 | junit 11 | 4.13.2 12 | 13 | 14 | 15 | 16 | 17 | 18 | org.codehaus.mojo 19 | cobertura-maven-plugin 20 | @pom.version@ 21 | 22 | 23 | true 24 | 25 | java.beans.Transient 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/it/mcobertura-176/src/main/java/net/cobertura/GithubIssues.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2013 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package net.cobertura; 18 | 19 | import java.beans.Transient; 20 | import java.lang.reflect.Field; 21 | 22 | public class GithubIssues { 23 | boolean test; 24 | 25 | public boolean createBoundField(final Field field) { 26 | Class primitive = boolean.class; 27 | if (((primitive).equals(field.getType()) || (Boolean.class).equals(field.getType())) && field.getAnnotation(SerializeAsNumber.class) != null) { 28 | return true; 29 | } 30 | return false; 31 | } 32 | 33 | @Transient 34 | public void noTestAnnoation() { 35 | if (test) { 36 | System.out.print("test"); 37 | } else { 38 | System.out.print("test2"); 39 | } 40 | } 41 | 42 | public boolean isTest() { 43 | return test; 44 | } 45 | 46 | public void setTest(boolean test) { 47 | this.test = test; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/it/mcobertura-176/src/main/java/net/cobertura/SerializeAsNumber.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2013 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package net.cobertura; 18 | 19 | import java.lang.annotation.Documented; 20 | import java.lang.annotation.ElementType; 21 | import java.lang.annotation.Inherited; 22 | import java.lang.annotation.Retention; 23 | import java.lang.annotation.RetentionPolicy; 24 | import java.lang.annotation.Target; 25 | 26 | /** 27 | * Annotation used on boolean field to serialize as number ('0','1') not as 28 | * (false,true) 29 | * 30 | * @author David Ignjic 31 | * 32 | */ 33 | @Retention(RetentionPolicy.RUNTIME) 34 | @Target({ ElementType.FIELD }) 35 | @Inherited() 36 | @Documented 37 | public @interface SerializeAsNumber { 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/it/mcobertura-176/src/test/java/net/cobertura/GitHubIssueTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2013 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package net.cobertura; 18 | 19 | import static org.junit.Assert.assertEquals; 20 | 21 | import java.lang.reflect.Field; 22 | 23 | import org.junit.Before; 24 | import org.junit.Test; 25 | 26 | public class GitHubIssueTest { 27 | 28 | public static class TestBoolean { 29 | @SerializeAsNumber 30 | boolean boss; 31 | 32 | Boolean no; 33 | 34 | Integer in; 35 | 36 | public boolean isBoss() { 37 | return boss; 38 | } 39 | 40 | public void setBoss(boolean boss) { 41 | this.boss = boss; 42 | } 43 | 44 | public Boolean getNo() { 45 | return no; 46 | } 47 | 48 | public void setNo(Boolean no) { 49 | this.no = no; 50 | } 51 | 52 | public Integer getIn() { 53 | return in; 54 | } 55 | 56 | public void setIn(Integer in) { 57 | this.in = in; 58 | } 59 | 60 | } 61 | @Before 62 | public void setUp() throws Exception { 63 | } 64 | 65 | @Test 66 | public void test() { 67 | GithubIssues test = new GithubIssues(); 68 | for (Field field : TestBoolean.class.getDeclaredFields()) { 69 | if ("boss".equals(field.getName())) { 70 | assertEquals(true, test.createBoundField(field)); 71 | } else { 72 | assertEquals(false, test.createBoundField(field)); 73 | } 74 | } 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /src/it/mcobertura-189/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals = clean cobertura:cobertura 2 | invoker.java.version = 1.8+ 3 | -------------------------------------------------------------------------------- /src/it/mcobertura-189/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | org.codehaus.mojo.cobertura.its 5 | cobertura-189 6 | 1.0-SNAPSHOT 7 | 8 | 9 | 10 | org.codehaus.mojo 11 | cobertura-maven-plugin 12 | @project.version@ 13 | 14 | 15 | 16 | 17 | 18 | 19 | org.codehaus.mojo 20 | cobertura-maven-plugin 21 | @project.version@ 22 | 23 | 24 | 25 | 26 | 1.8 27 | 1.8 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/it/mcobertura-189/src/main/java/Foo.java: -------------------------------------------------------------------------------- 1 | import java.util.Arrays; 2 | import java.util.List; 3 | 4 | public class Foo { 5 | private final List list = Arrays.asList("A", "B", "C"); 6 | 7 | public void bar() { 8 | list.stream().forEach(x -> System.out.println(x)); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/it/mcobertura-189/src/test/java/FooTestCase.java: -------------------------------------------------------------------------------- 1 | import org.junit.Test; 2 | 3 | public class FooTestCase { 4 | @Test 5 | public void testBar() { 6 | new Foo().bar(); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/it/mcobertura-189/verify.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | buildLog = new File( basedir, 'build.log' ) 18 | assert buildLog.exists() 19 | assert buildLog.getText().contains( "[INFO] Cobertura Report generation was successful." ) 20 | -------------------------------------------------------------------------------- /src/it/mcobertura-26/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals=clean process-classes -------------------------------------------------------------------------------- /src/it/mcobertura-26/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | org.codehaus.mojo.cobertura-maven-plugin.test 5 | mcobertura-26 6 | 0.0.1-SNAPSHOT 7 | 8 | 9 | 10 | 11 | 12 | org.codehaus.mojo 13 | cobertura-maven-plugin 14 | @pom.version@ 15 | 16 | 17 | process-classes 18 | 19 | instrument 20 | 21 | 22 | 23 | 24 | 25 | org.apache.maven.plugins 26 | maven-antrun-plugin 27 | 1.4 28 | 29 | 30 | process-classes 31 | 32 | run 33 | 34 | 35 | 36 | ${project.build.outputDirectory} 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /src/it/mcobertura-26/src/main/java/moc/CoberturaTask.java: -------------------------------------------------------------------------------- 1 | package moc; 2 | 3 | public class CoberturaTask 4 | { 5 | 6 | /** 7 | * @param args 8 | */ 9 | public static void main( String[] args ) 10 | { 11 | CoberturaTask task = new CoberturaTask(); 12 | task.doGreet(); 13 | } 14 | 15 | protected String doGreet() 16 | { 17 | if ( Math.random() > 0.5 ) 18 | { 19 | return "Hello"; 20 | } 21 | else 22 | { 23 | return "Goodbye"; 24 | } 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/it/mcobertura-52/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals = clean cobertura:cobertura -------------------------------------------------------------------------------- /src/it/mcobertura-52/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | org.codehaus.mojo.cobertura.its 6 | cobertura-52 7 | 1.0-SNAPSHOT 8 | 9 | 10 | 11 | 12 | org.apache.maven.plugins 13 | maven-site-plugin 14 | 3.0 15 | 16 | 17 | 18 | 19 | 20 | org.codehaus.mojo 21 | cobertura-maven-plugin 22 | @project.version@ 23 | 24 | 25 | 26 | org/example/**/*Test.class 27 | ${basedir} 28 | 29 | 30 | 31 | false 32 | 33 | 34 | 35 | 36 | 37 | clean 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | org.apache.maven.plugins 48 | maven-project-info-reports-plugin 49 | 2.3.1 50 | 51 | false 52 | false 53 | 54 | 55 | 56 | org.codehaus.mojo 57 | cobertura-maven-plugin 58 | @project.version@ 59 | 60 | 61 | xml 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /src/it/mcobertura-52/src/main/java/org/example/MyFirstTest.java: -------------------------------------------------------------------------------- 1 | package org.example; 2 | 3 | public class MyFirstTest 4 | { 5 | } -------------------------------------------------------------------------------- /src/it/mcobertura-52/verify.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | buildLog = new File( basedir, 'build.log' ) 18 | assert buildLog.exists() 19 | assert buildLog.getText().contains( "[WARNING] No files to instrument." ) -------------------------------------------------------------------------------- /src/it/mcobertura-65/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals = cobertura:cobertura site -------------------------------------------------------------------------------- /src/it/mcobertura-65/proj1/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | org.codehaus.mojo.cobertura.its 5 | agg-report-it-proj1 6 | jar 7 | 2.5-SNAPSHOT 8 | agg-report-it-proj1 9 | 10 | org.codehaus.mojo.cobertura.its 11 | agg-report-it 12 | 2.5-SNAPSHOT 13 | 14 | 15 | 16 | junit 17 | junit 18 | 4.13.2 19 | test 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/it/mcobertura-65/proj1/src/main/java/org/codehaus/mojo/cobertura/it/Proj1Code.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.codehaus.mojo.cobertura.it; 21 | 22 | public class Proj1Code { 23 | 24 | private String str; 25 | 26 | public Proj1Code() { 27 | // 28 | } 29 | 30 | public void setStr(String str) { 31 | this.str = str; 32 | } 33 | 34 | public String getStr() { 35 | return str; 36 | } 37 | 38 | public String toString() { 39 | return super.toString() + " {} " + str; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/it/mcobertura-65/proj2/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | org.codehaus.mojo.cobertura.its 5 | agg-report-it-proj2 6 | jar 7 | 2.5-SNAPSHOT 8 | agg-report-it-proj2 9 | 10 | org.codehaus.mojo.cobertura.its 11 | agg-report-it 12 | 2.5-SNAPSHOT 13 | 14 | 15 | 16 | 17 | junit 18 | junit 19 | 4.13.2 20 | test 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/it/mcobertura-65/proj2/src/main/java/org/codehaus/mojo/cobertura/it/Proj2Code.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.codehaus.mojo.cobertura.it; 21 | 22 | public class Proj2Code { 23 | 24 | private String str; 25 | 26 | public Proj2Code() { 27 | // 28 | } 29 | 30 | public void setStr(String str) { 31 | this.str = str; 32 | } 33 | 34 | public String getStr() { 35 | return str; 36 | } 37 | 38 | public String toString() { 39 | return super.toString() + " {} " + str; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/it/mcobertura-65/proj2/src/test/java/org/codehaus/mojo/cobertura/it/Proj2Test.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.codehaus.mojo.cobertura.it; 21 | 22 | import junit.framework.TestCase; 23 | 24 | public class Proj2Test extends TestCase { 25 | 26 | public void testSomethingElse() { 27 | Proj2Code code = new Proj2Code(); 28 | code.setStr("Hello Sailor"); 29 | code.toString(); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/it/mcobertura-65/src/site/site.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ${project.name} 5 | 6 | 7 | 8 | org.apache.maven.skins 9 | maven-stylus-skin 10 | 1.2 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/it/mcobertura-65/verify.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | f1 = new File(basedir, 'target/site/cobertura/index.html'); 18 | assert f1.exists(); 19 | f2 = new File(basedir, 'target/site/license.html'); 20 | assert f2.exists(); 21 | 22 | -------------------------------------------------------------------------------- /src/it/parentpom-it/childpom-it/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | org.codehaus.mojo.cobertura.its 5 | childpom-it 6 | pom 7 | 1.0-SNAPSHOT 8 | childpom-it 9 | http://maven.apache.org 10 | 11 | 12 | org.codehaus.mojo.cobertura.its 13 | parentpom-it 14 | 1.0-SNAPSHOT 15 | 16 | 17 | 18 | This IT test checks if cobertura get's skipped on parent poms by default 19 | but will get executed properly for real jar producing poms. 20 | This is the child pom and thus the cobertura plugin muts get executed. 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/it/parentpom-it/childpom-it/src/main/java/org/codehaus/mojo/cobertura/its/App.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.mojo.cobertura.its; 2 | 3 | /** 4 | * Hello world! 5 | * 6 | */ 7 | public class App 8 | { 9 | 10 | public boolean foo() 11 | { 12 | System.out.println( " hello toto, in english hello foo" ); 13 | return true; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/it/parentpom-it/childpom-it/src/test/java/org/codehaus/mojo/cobertura/its/AppTest.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.mojo.cobertura.its; 2 | 3 | import junit.framework.Test; 4 | import junit.framework.TestCase; 5 | import junit.framework.TestSuite; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class AppTest 11 | extends TestCase 12 | { 13 | /** 14 | * Create the test case 15 | * 16 | * @param testName name of the test case 17 | */ 18 | public AppTest( String testName ) 19 | { 20 | super( testName ); 21 | } 22 | 23 | /** 24 | * @return the suite of tests being tested 25 | */ 26 | public static Test suite() 27 | { 28 | return new TestSuite( AppTest.class ); 29 | } 30 | 31 | /** 32 | * Rigourous Test :-) 33 | */ 34 | public void testApp() 35 | { 36 | assertTrue( true ); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/it/parentpom-it/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals = cobertura:cobertura -------------------------------------------------------------------------------- /src/it/parentpom-it/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | org.codehaus.mojo.cobertura.its 5 | parentpom-it 6 | pom 7 | 1.0-SNAPSHOT 8 | parentpom-it 9 | 10 | 11 | This IT test checks if cobertura get's skipped on parent poms by default 12 | but will get executed properly for real jar producing poms. 13 | 14 | 15 | 16 | 17 | junit 18 | junit 19 | 4.13.2 20 | test 21 | 22 | 23 | 24 | 25 | childpom-it 26 | 27 | 28 | 29 | 30 | 31 | org.codehaus.mojo 32 | cobertura-maven-plugin 33 | @pom.version@ 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /src/it/report-it/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals = cobertura:cobertura -------------------------------------------------------------------------------- /src/it/report-it/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | org.codehaus.mojo.cobertura.its 5 | simple-it 6 | jar 7 | 1.0-SNAPSHOT 8 | simple-it 9 | http://maven.apache.org 10 | 11 | 12 | junit 13 | junit 14 | 4.13.2 15 | test 16 | 17 | 18 | 19 | 20 | 21 | 22 | org.codehaus.mojo 23 | cobertura-maven-plugin 24 | @pom.version@ 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/it/report-it/src/main/java/org/codehaus/mojo/cobertura/its/App.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.mojo.cobertura.its; 2 | 3 | /** 4 | * Hello world! 5 | * 6 | */ 7 | public class App 8 | { 9 | 10 | public boolean toto() 11 | { 12 | System.out.println( " hello toto, in english hello foo" ); 13 | return true; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/it/report-it/src/test/java/org/codehaus/mojo/cobertura/its/AppTest.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.mojo.cobertura.its; 2 | 3 | import junit.framework.Test; 4 | import junit.framework.TestCase; 5 | import junit.framework.TestSuite; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class AppTest 11 | extends TestCase 12 | { 13 | /** 14 | * Create the test case 15 | * 16 | * @param testName name of the test case 17 | */ 18 | public AppTest( String testName ) 19 | { 20 | super( testName ); 21 | } 22 | 23 | /** 24 | * @return the suite of tests being tested 25 | */ 26 | public static Test suite() 27 | { 28 | return new TestSuite( AppTest.class ); 29 | } 30 | 31 | /** 32 | * Rigourous Test :-) 33 | */ 34 | public void testApp() 35 | { 36 | App app = new App(); 37 | assertTrue( app.toto() ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/it/report-it/verify.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | assert new File(basedir, 'target/classes').exists(); 20 | assert new File(basedir, 'target/test-classes').exists(); 21 | assert new File(basedir, 'target/cobertura/cobertura.ser').exists(); 22 | 23 | assert new File(basedir, 'target/site').exists(); 24 | assert new File(basedir, 'target/site/cobertura').exists(); 25 | assert new File(basedir, 'target/site/cobertura/images/upsimple.png').exists(); 26 | assert new File(basedir, 'target/site/cobertura/org.codehaus.mojo.cobertura.its.App.html').exists(); 27 | assert new File(basedir, 'target/site/cobertura/frame-sourcefiles-org.codehaus.mojo.cobertura.its.html').exists(); 28 | -------------------------------------------------------------------------------- /src/it/settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 23 | 24 | 25 | it-repo 26 | 27 | true 28 | 29 | 30 | 31 | local.central 32 | @localRepositoryUrl@ 33 | 34 | true 35 | 36 | 37 | true 38 | 39 | 40 | 41 | apache.snapshots 42 | Apache Snapshot Repository 43 | https://repository.apache.org/content/repositories/snapshots 44 | 45 | false 46 | 47 | 48 | true 49 | 50 | 51 | 52 | 53 | 54 | local.central 55 | @localRepositoryUrl@ 56 | 57 | true 58 | 59 | 60 | true 61 | 62 | 63 | 64 | apache.snapshots 65 | Apache Snapshot Repository 66 | https://repository.apache.org/content/repositories/snapshots 67 | 68 | false 69 | 70 | 71 | true 72 | 73 | 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /src/main/java/org/codehaus/mojo/cobertura/CoberturaCheckIntegrationTestMojo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * Mojo's Maven plugin for Cobertura 4 | * %% 5 | * Copyright (C) 2005 - 2013 Codehaus 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package org.codehaus.mojo.cobertura; 21 | 22 | /** 23 | * Check the coverage percentages for unit tests and integration tests from the 24 | * last instrumentation, and optionally fail the build if the targets are not 25 | * met. To fail the build you need to set 26 | * configuration/check/haltOnFailure=true in the plugin's 27 | * configuration. 28 | * 29 | * @author Dennis Lundberg 30 | * @goal check-integration-test 31 | * @execute phase="verify" lifecycle="cobertura" 32 | */ 33 | public class CoberturaCheckIntegrationTestMojo extends CoberturaCheckMojo 34 | { 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/codehaus/mojo/cobertura/CoberturaCheckMojo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * Mojo's Maven plugin for Cobertura 4 | * %% 5 | * Copyright (C) 2005 - 2013 Codehaus 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package org.codehaus.mojo.cobertura; 21 | 22 | import org.apache.maven.artifact.handler.ArtifactHandler; 23 | import org.apache.maven.plugin.MojoExecutionException; 24 | import org.apache.maven.plugin.MojoFailureException; 25 | import org.codehaus.mojo.cobertura.configuration.ConfigCheck; 26 | import org.codehaus.mojo.cobertura.tasks.CheckTask; 27 | 28 | /** 29 | * Check the coverage percentages for unit tests from the last instrumentation, 30 | * and optionally fail the build if the targets are not met. To fail the build 31 | * you need to set 32 | * configuration/check/haltOnFailure=true in the plugin's 33 | * configuration. 34 | * 35 | * @author Joakim Erdfelt 36 | * @goal check 37 | * @execute phase="test" lifecycle="cobertura" 38 | * @phase verify 39 | */ 40 | public class CoberturaCheckMojo 41 | extends AbstractCoberturaMojo 42 | { 43 | /** 44 | * The Check Configuration. 45 | * 46 | * @parameter 47 | * @required 48 | */ 49 | private ConfigCheck check; 50 | 51 | /** 52 | * {@inheritDoc} 53 | */ 54 | public void execute() 55 | throws MojoExecutionException, MojoFailureException 56 | { 57 | if ( skipMojo() ) 58 | { 59 | return; 60 | } 61 | 62 | ArtifactHandler artifactHandler = getProject().getArtifact().getArtifactHandler(); 63 | if ( !"java".equals( artifactHandler.getLanguage() ) ) 64 | { 65 | getLog().info( 66 | "Not executing cobertura:instrument as the project is not a Java classpath-capable package" ); 67 | } 68 | else 69 | { 70 | if ( !getDataFile().exists() ) 71 | { 72 | getLog().info( "Cannot perform check, instrumentation not performed - skipping." ); 73 | } 74 | else 75 | { 76 | CheckTask task = new CheckTask(); 77 | setTaskDefaults( task ); 78 | task.setConfig( check ); 79 | task.setDataFile( getDataFile().getAbsolutePath() ); 80 | 81 | task.execute(); 82 | } 83 | } 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /src/main/java/org/codehaus/mojo/cobertura/CoberturaCleanMojo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * Mojo's Maven plugin for Cobertura 4 | * %% 5 | * Copyright (C) 2005 - 2013 Codehaus 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package org.codehaus.mojo.cobertura; 21 | 22 | import org.apache.maven.plugin.MojoExecutionException; 23 | import org.apache.maven.plugin.MojoFailureException; 24 | 25 | /** 26 | * Clean up the files that Cobertura Maven Plugin has created during 27 | * instrumentation. 28 | * 29 | * @author Joakim Erdfelt 30 | * @goal clean 31 | * @phase clean 32 | */ 33 | public class CoberturaCleanMojo 34 | extends AbstractCoberturaMojo 35 | { 36 | /** 37 | * {@inheritDoc} 38 | */ 39 | public void execute() 40 | throws MojoExecutionException, MojoFailureException 41 | { 42 | if ( skipMojo() ) 43 | { 44 | return; 45 | } 46 | 47 | if ( getDataFile().exists() ) 48 | { 49 | getDataFile().delete(); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/org/codehaus/mojo/cobertura/CoberturaMojoUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * Mojo's Maven plugin for Cobertura 4 | * %% 5 | * Copyright (C) 2005 - 2013 Codehaus 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package org.codehaus.mojo.cobertura; 21 | 22 | import org.apache.maven.plugin.MojoExecution; 23 | 24 | import java.io.File; 25 | 26 | /** 27 | * Utility class which can be used by both build-plugins and reports 28 | * 29 | * @author Robert Scholte 30 | * @since 2.6 31 | */ 32 | public class CoberturaMojoUtils 33 | { 34 | 35 | private CoberturaMojoUtils() 36 | { 37 | } 38 | 39 | /** 40 | * @param buildDirectory the buildDirectory 41 | * @param execution the mojo-execution 42 | * @return the data file 43 | */ 44 | public static File getDataFile( File buildDirectory, MojoExecution execution ) 45 | { 46 | return new File( buildDirectory, "cobertura/cobertura.ser" ); 47 | } 48 | } -------------------------------------------------------------------------------- /src/main/java/org/codehaus/mojo/cobertura/CoberturaReportIntegrationTestMojo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * Mojo's Maven plugin for Cobertura 4 | * %% 5 | * Copyright (C) 2005 - 2013 Codehaus 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package org.codehaus.mojo.cobertura; 21 | 22 | /** 23 | * Instrument the compiled classes, run the unit tests and integration tests 24 | * and generate a Cobertura report. 25 | * 26 | * @author Stevo Slavic 27 | * @goal cobertura-integration-test 28 | * @execute phase="verify" lifecycle="cobertura" 29 | */ 30 | public class CoberturaReportIntegrationTestMojo extends CoberturaReportMojo 31 | { 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/codehaus/mojo/cobertura/configuration/Regex.java: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * Mojo's Maven plugin for Cobertura 4 | * %% 5 | * Copyright (C) 2005 - 2013 Codehaus 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package org.codehaus.mojo.cobertura.configuration; 21 | 22 | /** 23 | * @author Edwin Punzalan 24 | */ 25 | public class Regex 26 | extends net.sourceforge.cobertura.ant.Regex 27 | { 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/codehaus/mojo/cobertura/tasks/CommandLineArguments.java: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * Mojo's Maven plugin for Cobertura 4 | * %% 5 | * Copyright (C) 2005 - 2013 Codehaus 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package org.codehaus.mojo.cobertura.tasks; 21 | 22 | import net.sourceforge.cobertura.util.CommandLineBuilder; 23 | 24 | import java.io.IOException; 25 | import java.util.ArrayList; 26 | import java.util.Iterator; 27 | import java.util.List; 28 | 29 | /** 30 | * CommandLineArguments allows for arbitrarily long command line argument lists. 31 | * 32 | * @author Joakim Erdfelt 33 | */ 34 | public class CommandLineArguments 35 | { 36 | private List args; 37 | 38 | private boolean useCommandsFile; 39 | 40 | /** 41 | * Construct empty arg set. 42 | */ 43 | public CommandLineArguments() 44 | { 45 | this.args = new ArrayList(); 46 | this.useCommandsFile = false; 47 | } 48 | 49 | /** 50 | * Append an option. 51 | * 52 | * @param arg the argument. 53 | */ 54 | public void addArg( String arg ) 55 | { 56 | this.args.add( arg ); 57 | } 58 | 59 | /** 60 | * Append two arguments (e.g. -x y) 61 | * 62 | * @param arg1 first arg 63 | * @param arg2 second arg. 64 | */ 65 | public void addArg( String arg1, String arg2 ) 66 | { 67 | this.args.add( arg1 ); 68 | this.args.add( arg2 ); 69 | } 70 | 71 | /** 72 | * @return the list of arg strings. 73 | */ 74 | public List getArgs() 75 | { 76 | return this.args; 77 | } 78 | 79 | /** 80 | * Generate the Commands file and return the filename to it. 81 | * 82 | * @return the commands filename. 83 | * @throws IOException error writing the file. 84 | */ 85 | public String getCommandsFile() 86 | throws IOException 87 | { 88 | CommandLineBuilder builder = new CommandLineBuilder(); 89 | for ( String arg : this.args ) 90 | { 91 | builder.addArg( arg ); 92 | } 93 | builder.saveArgs(); 94 | return builder.getCommandLineFile(); 95 | } 96 | 97 | /** 98 | * @return an iterator over the arg strings. 99 | */ 100 | public Iterator iterator() 101 | { 102 | return this.args.iterator(); 103 | } 104 | 105 | /** 106 | * @param useCommandsFile The useCommandsFile to set. 107 | */ 108 | public void setUseCommandsFile( boolean useCommandsFile ) 109 | { 110 | this.useCommandsFile = useCommandsFile; 111 | } 112 | 113 | /** 114 | * @return Returns the useCommandsFile. 115 | */ 116 | public boolean useCommandsFile() 117 | { 118 | return useCommandsFile; 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/maven/lifecycle.xml: -------------------------------------------------------------------------------- 1 | 20 | 21 | 22 | cobertura 23 | 24 | 25 | process-classes 26 | 27 | 28 | 29 | instrument 30 | 31 | 32 | 33 | 34 | 35 | test 36 | 37 | ${project.build.directory}/generated-classes/cobertura 38 | true 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /src/main/resources/cobertura-plugin/log4j-debug.properties: -------------------------------------------------------------------------------- 1 | ### 2 | # #%L 3 | # Mojo's Maven plugin for Cobertura 4 | # %% 5 | # Copyright (C) 2005 - 2013 Codehaus 6 | # %% 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # #L% 19 | ### 20 | log4j.rootLogger=DEBUG, A1 21 | 22 | log4j.appender.A1=org.apache.log4j.ConsoleAppender 23 | log4j.appender.A1.layout=org.apache.log4j.PatternLayout 24 | log4j.appender.A1.layout.ConversionPattern=[cobertura] %-5p [%t] %c - %m%n 25 | -------------------------------------------------------------------------------- /src/main/resources/cobertura-plugin/log4j-error.properties: -------------------------------------------------------------------------------- 1 | ### 2 | # #%L 3 | # Mojo's Maven plugin for Cobertura 4 | # %% 5 | # Copyright (C) 2005 - 2013 Codehaus 6 | # %% 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # #L% 19 | ### 20 | log4j.rootLogger=ERROR, A1 21 | 22 | log4j.appender.A1=org.apache.log4j.ConsoleAppender 23 | log4j.appender.A1.layout=org.apache.log4j.PatternLayout 24 | log4j.appender.A1.layout.ConversionPattern=[cobertura] %-5p [%t] %c - %m%n 25 | -------------------------------------------------------------------------------- /src/main/resources/cobertura-plugin/log4j-info.properties: -------------------------------------------------------------------------------- 1 | ### 2 | # #%L 3 | # Mojo's Maven plugin for Cobertura 4 | # %% 5 | # Copyright (C) 2005 - 2013 Codehaus 6 | # %% 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # #L% 19 | ### 20 | log4j.rootLogger=INFO, A1 21 | 22 | log4j.appender.A1=org.apache.log4j.ConsoleAppender 23 | log4j.appender.A1.layout=org.apache.log4j.PatternLayout 24 | log4j.appender.A1.layout.ConversionPattern=[cobertura] %-5p [%t] %c - %m%n 25 | -------------------------------------------------------------------------------- /src/main/resources/cobertura-report.properties: -------------------------------------------------------------------------------- 1 | ### 2 | # #%L 3 | # Mojo's Maven plugin for Cobertura 4 | # %% 5 | # Copyright (C) 2005 - 2013 Codehaus 6 | # %% 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # #L% 19 | ### 20 | 21 | report.cobertura.name=Cobertura Test Coverage 22 | report.cobertura.description=Cobertura Test Coverage Report. 23 | -------------------------------------------------------------------------------- /src/main/resources/cobertura-report_de.properties: -------------------------------------------------------------------------------- 1 | ### 2 | # #%L 3 | # Mojo's Maven plugin for Cobertura 4 | # %% 5 | # Copyright (C) 2005 - 2013 Codehaus 6 | # %% 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # #L% 19 | ### 20 | 21 | report.cobertura.name=Cobertura Testabdeckung 22 | report.cobertura.description=Bericht der Cobertura Testabdeckung. 23 | -------------------------------------------------------------------------------- /src/main/resources/cobertura-report_en.properties: -------------------------------------------------------------------------------- 1 | ### 2 | # #%L 3 | # Mojo's Maven plugin for Cobertura 4 | # %% 5 | # Copyright (C) 2005 - 2013 Codehaus 6 | # %% 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # #L% 19 | ### 20 | 21 | # NOTE: 22 | # This bundle is intentionally empty because English strings are provided by the base bundle via the parent chain. It 23 | # must be provided nevertheless such that a request for locale "en" will not erroneously pick up the bundle for the 24 | # JVM's default locale (which need not be "en"). See the method javadoc about 25 | # ResourceBundle.getBundle(String, Locale, ClassLoader) 26 | # for a full description of the lookup strategy. 27 | -------------------------------------------------------------------------------- /src/main/resources/cobertura-report_nl.properties: -------------------------------------------------------------------------------- 1 | ### 2 | # #%L 3 | # Mojo's Maven plugin for Cobertura 4 | # %% 5 | # Copyright (C) 2005 - 2013 Codehaus 6 | # %% 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # #L% 19 | ### 20 | 21 | report.cobertura.name=Cobertura testdekking 22 | report.cobertura.description=Cobertura testdekkingsrapport 23 | -------------------------------------------------------------------------------- /src/site/apt/examples/report-formats.apt: -------------------------------------------------------------------------------- 1 | ~~~ 2 | ~~ #%L 3 | ~~ Mojo's Maven plugin for Cobertura 4 | ~~ %% 5 | ~~ Copyright (C) 2005 - 2013 Codehaus 6 | ~~ %% 7 | ~~ Licensed under the Apache License, Version 2.0 (the "License"); 8 | ~~ you may not use this file except in compliance with the License. 9 | ~~ You may obtain a copy of the License at 10 | ~~ 11 | ~~ http://www.apache.org/licenses/LICENSE-2.0 12 | ~~ 13 | ~~ Unless required by applicable law or agreed to in writing, software 14 | ~~ distributed under the License is distributed on an "AS IS" BASIS, 15 | ~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | ~~ See the License for the specific language governing permissions and 17 | ~~ limitations under the License. 18 | ~~ #L% 19 | ~~~ 20 | ------ 21 | Report Formats 22 | ------ 23 | Dennis Lundberg 24 | ------ 25 | 2007-07-23 26 | ------ 27 | 28 | 29 | Report Formats 30 | 31 | The Cobertura plugin can produce reports in <<>> and <<>> formats. 32 | You can even get both is you want to. Here's how you would configure that: 33 | 34 | +-----+ 35 | 36 | ... 37 | 38 | 39 | ... 40 | 41 | org.codehaus.mojo 42 | cobertura-maven-plugin 43 | 44 | 45 | html 46 | xml 47 | 48 | 49 | 50 | 51 | 52 | 53 | +-----+ 54 | -------------------------------------------------------------------------------- /src/site/apt/index.apt.vm: -------------------------------------------------------------------------------- 1 | ------ 2 | Introduction 3 | ------ 4 | Dennis Lundberg 5 | ------ 6 | 2014-11-06 7 | ------ 8 | 9 | 10 | Cobertura Maven Plugin 11 | 12 | This plugin provides the features of 13 | {{{http://cobertura.sourceforge.net/}Cobertura}} within the Maven 2 & 3 14 | environment. 15 | 16 | The report generated by this plugin is the result of executing the Cobertura 17 | tool against your compiled classes to help you determine how well the unit 18 | testing and integration testing efforts have been, and can then be used to 19 | identify which parts of your Java program are lacking test coverage. 20 | 21 | ------------ 22 | This plugin uses Cobertura version ${coberturaVersion} and requires Java ${javaVersion}. 23 | ------------ 24 | 25 | * Goals Overview 26 | 27 | ~~ General Information about the goals. 28 | 29 | * {{{./check-mojo.html}cobertura:check}} Check the coverage percentages for 30 | unit tests from the last instrumentation, and optionally fail the build if 31 | the targets are not met. 32 | 33 | * {{{./check-integration-test-mojo.html}cobertura:check-integration-test}} 34 | Check the coverage percentages for unit tests and integration tests from the 35 | last instrumentation, and optionally fail the build if the targets are not 36 | met. 37 | 38 | * {{{./clean-mojo.html}cobertura:clean}} Clean up the files that Cobertura 39 | Maven Plugin has created during instrumentation. 40 | 41 | * {{{./dump-datafile-mojo.html}cobertura:dump-datafile}} Output the contents 42 | of Cobertura's data file to the command line. 43 | 44 | * {{{./instrument-mojo.html}cobertura:instrument}} Instrument the compiled classes. 45 | 46 | * {{{./cobertura-mojo.html}cobertura:cobertura}} Instrument the compiled 47 | classes, run the unit tests and generate a Cobertura report. 48 | 49 | * {{{./cobertura-integration-test-mojo.html}cobertura:cobertura-integration-test}} 50 | Instrument the compiled classes, run the unit tests and integration tests 51 | and generate a Cobertura report. 52 | 53 | * Usage 54 | 55 | General instructions on how to use the Cobertura Maven Plugin can be found on the {{{./usage.html}usage page}}. 56 | 57 | In case you still have questions regarding the plugin's usage, please feel 58 | free to contact the {{{./mail-lists.html}user mailing list}}. The posts to the mailing list are archived and could 59 | already contain the answer to your question as part of an older thread. Hence, it is also worth browsing/searching 60 | the {{{./mail-lists.html}mail archive}}. 61 | 62 | If you feel like the plugin is missing a feature or has a defect, you can fill a feature request or bug report in our 63 | {{{./issue-tracking.html}issue tracker}}. When creating a new issue, please provide a comprehensive description of your 64 | concern. Especially for fixing bugs it is crucial that the developers can reproduce your problem. For this reason, 65 | entire debug logs, POMs or most preferably little demo projects attached to the issue are very much appreciated. 66 | Of course, patches are most welcome too. Contributors can check out the project from our 67 | {{{./source-repository.html}source repository}} and will find supplementary information in the 68 | {{{http://maven.apache.org/guides/development/guide-helping.html}guide to helping with Maven}}. 69 | 70 | * Examples 71 | 72 | To provide you with better understanding of some usages of the Cobertura 73 | Maven Plugin, you can take a look into the following example: 74 | 75 | * {{{./examples/report-formats.html}Report Formats}} 76 | -------------------------------------------------------------------------------- /src/site/fml/faq.fml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | 23 | What is the difference between <ignores/> and <excludes/>? 24 | 25 |

With <excludes/> you define which files should be excluded from instrumentation. 26 | To filter out certain lines of the source code you can use <ignores/> containing a regular expression. 27 |

28 |

See Cobertura Commandline Reference for further details.

29 |
30 |
31 |
32 |
33 | -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/cobertura/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/cobertura/index.html -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/css/help.css: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * Mojo's Maven plugin for Cobertura 4 | * %% 5 | * Copyright (C) 2005 - 2013 Codehaus 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | dl { 21 | float: left; 22 | width: 100%; 23 | } 24 | 25 | dt { 26 | border-top: 1px solid #808080; 27 | float: left; 28 | font-weight: bold; 29 | margin: 0; 30 | padding: 1em; 31 | width: 20%; 32 | } 33 | 34 | dd { 35 | border-top: 1px solid #808080; 36 | float: left; 37 | font-style: italic; 38 | margin: 0; 39 | padding: 1em; 40 | width: 60%; 41 | } 42 | -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/css/main.css: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * Mojo's Maven plugin for Cobertura 4 | * %% 5 | * Copyright (C) 2005 - 2013 Codehaus 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | @import url("help.css"); 21 | @import url("source-viewer.css"); 22 | @import url("tooltip.css"); 23 | 24 | .hidden { 25 | display: none; 26 | } 27 | 28 | a.dfn { 29 | border-bottom: 1px dotted #00aa00; 30 | cursor: help; 31 | } 32 | 33 | a.dfn:active, a.dfn:link, a.dfn:visited { 34 | color: #000000; 35 | text-decoration: none; 36 | } 37 | 38 | a.dfn:hover { 39 | color: #0000ff; 40 | text-decoration: none; 41 | } 42 | 43 | body { 44 | font-family: verdana, arial, helvetica; 45 | } 46 | 47 | h1, h2, h3, h4, h5, h6 { 48 | margin-bottom: 0.5em; 49 | } 50 | 51 | h5 { 52 | margin-top: 0.5em; 53 | } 54 | 55 | div.footer { 56 | font-size: 68%; 57 | margin-top: 1.5em; 58 | } 59 | 60 | div.percentgraph { 61 | background-color: #f02020; 62 | border: #808080 1px solid; 63 | height: 1.3em; 64 | magin: 0px; 65 | padding: 0px; 66 | width: 100px; 67 | } 68 | 69 | div.percentgraph div.greenbar { 70 | background-color: #00f000; 71 | height: 1.3em; 72 | magin: 0px; 73 | padding: 0px; 74 | } 75 | 76 | div.percentgraph div.na { 77 | background-color: #eaeaea; 78 | height: 1.3em; 79 | magin: 0px; 80 | padding: 0px; 81 | } 82 | 83 | div.percentgraph span.text { 84 | display: block; 85 | position: absolute; 86 | text-align: center; 87 | width: 100px; 88 | } 89 | 90 | div.separator { 91 | height: 10px; 92 | } 93 | 94 | table tr td, table tr th { 95 | font-size: 68%; 96 | } 97 | 98 | td.value table tr td { 99 | font-size: 11px; 100 | } 101 | 102 | table.percentgraph { 103 | border: 0px; 104 | font-size: 130%; 105 | margin: 0px; 106 | margin-left: auto; 107 | margin-right: 0px; 108 | padding: 0px; 109 | } 110 | 111 | table.percentgraph tr.percentgraph { 112 | border: 0px; 113 | margin: 0px; 114 | padding: 0px; 115 | } 116 | 117 | table.percentgraph td.percentgraph { 118 | border: 0px; 119 | margin: 0px; 120 | padding: 0px; 121 | padding-left: 4px; 122 | } 123 | 124 | table.report { 125 | border-collapse: collapse; 126 | width: 100%; 127 | } 128 | 129 | table.report td { 130 | border: #d0d0d0 1px solid; 131 | } 132 | 133 | table.report td.heading { 134 | background: #dcecff; 135 | font-weight: bold; 136 | text-align: center; 137 | } 138 | 139 | table.report td.heading:hover { 140 | background: #c0ffc0; 141 | cursor: pointer; 142 | } 143 | 144 | table.report td.value { 145 | text-align: right; 146 | } 147 | -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/css/print.css: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * Mojo's Maven plugin for Cobertura 4 | * %% 5 | * Copyright (C) 2005 - 2013 Codehaus 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | #banner, #footer, #leftcol, #breadcrumbs, .docs #toc, .docs .courtesylinks, #leftColumn, #navColumn { 21 | display: none; 22 | } 23 | 24 | #bodyColumn, body.docs div.docs { 25 | margin: 0 !important; 26 | border: none !important 27 | } 28 | -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/css/sortabletable.css: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * Mojo's Maven plugin for Cobertura 4 | * %% 5 | * Copyright (C) 2005 - 2013 Codehaus 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | .sort-table { 21 | font: Icon; 22 | border: 1px Solid ThreeDShadow; 23 | background: Window; 24 | color: WindowText; 25 | } 26 | 27 | .sort-table thead { 28 | background: ButtonFace; 29 | } 30 | 31 | .sort-table td { 32 | padding: 2px 5px; 33 | } 34 | 35 | .sort-table thead td { 36 | border: 1px solid; 37 | border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight; 38 | cursor: default; 39 | } 40 | 41 | .sort-table thead td:active { 42 | border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow; 43 | padding: 3px 4px 1px 6px; 44 | } 45 | 46 | .sort-table thead td[_sortType=None]:active { 47 | border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight; 48 | padding: 2px 5px; 49 | } 50 | 51 | .sort-arrow { 52 | width: 11px; 53 | height: 11px; 54 | background-position: center center; 55 | background-repeat: no-repeat; 56 | margin: 0 2px; 57 | } 58 | 59 | .sort-arrow.descending { 60 | background-image: url("../images/downsimple.png"); 61 | 62 | } 63 | 64 | .sort-arrow.ascending { 65 | background-image: url("../images/upsimple.png"); 66 | } -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/css/source-viewer.css: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * Mojo's Maven plugin for Cobertura 4 | * %% 5 | * Copyright (C) 2005 - 2013 Codehaus 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | pre.src { 21 | background: #ffffff; 22 | margin-top: 0px; 23 | margin-bottom: 0px; 24 | } 25 | 26 | table.src { 27 | border: #dcdcdc 1px solid; 28 | font-size: 16px; 29 | } 30 | 31 | td.numLine { 32 | background: #f0f0f0; 33 | border-right: #dcdcdc 1px solid; 34 | padding-right: 3px; 35 | text-align: right; 36 | } 37 | 38 | td.numLineCover { 39 | background: #80ff80; 40 | border-right: #dcdcdc 1px solid; 41 | padding-right: 3px; 42 | text-align: right; 43 | } 44 | 45 | td.nbHits { 46 | background: #f0f0f0; 47 | border-right: #dcdcdc 1px solid; 48 | padding-right: 3px; 49 | text-align: right; 50 | } 51 | 52 | td.nbHitsCovered { 53 | background: #80ff80; 54 | border-right: #dcdcdc 1px solid; 55 | padding-right: 3px; 56 | text-align: right; 57 | } 58 | 59 | td.nbHitsUncovered { 60 | background: #ff9090; 61 | border-right: #dcdcdc 1px solid; 62 | font-weight: bold; 63 | padding-right: 3px; 64 | text-align: right; 65 | } 66 | 67 | td.src { 68 | width: 100%; 69 | } 70 | 71 | span.comment { 72 | color: #b22222; 73 | font-style: italic; 74 | } 75 | 76 | span.keyword { 77 | color: #2020bf; 78 | font-weight: bold; 79 | } 80 | 81 | span.srcUncovered { 82 | background: #ff9090; 83 | font-weight: bold; 84 | } 85 | 86 | span.string { 87 | color: #2a00ff; 88 | } 89 | 90 | span.text_italic { 91 | font-size: 12px; 92 | font-style: italic; 93 | } 94 | -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/css/tooltip.css: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * Mojo's Maven plugin for Cobertura 4 | * %% 5 | * Copyright (C) 2005 - 2013 Codehaus 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | a.hastooltip { 21 | border-bottom: 1px dotted #00aa00; 22 | color: #000000; 23 | cursor: help; 24 | font-style: normal; 25 | position: relative; /* This is the key */ 26 | text-decoration: none; 27 | z-index: 24; /* What does this do? */ 28 | } 29 | 30 | a.hastooltip:active { 31 | color: #000000; 32 | text-decoration: none; 33 | } 34 | 35 | a.hastooltip:link { 36 | color: #000000; 37 | text-decoration: none; 38 | } 39 | 40 | a.hastooltip:hover { 41 | background-color: #a0b8ff; 42 | color: #000000; 43 | text-decoration: none; 44 | z-index: 25; 45 | } 46 | 47 | a.hastooltip:visited { 48 | color: #000000; 49 | text-decoration: none; 50 | } 51 | 52 | a.hastooltip span { 53 | display: none; 54 | } 55 | 56 | a.hastooltip:hover span { 57 | background-color: #eeeeee; 58 | border: 1px solid #000000; 59 | color: #000000; 60 | display: block; 61 | padding: 5px; 62 | left: -15.2em; 63 | position: absolute; 64 | text-align: center; 65 | text-decoration: none; 66 | top: 2em; 67 | width: 20em; 68 | } 69 | -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/frame-packages.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | Coverage Report 7 | 8 | 9 | 10 |
Packages
11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 |
All
org.apache.maven.shared.io.download
org.apache.maven.shared.io.location
org.apache.maven.shared.io.logging
org.apache.maven.shared.io.scan
org.apache.maven.shared.io.scan.mapping
31 | 32 | 33 | -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/frame-sourcefiles-org.apache.maven.shared.io.download.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | Coverage Report Classes 7 | 8 | 9 | 10 |
11 | org.apache.maven.shared.io.download 12 |
13 |
 
14 |
Classes
15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |
DefaultDownloadManager (95%)
DownloadFailedException (100%)
DownloadManager (N/A)
28 | 29 | 30 | -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/frame-sourcefiles-org.apache.maven.shared.io.location.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | Coverage Report Classes 7 | 8 | 9 | 10 |
11 | org.apache.maven.shared.io.location 12 |
13 |
 
14 |
Classes
15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 |
ArtifactLocation (100%)
ArtifactLocatorStrategy (100%)
ClasspathResourceLocatorStrategy (100%)
FileLocation (96%)
FileLocatorStrategy (100%)
Location (N/A)
Locator (100%)
LocatorStrategy (N/A)
URLLocation (100%)
URLLocatorStrategy (100%)
49 | 50 | 51 | -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/frame-sourcefiles-org.apache.maven.shared.io.logging.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | Coverage Report Classes 7 | 8 | 9 | 10 |
11 | org.apache.maven.shared.io.logging 12 |
13 |
 
14 |
Classes
15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 |
DefaultMessageHolder (45%)
MessageHolder (N/A)
MessageLevels (82%)
MessageSink (N/A)
MojoLogSink (0%)
MultiChannelMessageHolder (N/A)
PlexusLoggerSink (0%)
40 | 41 | 42 | -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/frame-sourcefiles-org.apache.maven.shared.io.scan.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | Coverage Report Classes 7 | 8 | 9 | 10 |
11 | org.apache.maven.shared.io.scan 12 |
13 |
 
14 |
Classes
15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 |
AbstractResourceInclusionScanner (0%)
InclusionScanException (0%)
ResourceInclusionScanner (N/A)
SimpleResourceInclusionScanner (0%)
StaleResourceScanner (0%)
34 | 35 | 36 | -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/frame-sourcefiles-org.apache.maven.shared.io.scan.mapping.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | Coverage Report Classes 7 | 8 | 9 | 10 |
11 | org.apache.maven.shared.io.scan.mapping 12 |
13 |
 
14 |
Classes
15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |
SingleTargetMapping (100%)
SourceMapping (N/A)
SuffixMapping (100%)
28 | 29 | 30 | -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/help.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | Coverage Report - Help 9 | 10 | 11 | 12 | 13 |
14 | 15 |
Line Coverage
16 |
The percent of lines executed by this test run.
17 | 18 |
Branch Coverage
19 |
The percent of branches executed by this test run.
20 | 21 |
Complexity
22 |
Average McCabe's cyclomatic code complexity for all methods. This is basically a count of the number of different code paths in a method (incremented by 1 for each if statement, while loop, etc.)
23 | 24 |
N/A
25 |
Line coverage and branch coverage will appear as "Not Applicable" when Cobertura can not find line number information in the .class file. This happens for stub and skeleton classes, interfaces, or when the class was not compiled with "debug=true."
26 | 27 |
28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/add.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/add.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/blank.png -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/collapsed.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/collapsed.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/downsimple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/downsimple.png -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/expanded.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/expanded.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/external-classic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/external-classic.png -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/external.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/external.png -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/file.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/file.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/fix.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/fix.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/folder-closed.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/folder-closed.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/folder-open.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/folder-open.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/help_logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/help_logo.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/icon_alert.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/icon_alert.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/icon_alertsml.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/icon_alertsml.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/icon_arrowfolder1_sml.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/icon_arrowfolder1_sml.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/icon_arrowfolder2_sml.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/icon_arrowfolder2_sml.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/icon_arrowfolderclosed1_sml.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/icon_arrowfolderclosed1_sml.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/icon_arrowfolderopen2_sml.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/icon_arrowfolderopen2_sml.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/icon_arrowmembers1_sml.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/icon_arrowmembers1_sml.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/icon_arrowmembers2_sml.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/icon_arrowmembers2_sml.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/icon_arrowusergroups1_sml.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/icon_arrowusergroups1_sml.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/icon_arrowusergroups2_sml.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/icon_arrowusergroups2_sml.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/icon_arrowwaste1_sml.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/icon_arrowwaste1_sml.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/icon_arrowwaste2_sml.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/icon_arrowwaste2_sml.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/icon_confirmsml.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/icon_confirmsml.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/icon_doc_lrg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/icon_doc_lrg.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/icon_doc_sml.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/icon_doc_sml.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/icon_error_lrg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/icon_error_lrg.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/icon_error_sml.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/icon_error_sml.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/icon_folder_lrg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/icon_folder_lrg.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/icon_folder_sml.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/icon_folder_sml.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/icon_help_lrg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/icon_help_lrg.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/icon_help_sml.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/icon_help_sml.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/icon_info_lrg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/icon_info_lrg.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/icon_info_sml.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/icon_info_sml.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/icon_infosml.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/icon_infosml.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/icon_members_lrg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/icon_members_lrg.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/icon_members_sml.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/icon_members_sml.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/icon_sortdown.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/icon_sortdown.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/icon_sortleft.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/icon_sortleft.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/icon_sortright.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/icon_sortright.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/icon_sortup.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/icon_sortup.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/icon_success_lrg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/icon_success_lrg.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/icon_success_sml.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/icon_success_sml.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/icon_usergroups_lrg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/icon_usergroups_lrg.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/icon_usergroups_sml.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/icon_usergroups_sml.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/icon_warning_lrg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/icon_warning_lrg.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/icon_warning_sml.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/icon_warning_sml.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/icon_waste_lrg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/icon_waste_lrg.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/icon_waste_sml.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/icon_waste_sml.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/logos/maven-feather.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/logos/maven-feather.png -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/newwindow-classic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/newwindow-classic.png -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/newwindow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/newwindow.png -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/none.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/none.png -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/nw_maj.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/nw_maj.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/nw_maj_hi.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/nw_maj_hi.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/nw_maj_rond.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/nw_maj_rond.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/nw_med.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/nw_med.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/nw_med_hi.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/nw_med_hi.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/nw_med_rond.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/nw_med_rond.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/nw_min.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/nw_min.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/nw_min_036.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/nw_min_036.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/nw_min_hi.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/nw_min_hi.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/pdf.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/pdf.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/poweredby_036.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/poweredby_036.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/product_logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/product_logo.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/remove.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/remove.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/se_maj_rond.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/se_maj_rond.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/strich.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/strich.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/sw_maj_rond.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/sw_maj_rond.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/sw_med_rond.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/sw_med_rond.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/sw_min.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/sw_min.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/update.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/update.gif -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/images/upsimple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/site/resources/sample-maven-shared-io-report/images/upsimple.png -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/index.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | Coverage Report 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | <body> 19 | <p>This document is designed to be viewed using the frames feature. If you see this message, you are using a frame-incapable web client.</p> 20 | <p><a href="frame-summary.html">Click here to view a non-frame version.</a></p> 21 | </body> 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/js/customsorttypes.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Cobertura - http://cobertura.sourceforge.net/ 3 | * 4 | * Copyright (C) 2005 Mark Doliner 5 | * Copyright (C) 2005 Olivier Parent 6 | * 7 | * Cobertura is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published 9 | * by the Free Software Foundation; either version 2 of the License, 10 | * or (at your option) any later version. 11 | * 12 | * Cobertura is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Cobertura; if not, write to the Free Software 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 20 | * USA 21 | */ 22 | 23 | 24 | 25 | function percentageSortType( s ) 26 | { 27 | var ret; 28 | var i = s.indexOf( "%" ); 29 | 30 | if (i != -1) { 31 | s = s.substr( 0, i ); 32 | } 33 | ret = parseFloat(s); 34 | if (isNaN(ret)) { 35 | ret = -1; 36 | } 37 | 38 | return ret; 39 | } 40 | 41 | SortableTable.prototype.addSortType( "Percentage", percentageSortType ); 42 | 43 | 44 | 45 | // This is needed for correctly sorting numbers in different 46 | // locales. The stock number converter only expects to sort 47 | // numbers which use a period as a separator instead of a 48 | // comma (like French). 49 | function formattedNumberSortType( s ) 50 | { 51 | var ret; 52 | var i = s.indexOf(';'); 53 | 54 | if (i != -1) { 55 | s = s.substring(0, i); 56 | } 57 | ret = parseFloat(s); 58 | if (isNaN(ret)) { 59 | return -1; 60 | } 61 | 62 | return ret; 63 | } 64 | 65 | SortableTable.prototype.addSortType( "FormattedNumber", formattedNumberSortType ); 66 | -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/js/popup.js: -------------------------------------------------------------------------------- 1 | var newwindow; 2 | function popupwindow(url) 3 | { 4 | newwindow=window.open(url,'name','height=500,width=500,resizable=yes,scrollbars=yes'); 5 | if (window.focus) { 6 | newwindow.focus() 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/site/resources/sample-maven-shared-io-report/org.apache.maven.shared.io.logging.MultiChannelMessageHolder.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | Coverage Report 7 | 8 | 9 | 10 | 11 |
Coverage Report - org.apache.maven.shared.io.logging.MultiChannelMessageHolder
12 |
 
13 | 14 | 15 | 16 | 17 |
Classes in this File Line Coverage Branch Coverage Complexity
MultiChannelMessageHolder
N/A
N/A
0
18 |
 
19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 |
 1  
 package org.apache.maven.shared.io.logging;
 2  
 
 3  
 
 4  
 public interface MultiChannelMessageHolder
 5  
 {
 6  
 
 7  
 }
35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /src/site/site.xml: -------------------------------------------------------------------------------- 1 | 2 | 21 | 22 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /src/test/classes/Circle.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/test/classes/Circle.class -------------------------------------------------------------------------------- /src/test/classes/CircleTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/test/classes/CircleTest.class -------------------------------------------------------------------------------- /src/test/java/org/codehaus/mojo/cobertura/CoberturaReportMojoTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * Mojo's Maven plugin for Cobertura 4 | * %% 5 | * Copyright (C) 2005 - 2013 Codehaus 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package org.codehaus.mojo.cobertura; 21 | 22 | import org.apache.maven.plugin.Mojo; 23 | import org.apache.maven.reporting.MavenReport; 24 | import org.codehaus.plexus.PlexusTestCase; 25 | 26 | import java.io.File; 27 | 28 | /** 29 | * @author Edwin Punzalan 30 | */ 31 | public class CoberturaReportMojoTest 32 | extends AbstractCoberturaTestCase 33 | { 34 | public void testReport() 35 | throws Exception 36 | { 37 | Mojo mojo = lookupMojo( "cobertura", 38 | PlexusTestCase.getBasedir() + "/src/test/plugin-configs/report-plugin-config.xml" ); 39 | 40 | setMojoPluginClasspath( mojo ); 41 | 42 | MavenReport reportMojo = (MavenReport) mojo; 43 | 44 | assertTrue( "Should be able to generate a report", reportMojo.canGenerateReport() ); 45 | 46 | assertTrue( "Should be an external report", reportMojo.isExternalReport() ); 47 | 48 | mojo.execute(); 49 | 50 | File outputHtml = 51 | new File( reportMojo.getReportOutputDirectory().getParent(), reportMojo.getOutputName() + ".html" ); 52 | 53 | assertTrue( "Test for generated html file " + outputHtml, outputHtml.exists() ); 54 | } 55 | 56 | public void testReportEmptySourceDir() 57 | throws Exception 58 | { 59 | Mojo mojo = lookupMojo( "cobertura", PlexusTestCase.getBasedir() 60 | + "/src/test/plugin-configs/report-empty-src-plugin-config.xml" ); 61 | 62 | setMojoPluginClasspath( mojo ); 63 | 64 | MavenReport reportMojo = (MavenReport) mojo; 65 | 66 | assertFalse( "Should not be able to generate a report", reportMojo.canGenerateReport() ); 67 | } 68 | 69 | private void setMojoPluginClasspath( Mojo mojo ) 70 | throws Exception 71 | { 72 | setVariableValueToObject( mojo, "pluginClasspathList", getPluginClasspath() ); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/test/java/org/codehaus/mojo/cobertura/configuration/ConfigCheckTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * Mojo's Maven plugin for Cobertura 4 | * %% 5 | * Copyright (C) 2005 - 2013 Codehaus 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package org.codehaus.mojo.cobertura.configuration; 21 | 22 | import junit.framework.TestCase; 23 | 24 | import java.util.Set; 25 | 26 | /** 27 | * @author Edwin Punzalan 28 | */ 29 | public class ConfigCheckTest 30 | extends TestCase 31 | { 32 | private ConfigCheck check; 33 | 34 | protected void setUp() 35 | { 36 | check = new ConfigCheck(); 37 | } 38 | 39 | public void testAddRegex() 40 | { 41 | Regex regex = new Regex(); 42 | 43 | check.addRegex( regex ); 44 | 45 | Set regexes = check.getRegexes(); 46 | 47 | assertEquals( 1, regexes.size() ); 48 | 49 | assertTrue( regexes.contains( regex ) ); 50 | } 51 | 52 | public void testCreateRegex() 53 | { 54 | Regex regex = check.createRegex(); 55 | 56 | Set regexes = check.getRegexes(); 57 | 58 | assertEquals( 1, regexes.size() ); 59 | 60 | assertTrue( regexes.contains( regex ) ); 61 | } 62 | 63 | public void testBranchRate() 64 | { 65 | String rate = "50"; 66 | 67 | check.setBranchRate( rate ); 68 | 69 | assertEquals( rate, check.getBranchRate() ); 70 | } 71 | 72 | public void testLineRate() 73 | { 74 | String rate = "50"; 75 | 76 | check.setLineRate( rate ); 77 | 78 | assertEquals( rate, check.getLineRate() ); 79 | } 80 | 81 | public void testTotalBranchRate() 82 | { 83 | String rate = "50"; 84 | 85 | check.setTotalBranchRate( rate ); 86 | 87 | assertEquals( rate, check.getTotalBranchRate() ); 88 | } 89 | 90 | public void testTotalLineRate() 91 | { 92 | String rate = "50"; 93 | 94 | check.setTotalLineRate( rate ); 95 | 96 | assertEquals( rate, check.getTotalLineRate() ); 97 | } 98 | 99 | public void testHaltOnFailure() 100 | { 101 | check.setHaltOnFailure( true ); 102 | 103 | assertTrue( check.isHaltOnFailure() ); 104 | 105 | check.setHaltOnFailure( false ); 106 | 107 | assertFalse( check.isHaltOnFailure() ); 108 | } 109 | 110 | public void testMaxmem() 111 | { 112 | final String expectedValue128m = "128m"; 113 | 114 | check.setMaxmem( expectedValue128m ); 115 | 116 | assertEquals( expectedValue128m, check.getMaxmem() ); 117 | 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /src/test/java/org/codehaus/mojo/cobertura/configuration/ConfigInstrumentationTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * Mojo's Maven plugin for Cobertura 4 | * %% 5 | * Copyright (C) 2005 - 2013 Codehaus 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package org.codehaus.mojo.cobertura.configuration; 21 | 22 | import junit.framework.TestCase; 23 | 24 | /** 25 | * Test class for {@link ConfigInstrumentation}. 26 | * 27 | * @author Trampas Kirk 28 | */ 29 | public class ConfigInstrumentationTest 30 | extends TestCase 31 | { 32 | private ConfigInstrumentation configInstrumentation; 33 | 34 | protected void setUp() 35 | throws Exception 36 | { 37 | configInstrumentation = new ConfigInstrumentation(); 38 | } 39 | 40 | public void testMaxmem() 41 | { 42 | final String expectedValue128m = "128m"; 43 | 44 | configInstrumentation.setMaxmem( expectedValue128m ); 45 | 46 | assertEquals( expectedValue128m, configInstrumentation.getMaxmem() ); 47 | 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/test/java/org/codehaus/mojo/cobertura/stubs/ArtifactStub.java: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * Mojo's Maven plugin for Cobertura 4 | * %% 5 | * Copyright (C) 2005 - 2013 Codehaus 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package org.codehaus.mojo.cobertura.stubs; 21 | 22 | import org.apache.maven.artifact.handler.ArtifactHandler; 23 | import org.apache.maven.artifact.handler.DefaultArtifactHandler; 24 | import org.apache.maven.artifact.versioning.VersionRange; 25 | 26 | import java.io.File; 27 | 28 | /** 29 | * @author Edwin Punzalan 30 | */ 31 | public class ArtifactStub 32 | extends org.apache.maven.plugin.testing.stubs.ArtifactStub 33 | { 34 | private File artifactFile; 35 | 36 | private String groupId; 37 | 38 | private String artifactId; 39 | 40 | private String version; 41 | 42 | private VersionRange versionRange; 43 | 44 | public void setFile( File file ) 45 | { 46 | artifactFile = file; 47 | } 48 | 49 | public void setGroupId( String groupId ) 50 | { 51 | this.groupId = groupId; 52 | } 53 | 54 | public String getType() 55 | { 56 | return "pom"; 57 | } 58 | 59 | public String getGroupId() 60 | { 61 | return groupId; 62 | } 63 | 64 | public void setArtifactId( String artifactId ) 65 | { 66 | this.artifactId = artifactId; 67 | } 68 | 69 | public String getArtifactId() 70 | { 71 | return artifactId; 72 | } 73 | 74 | public VersionRange getVersionRange() 75 | { 76 | return versionRange; 77 | } 78 | 79 | public void setVersionRange( VersionRange versionRange ) 80 | { 81 | this.versionRange = versionRange; 82 | } 83 | 84 | public ArtifactHandler getArtifactHandler() 85 | { 86 | return new DefaultArtifactHandler() 87 | { 88 | public String getLanguage() 89 | { 90 | return "java"; 91 | } 92 | }; 93 | } 94 | 95 | public File getFile() 96 | { 97 | return artifactFile; 98 | } 99 | 100 | public String getVersion() 101 | { 102 | return version; 103 | } 104 | 105 | public void setVersion( String version ) 106 | { 107 | this.version = version; 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /src/test/java/org/codehaus/mojo/cobertura/stubs/CheckMavenProjectStub.java: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * Mojo's Maven plugin for Cobertura 4 | * %% 5 | * Copyright (C) 2005 - 2013 Codehaus 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package org.codehaus.mojo.cobertura.stubs; 21 | 22 | import org.apache.maven.artifact.Artifact; 23 | import org.apache.maven.model.Build; 24 | import org.apache.maven.plugin.testing.stubs.MavenProjectStub; 25 | import org.apache.maven.project.MavenProject; 26 | import org.codehaus.plexus.PlexusTestCase; 27 | import org.codehaus.plexus.util.FileUtils; 28 | 29 | import java.io.File; 30 | import java.io.IOException; 31 | import java.util.Collections; 32 | import java.util.List; 33 | import java.util.Set; 34 | 35 | /** 36 | * @author Edwin Punzalan 37 | */ 38 | public class CheckMavenProjectStub 39 | extends MavenProjectStub 40 | { 41 | private Build build; 42 | 43 | public CheckMavenProjectStub() 44 | throws IOException 45 | { 46 | File targetFile = new File( PlexusTestCase.getBasedir() + "/target/test-harness/check/cobertura.ser" ); 47 | 48 | File serFile = new File( PlexusTestCase.getBasedir() + "/src/test/sources/check.ser" ); 49 | 50 | FileUtils.copyFile( serFile, targetFile ); 51 | } 52 | 53 | public MavenProject getExecutionProject() 54 | { 55 | return this; 56 | } 57 | 58 | public Set getDependencyArtifacts() 59 | { 60 | return Collections.EMPTY_SET; 61 | } 62 | 63 | public Build getBuild() 64 | { 65 | if ( build == null ) 66 | { 67 | build = new Build(); 68 | 69 | build.setDirectory( PlexusTestCase.getBasedir() + "/target/test-harness/check" ); 70 | build.setOutputDirectory( PlexusTestCase.getBasedir() + "/target/test-harness/check/classes" ); 71 | } 72 | 73 | return build; 74 | } 75 | 76 | public Artifact getArtifact() 77 | { 78 | return new ArtifactStub(); 79 | } 80 | 81 | public List getCompileSourceRoots() 82 | { 83 | return Collections.singletonList( PlexusTestCase.getBasedir() + "/src/test/sources" ); 84 | } 85 | 86 | } 87 | -------------------------------------------------------------------------------- /src/test/java/org/codehaus/mojo/cobertura/stubs/CleanMavenProjectStub.java: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * Mojo's Maven plugin for Cobertura 4 | * %% 5 | * Copyright (C) 2005 - 2013 Codehaus 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package org.codehaus.mojo.cobertura.stubs; 21 | 22 | import org.codehaus.plexus.PlexusTestCase; 23 | import org.codehaus.plexus.util.FileUtils; 24 | 25 | import java.io.File; 26 | import java.io.IOException; 27 | 28 | /** 29 | * @author Edwin Punzalan 30 | */ 31 | public class CleanMavenProjectStub 32 | extends InstrumentMavenProjectStub 33 | { 34 | public CleanMavenProjectStub() 35 | throws IOException 36 | { 37 | File targetFile = new File( PlexusTestCase.getBasedir() + "/target/test-harness/clean/cobertura.ser" ); 38 | 39 | File serFile = new File( PlexusTestCase.getBasedir() + "/src/test/sources/clean.ser" ); 40 | 41 | FileUtils.copyFile( serFile, targetFile ); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/test/java/org/codehaus/mojo/cobertura/stubs/InstrumentMavenProjectStub.java: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * Mojo's Maven plugin for Cobertura 4 | * %% 5 | * Copyright (C) 2005 - 2013 Codehaus 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package org.codehaus.mojo.cobertura.stubs; 21 | 22 | import org.apache.maven.artifact.Artifact; 23 | import org.apache.maven.model.Build; 24 | import org.apache.maven.plugin.testing.stubs.MavenProjectStub; 25 | import org.apache.maven.project.MavenProject; 26 | import org.codehaus.plexus.PlexusTestCase; 27 | import org.codehaus.plexus.util.FileUtils; 28 | 29 | import java.io.File; 30 | import java.io.IOException; 31 | import java.util.Collections; 32 | import java.util.List; 33 | import java.util.Set; 34 | 35 | /** 36 | * @author Edwin Punzalan 37 | */ 38 | public class InstrumentMavenProjectStub 39 | extends MavenProjectStub 40 | { 41 | private Build build; 42 | 43 | private final ArtifactStub artifactStub = new ArtifactStub(); 44 | 45 | public InstrumentMavenProjectStub() 46 | throws IOException 47 | { 48 | File classesDir = new File( PlexusTestCase.getBasedir() + "/src/test/classes" ); 49 | 50 | FileUtils.copyDirectory( classesDir, new File( getBuild().getOutputDirectory() ), "Circle.class", null ); 51 | } 52 | 53 | public MavenProject getExecutionProject() 54 | { 55 | return this; 56 | } 57 | 58 | public Set getDependencyArtifacts() 59 | { 60 | return Collections.EMPTY_SET; 61 | } 62 | 63 | public Build getBuild() 64 | { 65 | if ( build == null ) 66 | { 67 | build = new Build(); 68 | 69 | build.setDirectory( PlexusTestCase.getBasedir() + "/target/test-harness/instrument" ); 70 | build.setOutputDirectory( PlexusTestCase.getBasedir() + "/target/test-harness/instrument/classes" ); 71 | } 72 | 73 | return build; 74 | } 75 | 76 | public Artifact getArtifact() 77 | { 78 | return artifactStub; 79 | } 80 | 81 | public List getCompileSourceRoots() 82 | { 83 | return Collections.singletonList( PlexusTestCase.getBasedir() + "/src/test/sources" ); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /src/test/java/org/codehaus/mojo/cobertura/stubs/ReportEmptySrcMavenProjectStub.java: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * Mojo's Maven plugin for Cobertura 4 | * %% 5 | * Copyright (C) 2005 - 2013 Codehaus 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package org.codehaus.mojo.cobertura.stubs; 21 | 22 | import org.apache.maven.model.Build; 23 | import org.apache.maven.plugin.testing.stubs.MavenProjectStub; 24 | import org.apache.maven.project.MavenProject; 25 | import org.codehaus.plexus.PlexusTestCase; 26 | 27 | import java.io.File; 28 | import java.io.IOException; 29 | import java.util.Collections; 30 | import java.util.List; 31 | 32 | /** 33 | * @author Fredrik Vraalsen 34 | * @author Edwin Punzalan 35 | */ 36 | public class ReportEmptySrcMavenProjectStub 37 | extends MavenProjectStub 38 | { 39 | private Build build; 40 | 41 | public ReportEmptySrcMavenProjectStub() 42 | throws IOException 43 | { 44 | File srcDir = new File( PlexusTestCase.getBasedir() + "/target/test-harness/report-empty-src/src/main/java" ); 45 | 46 | srcDir.mkdirs(); 47 | } 48 | 49 | public MavenProject getExecutionProject() 50 | { 51 | return this; 52 | } 53 | 54 | public Build getBuild() 55 | { 56 | if ( build == null ) 57 | { 58 | build = new Build(); 59 | 60 | build.setDirectory( PlexusTestCase.getBasedir() + "/target/test-harness/report-empty-src" ); 61 | build.setOutputDirectory( PlexusTestCase.getBasedir() + "/target/test-harness/instrument/classes" ); 62 | } 63 | 64 | return build; 65 | } 66 | 67 | public List getCompileSourceRoots() 68 | { 69 | return Collections.singletonList( PlexusTestCase.getBasedir() + "/src/test/sources" ); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/test/java/org/codehaus/mojo/cobertura/stubs/ReportMavenProjectStub.java: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * Mojo's Maven plugin for Cobertura 4 | * %% 5 | * Copyright (C) 2005 - 2013 Codehaus 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package org.codehaus.mojo.cobertura.stubs; 21 | 22 | import org.apache.maven.model.Build; 23 | import org.apache.maven.plugin.testing.stubs.MavenProjectStub; 24 | import org.apache.maven.project.MavenProject; 25 | import org.codehaus.plexus.PlexusTestCase; 26 | import org.codehaus.plexus.util.FileUtils; 27 | 28 | import java.io.File; 29 | import java.io.IOException; 30 | import java.util.Collections; 31 | import java.util.List; 32 | 33 | /** 34 | * @author Edwin Punzalan 35 | */ 36 | public class ReportMavenProjectStub 37 | extends MavenProjectStub 38 | { 39 | private Build build; 40 | 41 | public ReportMavenProjectStub() 42 | throws IOException 43 | { 44 | File targetFile = new File( PlexusTestCase.getBasedir() + "/target/test-harness/report/cobertura.ser" ); 45 | 46 | File serFile = new File( PlexusTestCase.getBasedir() + "/src/test/sources/report.ser" ); 47 | 48 | FileUtils.copyFile( serFile, targetFile ); 49 | } 50 | 51 | public MavenProject getExecutionProject() 52 | { 53 | return this; 54 | } 55 | 56 | public Build getBuild() 57 | { 58 | if ( build == null ) 59 | { 60 | build = new Build(); 61 | 62 | build.setDirectory( PlexusTestCase.getBasedir() + "/target/test-harness/report" ); 63 | build.setOutputDirectory( PlexusTestCase.getBasedir() + "/target/test-harness/instrument/classes" ); 64 | } 65 | 66 | return build; 67 | } 68 | 69 | public List getCompileSourceRoots() 70 | { 71 | return Collections.singletonList( PlexusTestCase.getBasedir() + "/src/test/sources" ); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/test/java/org/codehaus/mojo/cobertura/tasks/CheckTaskTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * Mojo's Maven plugin for Cobertura 4 | * %% 5 | * Copyright (C) 2005 - 2013 Codehaus 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package org.codehaus.mojo.cobertura.tasks; 21 | 22 | /* 23 | * Copyright 2001-2006 The Apache Software Foundation. 24 | * 25 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 26 | * use this file except in compliance with the License. You may obtain a copy of 27 | * the License at 28 | * 29 | * http://www.apache.org/licenses/LICENSE-2.0 30 | * 31 | * Unless required by applicable law or agreed to in writing, software 32 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 33 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 34 | * License for the specific language governing permissions and limitations under 35 | * the License. 36 | */ 37 | 38 | import junit.framework.TestCase; 39 | import org.codehaus.mojo.cobertura.configuration.ConfigCheck; 40 | 41 | /** 42 | * @author Edwin Punzalan 43 | */ 44 | public class CheckTaskTest 45 | extends TestCase 46 | { 47 | private CheckTask task; 48 | 49 | protected void setUp() 50 | throws Exception 51 | { 52 | task = new CheckTask(); 53 | } 54 | 55 | public void testDataFile() 56 | { 57 | String dataFile = "path/to/file"; 58 | 59 | task.setDataFile( dataFile ); 60 | 61 | assertEquals( dataFile, task.getDataFile() ); 62 | } 63 | 64 | public void testConfig() 65 | { 66 | ConfigCheck config = new ConfigCheck(); 67 | 68 | task.setConfig( config ); 69 | 70 | assertEquals( config, task.getConfig() ); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/test/java/org/codehaus/mojo/cobertura/tasks/InstrumentTaskTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * Mojo's Maven plugin for Cobertura 4 | * %% 5 | * Copyright (C) 2005 - 2013 Codehaus 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package org.codehaus.mojo.cobertura.tasks; 21 | 22 | /* 23 | * Copyright 2001-2006 The Apache Software Foundation. 24 | * 25 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 26 | * use this file except in compliance with the License. You may obtain a copy of 27 | * the License at 28 | * 29 | * http://www.apache.org/licenses/LICENSE-2.0 30 | * 31 | * Unless required by applicable law or agreed to in writing, software 32 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 33 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 34 | * License for the specific language governing permissions and limitations under 35 | * the License. 36 | */ 37 | 38 | import junit.framework.TestCase; 39 | import org.codehaus.mojo.cobertura.configuration.ConfigInstrumentation; 40 | 41 | import java.io.File; 42 | 43 | /** 44 | * @author Edwin Punzalan 45 | */ 46 | public class InstrumentTaskTest 47 | extends TestCase 48 | { 49 | private InstrumentTask task; 50 | 51 | protected void setUp() 52 | throws Exception 53 | { 54 | task = new InstrumentTask(); 55 | } 56 | 57 | public void testDataFile() 58 | { 59 | File dataFile = new File( "path/to/file" ); 60 | 61 | task.setDataFile( dataFile ); 62 | 63 | assertEquals( dataFile, task.getDataFile() ); 64 | } 65 | 66 | public void testConfig() 67 | { 68 | ConfigInstrumentation config = new ConfigInstrumentation(); 69 | 70 | task.setConfig( config ); 71 | 72 | assertEquals( config, task.getConfig() ); 73 | } 74 | 75 | public void testDestinationDir() 76 | { 77 | File destinationDir = new File( "path/to/file" ); 78 | 79 | task.setDestinationDir( destinationDir ); 80 | 81 | assertEquals( destinationDir, task.getDestinationDir() ); 82 | } 83 | 84 | public void testMaxmem() 85 | { 86 | final String expectedValue128m = "128m"; 87 | 88 | task.setMaxmem( expectedValue128m ); 89 | 90 | assertEquals( expectedValue128m, task.getMaxmem() ); 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /src/test/java/org/codehaus/mojo/cobertura/tasks/ReportTaskTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * Mojo's Maven plugin for Cobertura 4 | * %% 5 | * Copyright (C) 2005 - 2013 Codehaus 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package org.codehaus.mojo.cobertura.tasks; 21 | 22 | /* 23 | * Copyright 2001-2006 The Apache Software Foundation. 24 | * 25 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 26 | * use this file except in compliance with the License. You may obtain a copy of 27 | * the License at 28 | * 29 | * http://www.apache.org/licenses/LICENSE-2.0 30 | * 31 | * Unless required by applicable law or agreed to in writing, software 32 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 33 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 34 | * License for the specific language governing permissions and limitations under 35 | * the License. 36 | */ 37 | 38 | import junit.framework.TestCase; 39 | 40 | import java.io.File; 41 | 42 | /** 43 | * @author Edwin Punzalan 44 | */ 45 | public class ReportTaskTest 46 | extends TestCase 47 | { 48 | private ReportTask task; 49 | 50 | protected void setUp() 51 | throws Exception 52 | { 53 | task = new ReportTask(); 54 | } 55 | 56 | public void testDataFile() 57 | { 58 | File dataFile = new File( "path/to/file" ); 59 | 60 | task.setDataFile( dataFile ); 61 | 62 | assertEquals( dataFile, task.getDataFile() ); 63 | } 64 | 65 | public void testOutputDir() 66 | { 67 | File outputDir = new File( "path/to/file" ); 68 | 69 | task.setOutputDirectory( outputDir ); 70 | 71 | assertEquals( outputDir, task.getOutputDirectory() ); 72 | } 73 | 74 | public void testOutputFormat() 75 | { 76 | String format = "format"; 77 | 78 | task.setOutputFormat( format ); 79 | 80 | assertEquals( format, task.getOutputFormat() ); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /src/test/plugin-configs/check-halt-plugin-config.xml: -------------------------------------------------------------------------------- 1 | 20 | 21 | 22 | 23 | 24 | cobertura-maven-plugin 25 | 26 | 27 | ${basedir}/target/test-harness/check/cobertura.ser 28 | 29 | 100 30 | 100 31 | true 32 | 100 33 | 100 34 | 100 35 | 100 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/test/plugin-configs/instrument-instrumentation-plugin-config.xml: -------------------------------------------------------------------------------- 1 | 20 | 21 | 22 | 23 | 24 | cobertura-maven-plugin 25 | 26 | 27 | ${basedir}/target/test-harness/instrument/cobertura.ser 28 | 29 | 30 | **/*Circle.class 31 | **/*Shape.class 32 | 33 | 34 | **/*Square.class 35 | **/*NoEdge.class 36 | 37 | 38 | **/*.java 39 | **/*.xml 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /src/test/plugin-configs/instrument-plugin-config.xml: -------------------------------------------------------------------------------- 1 | 20 | 21 | 22 | 23 | 24 | cobertura-maven-plugin 25 | 26 | 27 | ${basedir}/target/test-harness/instrument/cobertura.ser 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/test/plugin-configs/report-empty-src-plugin-config.xml: -------------------------------------------------------------------------------- 1 | 20 | 21 | 22 | 23 | 24 | cobertura-maven-plugin 25 | 26 | 27 | ${basedir}/target/test-harness/report-empty-src/cobertura.ser 28 | ${basedir}/target/test-harness/report-empty-src/site/cobertura 29 | html 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/test/plugin-configs/report-plugin-config.xml: -------------------------------------------------------------------------------- 1 | 20 | 21 | 22 | 23 | 24 | cobertura-maven-plugin 25 | 26 | 27 | ${basedir}/target/test-harness/report/cobertura.ser 28 | ${basedir}/target/test-harness/report/site/cobertura 29 | html 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/test/sources/check.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/test/sources/check.ser -------------------------------------------------------------------------------- /src/test/sources/report.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojohaus/cobertura-maven-plugin/29e9482b16ccb473f2c02cfe9425579db2d53a15/src/test/sources/report.ser --------------------------------------------------------------------------------