├── org.jacoco.ant.test └── src │ ├── org │ └── jacoco │ │ └── ant │ │ ├── data │ │ ├── sample.bad │ │ ├── keystore.jks │ │ ├── nomatch.exec │ │ ├── sample1.exec │ │ └── sample2.exec │ │ ├── DumpTaskTest.java │ │ ├── AgentTaskTest.java │ │ ├── MergeTaskTest.java │ │ └── DumpExecClassNames.java │ └── TestTargetInDefault.java ├── jacoco-maven-plugin.test └── it │ ├── it-report-unreadable-dump │ ├── data.txt │ ├── src │ │ └── main │ │ │ └── resources │ │ │ └── empty-file.txt │ ├── invoker.properties │ └── verify.bsh │ ├── it-java9 │ ├── invoker.properties │ └── src │ │ ├── test │ │ └── java │ │ │ └── ExampleTest.java │ │ └── main │ │ └── java │ │ └── Example.java │ ├── it-check-fails-halt │ ├── invoker.properties │ ├── src │ │ ├── main │ │ │ └── java │ │ │ │ └── Example.java │ │ └── test │ │ │ └── java │ │ │ └── ExampleTest.java │ └── verify.bsh │ ├── it-java9-offline-instrumentation │ ├── invoker.properties │ └── src │ │ ├── main │ │ └── java │ │ │ ├── module-info.java │ │ │ └── org │ │ │ └── example │ │ │ └── Example.java │ │ └── test │ │ └── java │ │ └── org │ │ └── example │ │ └── ExampleTest.java │ ├── setup-parent │ └── invoker.properties │ ├── it-report-nomatch │ ├── nomatch.exec │ └── src │ │ └── main │ │ └── java │ │ └── Example.java │ ├── it-site │ ├── invoker.properties │ └── src │ │ ├── main │ │ └── java │ │ │ └── Example.java │ │ └── test │ │ └── java │ │ └── ExampleTest.java │ ├── it-site-failsafe │ ├── invoker.properties │ └── src │ │ ├── test │ │ └── java │ │ │ ├── ExampleIT.java │ │ │ └── ExampleTest.java │ │ └── main │ │ └── java │ │ └── Example.java │ ├── it-customize-agent │ └── src │ │ ├── main │ │ └── java │ │ │ └── Example.java │ │ └── test │ │ └── java │ │ └── ExampleTest.java │ ├── it-multi-module │ ├── child │ │ ├── src │ │ │ ├── main │ │ │ │ └── java │ │ │ │ │ ├── Example.java │ │ │ │ │ └── somepackage │ │ │ │ │ └── Example.java │ │ │ └── test │ │ │ │ └── java │ │ │ │ └── ExampleTest.java │ │ └── pom.xml │ ├── skip-child │ │ ├── src │ │ │ └── test │ │ │ │ └── ExampleTest.java │ │ └── pom.xml │ └── child-jar-without-sources │ │ └── pom.xml │ ├── it-multiple-executions │ └── src │ │ ├── main │ │ └── java │ │ │ └── Example.java │ │ └── test │ │ └── java │ │ └── ExampleTest.java │ ├── it-report-without-debug │ ├── src │ │ ├── main │ │ │ └── java │ │ │ │ └── Example.java │ │ └── test │ │ │ └── java │ │ │ └── ExampleTest.java │ └── verify.bsh │ ├── it-report-aggregate │ ├── child1 │ │ ├── src │ │ │ ├── main │ │ │ │ └── java │ │ │ │ │ └── package1 │ │ │ │ │ ├── Example1a.java │ │ │ │ │ └── Example1b.java │ │ │ └── test │ │ │ │ └── java │ │ │ │ └── package1 │ │ │ │ └── Example1aTest.java │ │ └── pom.xml │ ├── child2 │ │ ├── src │ │ │ ├── main │ │ │ │ └── java │ │ │ │ │ └── package2 │ │ │ │ │ └── Example2.java │ │ │ └── test │ │ │ │ └── java │ │ │ │ └── package2 │ │ │ │ └── Example2Test.java │ │ └── pom.xml │ ├── child2v2 │ │ ├── src │ │ │ ├── main │ │ │ │ └── java │ │ │ │ │ └── package2 │ │ │ │ │ └── Example2.java │ │ │ └── test │ │ │ │ └── java │ │ │ │ └── package2 │ │ │ │ └── Example2Test.java │ │ └── pom.xml │ ├── report │ │ └── src │ │ │ └── test │ │ │ └── java │ │ │ └── packagereport │ │ │ └── ReportTest.java │ └── child1-test │ │ └── src │ │ └── test │ │ └── java │ │ └── package1 │ │ └── Example1bTest.java │ ├── it-offline-instrumentation │ ├── child │ │ ├── src │ │ │ ├── main │ │ │ │ └── java │ │ │ │ │ ├── Example.java │ │ │ │ │ └── DoNotInstrument.java │ │ │ └── test │ │ │ │ └── java │ │ │ │ └── ExampleTest.java │ │ └── pom.xml │ └── child-without-main-classes │ │ ├── src │ │ └── test │ │ │ └── java │ │ │ └── ExampleTest.java │ │ └── pom.xml │ ├── it-merge-passes │ ├── it-merge-passes-project1 │ │ ├── src │ │ │ ├── main │ │ │ │ └── java │ │ │ │ │ └── Example.java │ │ │ └── test │ │ │ │ └── java │ │ │ │ └── ExampleTest.java │ │ └── pom.xml │ ├── it-merge-passes-project2 │ │ ├── src │ │ │ ├── main │ │ │ │ └── java │ │ │ │ │ └── Example.java │ │ │ └── test │ │ │ │ └── java │ │ │ │ └── ExampleTest.java │ │ └── pom.xml │ └── verify.bsh │ ├── it-report-aggregate-customization │ ├── child1 │ │ ├── src │ │ │ ├── main │ │ │ │ └── java │ │ │ │ │ └── package1 │ │ │ │ │ └── Example1.java │ │ │ └── test │ │ │ │ └── java │ │ │ │ └── package1 │ │ │ │ └── Example1Test.java │ │ └── pom.xml │ └── child2 │ │ ├── src │ │ ├── main │ │ │ └── java │ │ │ │ └── package2 │ │ │ │ └── Example2.java │ │ └── test │ │ │ └── java │ │ │ └── package2 │ │ │ └── Example2Test.java │ │ └── pom.xml │ ├── it-check-passes │ ├── src │ │ ├── main │ │ │ └── java │ │ │ │ └── Example.java │ │ └── test │ │ │ └── java │ │ │ └── ExampleTest.java │ └── verify.bsh │ ├── it-includes-excludes │ └── src │ │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── project │ │ │ ├── FileUtil.java │ │ │ ├── TestUtil.java │ │ │ └── DatabaseUtil.java │ │ └── test │ │ └── java │ │ └── org │ │ └── project │ │ └── TestDatabaseUtil.java │ ├── it-check-fails-no-halt │ ├── src │ │ ├── main │ │ │ └── java │ │ │ │ └── Example.java │ │ └── test │ │ │ └── java │ │ │ └── ExampleTest.java │ └── verify.bsh │ ├── it-prepend-property-skip │ └── src │ │ └── test │ │ └── java │ │ └── ExampleTest.java │ ├── it-report-without-dump │ └── verify.bsh │ ├── it-dump │ ├── verify.bsh │ └── src │ │ └── main │ │ └── java │ │ └── Server.java │ └── it-prepend-property │ └── verify.bsh ├── report1.png ├── report2.png ├── jacoco_archive1.jpeg ├── jacoco_archive2.jpeg ├── jacoco_archive3.jpeg ├── org.jacoco.agent.rt.test ├── src │ └── org │ │ └── jacoco │ │ └── agent │ │ └── rt │ │ └── internal │ │ ├── agent-test.properties │ │ └── agent-subst-test.properties └── about.html ├── org.jacoco.doc ├── docroot │ └── doc │ │ ├── resources │ │ ├── group.gif │ │ ├── jar.gif │ │ ├── test.gif │ │ ├── extern.gif │ │ ├── report.gif │ │ ├── source.gif │ │ ├── flow-cond.png │ │ ├── flow-exit.png │ │ ├── flow-goto.png │ │ ├── testsuite.gif │ │ ├── flow-example.png │ │ ├── flow-cond-probe.png │ │ ├── flow-exit-probe.png │ │ ├── flow-goto-probe.png │ │ ├── flow-sequence.png │ │ ├── implementation.png │ │ └── flow-sequence-probe.png │ │ └── empty.html ├── about.html └── javadoc │ └── overview.html ├── org.jacoco.core ├── src │ └── org │ │ └── jacoco │ │ └── core │ │ ├── jacoco.properties │ │ ├── package-info.java │ │ ├── runtime │ │ └── package-info.java │ │ ├── data │ │ ├── package-info.java │ │ ├── IExecutionDataVisitor.java │ │ └── ISessionInfoVisitor.java │ │ ├── tools │ │ └── package-info.java │ │ ├── instr │ │ └── package-info.java │ │ ├── dao │ │ ├── CoverageRateRecordDao.java │ │ └── CoverageRecordDao.java │ │ ├── internal │ │ ├── flow │ │ │ ├── IProbeIdGenerator.java │ │ │ └── IFrame.java │ │ └── instr │ │ │ └── IProbeInserter.java │ │ └── analysis │ │ ├── ISourceFileCoverage.java │ │ ├── ICoverageVisitor.java │ │ ├── IBundleCoverage.java │ │ └── IMethodCoverage.java └── about.html ├── org.jacoco.report └── src │ └── org │ └── jacoco │ └── report │ ├── internal │ └── html │ │ ├── resources │ │ ├── up.gif │ │ ├── class.gif │ │ ├── down.gif │ │ ├── group.gif │ │ ├── sort.gif │ │ ├── branchfc.gif │ │ ├── branchnc.gif │ │ ├── branchpc.gif │ │ ├── bundle.gif │ │ ├── greenbar.gif │ │ ├── method.gif │ │ ├── package.gif │ │ ├── redbar.gif │ │ ├── report.gif │ │ ├── session.gif │ │ ├── source.gif │ │ ├── prettify.css │ │ └── package-info.java │ │ ├── index │ │ ├── package-info.java │ │ └── IIndexUpdate.java │ │ └── table │ │ ├── package-info.java │ │ └── ITableItem.java │ ├── csv │ └── package-info.java │ ├── xml │ └── package-info.java │ ├── check │ └── package-info.java │ ├── html │ └── package-info.java │ └── package-info.java ├── .gitignore ├── org.jacoco.build └── publish.sh ├── org.jacoco.startup ├── scripts │ ├── jacoco.conf │ └── jacoco.sh ├── coverage.sql ├── build │ └── src │ │ ├── test │ │ └── java │ │ │ └── org │ │ │ └── jacoco │ │ │ └── examples │ │ │ └── parser │ │ │ └── ExpressionParserIT.java │ │ └── main │ │ └── java │ │ └── org │ │ └── jacoco │ │ └── examples │ │ ├── expressions │ │ ├── IExpression.java │ │ ├── Const.java │ │ ├── Add.java │ │ ├── Div.java │ │ ├── Mul.java │ │ └── Sub.java │ │ └── parser │ │ └── Main.java ├── about.html └── assembly.xml ├── pom.xml ├── org.jacoco.agent ├── README.TXT └── src │ └── org │ └── jacoco │ └── agent │ └── package-info.java ├── LICENSE.md ├── org.jacoco.agent.rt └── src │ ├── com │ └── vladium │ │ └── emma │ │ └── rt │ │ └── package-info.java │ └── org │ └── jacoco │ └── agent │ └── rt │ ├── package-info.java │ ├── RT.java │ └── internal │ └── output │ └── NoneOutput.java ├── org.jacoco.startup.test ├── src │ └── test │ │ └── resources │ │ ├── verify.groovy │ │ ├── verify-it.groovy │ │ └── verify-offline.groovy └── about.html ├── org.jacoco.core.test.validation.kotlin └── src │ └── org │ └── jacoco │ └── core │ └── test │ └── validation │ └── kotlin │ ├── targets │ ├── KotlinTopLevelFunctionTarget.kt │ ├── KotlinUnsafeCastOperatorTarget.kt │ ├── KotlinLateinitTarget.kt │ ├── KotlinSafeCastTarget.kt │ ├── KotlinElvisOperatorTarget.kt │ ├── KotlinSafeCallOperatorTarget.kt │ └── KotlinNotNullOperatorTarget.kt │ ├── KotlinCoroutineTest.java │ ├── KotlinInlineTest.java │ ├── KotlinDataClassTest.java │ ├── KotlinLateinitTest.java │ ├── KotlinElvisOperatorTest.java │ ├── KotlinSafeCallOperatorTest.java │ ├── KotlinWhenExpressionTest.java │ ├── KotlinCallableReferenceTest.java │ ├── KotlinNotNullOperatorTest.java │ ├── KotlinTopLevelFunctionTest.java │ ├── KotlinDefaultArgumentsTest.java │ ├── KotlinUnsafeCastOperatorTest.java │ └── KotlinSafeCastTest.java ├── org.jacoco.core.test ├── src │ └── org │ │ └── jacoco │ │ └── core │ │ ├── runtime │ │ ├── LoggerRuntimeTest.java │ │ ├── SystemPropertiesRuntimeTest.java │ │ └── URLStreamHandlerRuntimeTest.java │ │ ├── test │ │ └── perf │ │ │ ├── IPerfScenario.java │ │ │ └── targets │ │ │ └── Target02.java │ │ └── JaCoCoTest.java └── about.html ├── org.jacoco.agent.test └── about.html ├── org.jacoco.cli.test ├── about.html └── src │ └── org │ └── jacoco │ └── cli │ └── internal │ └── commands │ └── VersionTest.java ├── org.jacoco.ant └── src │ └── org │ └── jacoco │ └── ant │ └── antlib.xml ├── org.jacoco.core.test.validation.java5 └── src │ └── org │ └── jacoco │ └── core │ └── test │ └── validation │ └── java5 │ ├── targets │ ├── AnnotationInitializerTarget.java │ ├── ExplicitInitialFrameTarget.java │ └── ImplicitFieldInitializationTarget.java │ ├── AnnotationGeneratedTest.java │ ├── EnumConstructorTest.java │ ├── ClassInitializerTest.java │ ├── ControlStructuresTest.java │ ├── BooleanExpressionsTest.java │ ├── ExplicitInitialFrameTest.java │ ├── ConstructorsTest.java │ ├── SyntheticTest.java │ ├── ImplicitFieldInitializationTest.java │ ├── FieldInitializationInTwoConstructorsTest.java │ └── ControlStructureBeforeSuperConstructorTest.java ├── org.jacoco.report.test └── src │ └── org │ └── jacoco │ └── report │ └── internal │ └── html │ └── HTMLSupport.java ├── org.jacoco.core.test.validation.java8 └── src │ └── org │ └── jacoco │ └── core │ └── test │ └── validation │ └── java8 │ ├── targets │ └── LambdaInInterfaceTarget.java │ ├── LambdaExpressionsTest.java │ ├── InterfaceOnlyDefaultMethodsTest.java │ ├── InterfaceDefaultMethodsTest.java │ └── AnnotationOnLocalVariableTest.java ├── org.jacoco.cli └── src │ └── org │ └── jacoco │ └── cli │ └── internal │ ├── CommandParser.java │ └── commands │ └── Version.java ├── org.jacoco.core.test.validation.java7 └── src │ └── org │ └── jacoco │ └── core │ └── test │ └── validation │ └── java7 │ └── StringSwitchTest.java ├── jacoco-maven-plugin └── META-INF │ └── m2e │ └── lifecycle-mapping-metadata.xml └── org.jacoco.core.test.validation.groovy └── src └── org └── jacoco └── core └── test └── validation └── groovy └── GroovyDataClassTest.java /org.jacoco.ant.test/src/org/jacoco/ant/data/sample.bad: -------------------------------------------------------------------------------- 1 | No exec file. -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-report-unreadable-dump/data.txt: -------------------------------------------------------------------------------- 1 | Invalid data 2 | -------------------------------------------------------------------------------- /report1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fang-yan-peng/diff-jacoco/HEAD/report1.png -------------------------------------------------------------------------------- /report2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fang-yan-peng/diff-jacoco/HEAD/report2.png -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-java9/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.java.version = 1.9+ 2 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-report-unreadable-dump/src/main/resources/empty-file.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-check-fails-halt/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.buildResult=failure -------------------------------------------------------------------------------- /jacoco_archive1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fang-yan-peng/diff-jacoco/HEAD/jacoco_archive1.jpeg -------------------------------------------------------------------------------- /jacoco_archive2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fang-yan-peng/diff-jacoco/HEAD/jacoco_archive2.jpeg -------------------------------------------------------------------------------- /jacoco_archive3.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fang-yan-peng/diff-jacoco/HEAD/jacoco_archive3.jpeg -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-report-unreadable-dump/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.buildResult = failure 2 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-java9-offline-instrumentation/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.java.version = 1.9+ 2 | -------------------------------------------------------------------------------- /org.jacoco.agent.rt.test/src/org/jacoco/agent/rt/internal/agent-test.properties: -------------------------------------------------------------------------------- 1 | output=tcpclient 2 | port=3333 -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/setup-parent/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals = org.jacoco:jacoco-maven-plugin:${project.version}:help install 2 | -------------------------------------------------------------------------------- /org.jacoco.doc/docroot/doc/resources/group.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fang-yan-peng/diff-jacoco/HEAD/org.jacoco.doc/docroot/doc/resources/group.gif -------------------------------------------------------------------------------- /org.jacoco.doc/docroot/doc/resources/jar.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fang-yan-peng/diff-jacoco/HEAD/org.jacoco.doc/docroot/doc/resources/jar.gif -------------------------------------------------------------------------------- /org.jacoco.doc/docroot/doc/resources/test.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fang-yan-peng/diff-jacoco/HEAD/org.jacoco.doc/docroot/doc/resources/test.gif -------------------------------------------------------------------------------- /org.jacoco.doc/docroot/doc/resources/extern.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fang-yan-peng/diff-jacoco/HEAD/org.jacoco.doc/docroot/doc/resources/extern.gif -------------------------------------------------------------------------------- /org.jacoco.doc/docroot/doc/resources/report.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fang-yan-peng/diff-jacoco/HEAD/org.jacoco.doc/docroot/doc/resources/report.gif -------------------------------------------------------------------------------- /org.jacoco.doc/docroot/doc/resources/source.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fang-yan-peng/diff-jacoco/HEAD/org.jacoco.doc/docroot/doc/resources/source.gif -------------------------------------------------------------------------------- /org.jacoco.doc/docroot/doc/resources/flow-cond.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fang-yan-peng/diff-jacoco/HEAD/org.jacoco.doc/docroot/doc/resources/flow-cond.png -------------------------------------------------------------------------------- /org.jacoco.doc/docroot/doc/resources/flow-exit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fang-yan-peng/diff-jacoco/HEAD/org.jacoco.doc/docroot/doc/resources/flow-exit.png -------------------------------------------------------------------------------- /org.jacoco.doc/docroot/doc/resources/flow-goto.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fang-yan-peng/diff-jacoco/HEAD/org.jacoco.doc/docroot/doc/resources/flow-goto.png -------------------------------------------------------------------------------- /org.jacoco.doc/docroot/doc/resources/testsuite.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fang-yan-peng/diff-jacoco/HEAD/org.jacoco.doc/docroot/doc/resources/testsuite.gif -------------------------------------------------------------------------------- /org.jacoco.core/src/org/jacoco/core/jacoco.properties: -------------------------------------------------------------------------------- 1 | VERSION=$qualified.bundle.version$ 2 | HOMEURL=$jacoco.home.url$ 3 | RUNTIMEPACKAGE=$jacoco.runtime.package.name$ -------------------------------------------------------------------------------- /org.jacoco.doc/docroot/doc/resources/flow-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fang-yan-peng/diff-jacoco/HEAD/org.jacoco.doc/docroot/doc/resources/flow-example.png -------------------------------------------------------------------------------- /org.jacoco.ant.test/src/org/jacoco/ant/data/keystore.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fang-yan-peng/diff-jacoco/HEAD/org.jacoco.ant.test/src/org/jacoco/ant/data/keystore.jks -------------------------------------------------------------------------------- /org.jacoco.ant.test/src/org/jacoco/ant/data/nomatch.exec: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fang-yan-peng/diff-jacoco/HEAD/org.jacoco.ant.test/src/org/jacoco/ant/data/nomatch.exec -------------------------------------------------------------------------------- /org.jacoco.ant.test/src/org/jacoco/ant/data/sample1.exec: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fang-yan-peng/diff-jacoco/HEAD/org.jacoco.ant.test/src/org/jacoco/ant/data/sample1.exec -------------------------------------------------------------------------------- /org.jacoco.ant.test/src/org/jacoco/ant/data/sample2.exec: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fang-yan-peng/diff-jacoco/HEAD/org.jacoco.ant.test/src/org/jacoco/ant/data/sample2.exec -------------------------------------------------------------------------------- /org.jacoco.doc/docroot/doc/resources/flow-cond-probe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fang-yan-peng/diff-jacoco/HEAD/org.jacoco.doc/docroot/doc/resources/flow-cond-probe.png -------------------------------------------------------------------------------- /org.jacoco.doc/docroot/doc/resources/flow-exit-probe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fang-yan-peng/diff-jacoco/HEAD/org.jacoco.doc/docroot/doc/resources/flow-exit-probe.png -------------------------------------------------------------------------------- /org.jacoco.doc/docroot/doc/resources/flow-goto-probe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fang-yan-peng/diff-jacoco/HEAD/org.jacoco.doc/docroot/doc/resources/flow-goto-probe.png -------------------------------------------------------------------------------- /org.jacoco.doc/docroot/doc/resources/flow-sequence.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fang-yan-peng/diff-jacoco/HEAD/org.jacoco.doc/docroot/doc/resources/flow-sequence.png -------------------------------------------------------------------------------- /org.jacoco.doc/docroot/doc/resources/implementation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fang-yan-peng/diff-jacoco/HEAD/org.jacoco.doc/docroot/doc/resources/implementation.png -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-report-nomatch/nomatch.exec: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fang-yan-peng/diff-jacoco/HEAD/jacoco-maven-plugin.test/it/it-report-nomatch/nomatch.exec -------------------------------------------------------------------------------- /org.jacoco.doc/docroot/doc/resources/flow-sequence-probe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fang-yan-peng/diff-jacoco/HEAD/org.jacoco.doc/docroot/doc/resources/flow-sequence-probe.png -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-site/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals = clean test site 2 | 3 | # maven-site-plugin 3.0 requires at least Maven 2.2.0 4 | invoker.maven.version = 2.2.0+ 5 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-site-failsafe/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals = clean verify site 2 | 3 | # maven-site-plugin 3.3 works with at least Maven 2.2.1+ 4 | invoker.maven.version = 2.2.1+ 5 | -------------------------------------------------------------------------------- /org.jacoco.report/src/org/jacoco/report/internal/html/resources/up.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fang-yan-peng/diff-jacoco/HEAD/org.jacoco.report/src/org/jacoco/report/internal/html/resources/up.gif -------------------------------------------------------------------------------- /org.jacoco.report/src/org/jacoco/report/internal/html/resources/class.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fang-yan-peng/diff-jacoco/HEAD/org.jacoco.report/src/org/jacoco/report/internal/html/resources/class.gif -------------------------------------------------------------------------------- /org.jacoco.report/src/org/jacoco/report/internal/html/resources/down.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fang-yan-peng/diff-jacoco/HEAD/org.jacoco.report/src/org/jacoco/report/internal/html/resources/down.gif -------------------------------------------------------------------------------- /org.jacoco.report/src/org/jacoco/report/internal/html/resources/group.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fang-yan-peng/diff-jacoco/HEAD/org.jacoco.report/src/org/jacoco/report/internal/html/resources/group.gif -------------------------------------------------------------------------------- /org.jacoco.report/src/org/jacoco/report/internal/html/resources/sort.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fang-yan-peng/diff-jacoco/HEAD/org.jacoco.report/src/org/jacoco/report/internal/html/resources/sort.gif -------------------------------------------------------------------------------- /org.jacoco.report/src/org/jacoco/report/internal/html/resources/branchfc.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fang-yan-peng/diff-jacoco/HEAD/org.jacoco.report/src/org/jacoco/report/internal/html/resources/branchfc.gif -------------------------------------------------------------------------------- /org.jacoco.report/src/org/jacoco/report/internal/html/resources/branchnc.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fang-yan-peng/diff-jacoco/HEAD/org.jacoco.report/src/org/jacoco/report/internal/html/resources/branchnc.gif -------------------------------------------------------------------------------- /org.jacoco.report/src/org/jacoco/report/internal/html/resources/branchpc.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fang-yan-peng/diff-jacoco/HEAD/org.jacoco.report/src/org/jacoco/report/internal/html/resources/branchpc.gif -------------------------------------------------------------------------------- /org.jacoco.report/src/org/jacoco/report/internal/html/resources/bundle.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fang-yan-peng/diff-jacoco/HEAD/org.jacoco.report/src/org/jacoco/report/internal/html/resources/bundle.gif -------------------------------------------------------------------------------- /org.jacoco.report/src/org/jacoco/report/internal/html/resources/greenbar.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fang-yan-peng/diff-jacoco/HEAD/org.jacoco.report/src/org/jacoco/report/internal/html/resources/greenbar.gif -------------------------------------------------------------------------------- /org.jacoco.report/src/org/jacoco/report/internal/html/resources/method.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fang-yan-peng/diff-jacoco/HEAD/org.jacoco.report/src/org/jacoco/report/internal/html/resources/method.gif -------------------------------------------------------------------------------- /org.jacoco.report/src/org/jacoco/report/internal/html/resources/package.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fang-yan-peng/diff-jacoco/HEAD/org.jacoco.report/src/org/jacoco/report/internal/html/resources/package.gif -------------------------------------------------------------------------------- /org.jacoco.report/src/org/jacoco/report/internal/html/resources/redbar.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fang-yan-peng/diff-jacoco/HEAD/org.jacoco.report/src/org/jacoco/report/internal/html/resources/redbar.gif -------------------------------------------------------------------------------- /org.jacoco.report/src/org/jacoco/report/internal/html/resources/report.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fang-yan-peng/diff-jacoco/HEAD/org.jacoco.report/src/org/jacoco/report/internal/html/resources/report.gif -------------------------------------------------------------------------------- /org.jacoco.report/src/org/jacoco/report/internal/html/resources/session.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fang-yan-peng/diff-jacoco/HEAD/org.jacoco.report/src/org/jacoco/report/internal/html/resources/session.gif -------------------------------------------------------------------------------- /org.jacoco.report/src/org/jacoco/report/internal/html/resources/source.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fang-yan-peng/diff-jacoco/HEAD/org.jacoco.report/src/org/jacoco/report/internal/html/resources/source.gif -------------------------------------------------------------------------------- /org.jacoco.agent.rt.test/src/org/jacoco/agent/rt/internal/agent-subst-test.properties: -------------------------------------------------------------------------------- 1 | key0=no$replace} 2 | key1=${user.home}/coverage/jacoco-${java.version}.exec 3 | key2=$${user.home} 4 | key3=${user.home}}} 5 | key4=${does.not.exist} -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | *.class 3 | 4 | .project 5 | .classpath 6 | .settings 7 | target 8 | 9 | # Package Files # 10 | *.jar 11 | *.war 12 | *.ear 13 | 14 | .idea 15 | *.iml 16 | 17 | .DS_Store 18 | 19 | Maven_*.xml 20 | -------------------------------------------------------------------------------- /org.jacoco.build/publish.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | 3 | if [ "$1" = "" ]; then 4 | echo "Usage: $0 " 5 | exit 1 6 | fi 7 | 8 | USERNAME=$1 9 | 10 | ssh $USERNAME,eclemma@shell.sourceforge.net create 11 | ssh $USERNAME,eclemma@shell.sourceforge.net '/home/project-web/eclemma/scripts/publish-jacoco-snapshot.sh' 12 | -------------------------------------------------------------------------------- /org.jacoco.startup/scripts/jacoco.conf: -------------------------------------------------------------------------------- 1 | # Datasource config for jacoco 2 | 3 | MYSQL_JDBC_URL="jdbc:mysql://127.0.0.1:3306/store?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8" 4 | 5 | MYSQL_USER=yanpengfang 6 | 7 | MYSQL_PASSWORD=272777475 8 | 9 | LOG_PATH=./logs 10 | 11 | # Java Heap options 12 | JAVA_HEAP_OPTS="-Xms1024m -Xmx2048m -XX:MaxNewSize=256m" -------------------------------------------------------------------------------- /org.jacoco.report/src/org/jacoco/report/internal/html/resources/prettify.css: -------------------------------------------------------------------------------- 1 | /* Pretty printing styles. Used with prettify.js. */ 2 | 3 | .str { color: #2A00FF; } 4 | .kwd { color: #7F0055; font-weight:bold; } 5 | .com { color: #3F5FBF; } 6 | .typ { color: #606; } 7 | .lit { color: #066; } 8 | .pun { color: #660; } 9 | .pln { color: #000; } 10 | .tag { color: #008; } 11 | .atn { color: #606; } 12 | .atv { color: #080; } 13 | .dec { color: #606; } 14 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | org.jacoco 5 | root 6 | 0.8.4 7 | pom 8 | 9 | 10 | org.jacoco.build 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /org.jacoco.agent/README.TXT: -------------------------------------------------------------------------------- 1 | This bundle provides the coverage agent "jacocoagent.jar" as a resource. The 2 | agent JAR is created as part of the build process and therefore not available in 3 | the source tree. Which means this bundle is incomplete when directly used in the 4 | Eclise IDE. If you want to use the bundle org.jacoco.agent within the IDE, 5 | please run the local build (see documentation) first. 6 | 7 | The jacocoagent.jar file is created by the build at 8 | 9 | /org.jacoco.agent/target/classes/jacocoagent.jar 10 | 11 | and linked by this project. 12 | -------------------------------------------------------------------------------- /org.jacoco.startup/coverage.sql: -------------------------------------------------------------------------------- 1 | create table coverage_record( 2 | id bigint primary key auto_increment, 3 | project varchar(64), 4 | class_name varchar(128), 5 | method varchar(64), 6 | line varchar(128), 7 | method_md5 char(32), 8 | line_md5 char(32), 9 | type char(2), 10 | unique key p_c_m_l(project, class_name, method_md5, line_md5), 11 | key p_c_m(project, class_name, method) 12 | ); 13 | 14 | create table coverage_rate_record( 15 | id bigint primary key auto_increment, 16 | project varchar(64), 17 | class_name varchar(128), 18 | method varchar(64), 19 | covered int, 20 | unique key p_c_m(project, class_name, method) 21 | ); -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-report-nomatch/src/main/java/Example.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | public class Example { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-java9-offline-instrumentation/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | module org.example { 13 | } 14 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | License 2 | ======= 3 | 4 | Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 5 | 6 | The JaCoCo Java Code Coverage Library and all included documentation is made 7 | available by Mountainminds GmbH & Co. KG, Munich. Except indicated below, the 8 | Content is provided to you under the terms and conditions of the Eclipse Public 9 | License Version 1.0 ("EPL"). A copy of the EPL is available at 10 | [http://www.eclipse.org/legal/epl-v10.html](http://www.eclipse.org/legal/epl-v10.html). 11 | 12 | Please visit 13 | [http://www.jacoco.org/jacoco/trunk/doc/license.html](http://www.jacoco.org/jacoco/trunk/doc/license.html) 14 | for the complete license information including third party licenses and trademarks. 15 | -------------------------------------------------------------------------------- /org.jacoco.core/src/org/jacoco/core/package-info.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | 13 | /** 14 | * Meta information about JaCoCo. 15 | */ 16 | package org.jacoco.core; 17 | -------------------------------------------------------------------------------- /org.jacoco.report/src/org/jacoco/report/csv/package-info.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Brock Janiczak - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | 13 | /** 14 | * CSV report implementation. 15 | */ 16 | package org.jacoco.report.csv; 17 | -------------------------------------------------------------------------------- /org.jacoco.report/src/org/jacoco/report/xml/package-info.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Brock Janiczak - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | 13 | /** 14 | * XML report implementation. 15 | */ 16 | package org.jacoco.report.xml; 17 | -------------------------------------------------------------------------------- /org.jacoco.report/src/org/jacoco/report/check/package-info.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | 13 | /** 14 | * Rules check implementation. 15 | */ 16 | package org.jacoco.report.check; 17 | -------------------------------------------------------------------------------- /org.jacoco.report/src/org/jacoco/report/html/package-info.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | 13 | /** 14 | * HTML report implementation. 15 | */ 16 | package org.jacoco.report.html; 17 | -------------------------------------------------------------------------------- /org.jacoco.agent.rt/src/com/vladium/emma/rt/package-info.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | 13 | /** 14 | * Compatibility API for EMMA runtime. 15 | */ 16 | package com.vladium.emma.rt; 17 | -------------------------------------------------------------------------------- /org.jacoco.ant.test/src/TestTargetInDefault.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | 13 | /** 14 | * Test target in default directory. 15 | */ 16 | public class TestTargetInDefault { 17 | 18 | } 19 | -------------------------------------------------------------------------------- /org.jacoco.agent/src/org/jacoco/agent/package-info.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | 13 | /** 14 | * Provides the runtime Java agent (JAR file) as a resource. 15 | */ 16 | package org.jacoco.agent; 17 | -------------------------------------------------------------------------------- /org.jacoco.report/src/org/jacoco/report/package-info.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | 13 | /** 14 | * Common interfaces and utilities for report generation. 15 | */ 16 | package org.jacoco.report; 17 | -------------------------------------------------------------------------------- /org.jacoco.core/src/org/jacoco/core/runtime/package-info.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | 13 | /** 14 | * Runtime control and execution data collection. 15 | */ 16 | package org.jacoco.core.runtime; 17 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-site/src/main/java/Example.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | public class Example { 13 | 14 | public void sayHello() { 15 | System.out.println("Hello world"); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /org.jacoco.agent.rt/src/org/jacoco/agent/rt/package-info.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | 13 | /** 14 | * API to access the JaCoCo agent from within the JVM under test. 15 | */ 16 | package org.jacoco.agent.rt; 17 | -------------------------------------------------------------------------------- /org.jacoco.startup/build/src/test/java/org/jacoco/examples/parser/ExpressionParserIT.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Mirko Friedenhagen - initial 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.startup.parser; 13 | 14 | public class ExpressionParserIT extends ExpressionParserTest { 15 | } 16 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-customize-agent/src/main/java/Example.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | public class Example { 13 | 14 | public void sayHello() { 15 | System.out.println("Hello world"); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /org.jacoco.core/src/org/jacoco/core/data/package-info.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | 13 | /** 14 | * Representation and persistence of execution data and session information. 15 | */ 16 | package org.jacoco.core.data; 17 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-multi-module/child/src/main/java/Example.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | public class Example { 13 | 14 | public void sayHello() { 15 | System.out.println("Hello world"); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-multiple-executions/src/main/java/Example.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | public class Example { 13 | 14 | public void sayHello() { 15 | System.out.println("Hello world"); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-report-without-debug/src/main/java/Example.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | public class Example { 13 | 14 | public void sayHello() { 15 | System.out.println("Hello world"); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /org.jacoco.report/src/org/jacoco/report/internal/html/index/package-info.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | 13 | /** 14 | * Internal: Index generation for HTML reports. 15 | */ 16 | package org.jacoco.report.internal.html.index; 17 | -------------------------------------------------------------------------------- /org.jacoco.report/src/org/jacoco/report/internal/html/resources/package-info.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | 13 | /** 14 | * Internal: Resources for HTML reports. 15 | */ 16 | package org.jacoco.report.internal.html.resources; 17 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-multi-module/skip-child/src/test/ExampleTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | import org.junit.Test; 13 | 14 | public class ExampleTest { 15 | 16 | @Test 17 | public void test() { 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-report-aggregate/child1/src/main/java/package1/Example1a.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann, Jan Wloka - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package package1; 13 | 14 | public class Example1a { 15 | 16 | public void a() { 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-report-aggregate/child1/src/main/java/package1/Example1b.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann, Jan Wloka - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package package1; 13 | 14 | public class Example1b { 15 | 16 | public void b() { 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-report-aggregate/child2/src/main/java/package2/Example2.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann, Jan Wloka - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package package2; 13 | 14 | public class Example2 { 15 | 16 | public void a() { 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-report-aggregate/child2v2/src/main/java/package2/Example2.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann, Jan Wloka - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package package2; 13 | 14 | public class Example2 { 15 | 16 | public void a() { 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-offline-instrumentation/child/src/main/java/Example.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | public class Example { 13 | 14 | public void sayHello() { 15 | System.out.println("Hello world"); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /org.jacoco.report/src/org/jacoco/report/internal/html/table/package-info.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | 13 | /** 14 | * Internal: Sortable HTML table for coverage node elements. 15 | */ 16 | package org.jacoco.report.internal.html.table; 17 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-merge-passes/it-merge-passes-project1/src/main/java/Example.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Mads Mohr Christensen - implementation of MergeMojo 10 | * 11 | *******************************************************************************/ 12 | public class Example { 13 | 14 | public void sayHello() { 15 | System.out.println("Hello world"); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-merge-passes/it-merge-passes-project2/src/main/java/Example.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Mads Mohr Christensen - implementation of MergeMojo 10 | * 11 | *******************************************************************************/ 12 | public class Example { 13 | 14 | public void sayHello() { 15 | System.out.println("Hello world"); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-report-aggregate-customization/child1/src/main/java/package1/Example1.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann, Jan Wloka - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package package1; 13 | 14 | public class Example1 { 15 | 16 | public void a() { 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-report-aggregate-customization/child2/src/main/java/package2/Example2.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann, Jan Wloka - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package package2; 13 | 14 | public class Example2 { 15 | 16 | public void a() { 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /org.jacoco.startup/build/src/main/java/org/jacoco/examples/expressions/IExpression.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.startup.expressions; 13 | 14 | public interface IExpression { 15 | 16 | public double evaluate(); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /org.jacoco.startup/scripts/jacoco.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | BASEDIR=$(cd `dirname $0`; pwd) 4 | 5 | JACOCO_HOME=$BASEDIR/.. 6 | 7 | LIB_HOME=$JACOCO_HOME/lib 8 | 9 | CONF_FILE=$JACOCO_HOME/conf/jacoco.conf 10 | . $CONF_FILE 11 | 12 | SERVICE_NAME='org.jacoco.startup.ReportGenerator' 13 | 14 | LIB_JARS=`ls $LIB_HOME|grep .jar|awk '{print "'$LIB_HOME'/"$0}'|tr "\n" ":"` 15 | 16 | # JAVA_OPTS 17 | JAVA_OPTS="-server $JAVA_HEAP_OPTS" 18 | JAVA_OPTS="${JAVA_OPTS} -XX:+UseConcMarkSweepGC -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDetails -XX:HeapDumpPath=$LOG_PATH -Xloggc:$LOG_PATH/gc.log" 19 | 20 | # CONFIG_OPTS 21 | CONFIG_OPTS="--mysql-jdbc-url $MYSQL_JDBC_URL --mysql-user $MYSQL_USER --mysql-password $MYSQL_PASSWORD" 22 | 23 | java $JAVA_OPTS -cp $LIB_JARS $SERVICE_NAME $CONFIG_OPTS $@ > $LOG_PATH/jacoco.log 2>&1 -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-offline-instrumentation/child/src/main/java/DoNotInstrument.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | public class DoNotInstrument { 13 | 14 | public void sayHello() { 15 | System.out.println("Hello world"); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-site/src/test/java/ExampleTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | import org.junit.Test; 13 | 14 | public class ExampleTest { 15 | 16 | @Test 17 | public void test() { 18 | new Example().sayHello(); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-java9/src/test/java/ExampleTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | import org.junit.Test; 13 | 14 | public class ExampleTest { 15 | 16 | @Test 17 | public void test() { 18 | new Example().sayHello("test"); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-site-failsafe/src/test/java/ExampleIT.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | import org.junit.Test; 13 | 14 | public class ExampleIT { 15 | 16 | @Test 17 | public void test() { 18 | new Example().sayHelloIT(); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-site-failsafe/src/test/java/ExampleTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | import org.junit.Test; 13 | 14 | public class ExampleTest { 15 | 16 | @Test 17 | public void test() { 18 | new Example().sayHello(); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-customize-agent/src/test/java/ExampleTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | import org.junit.Test; 13 | 14 | public class ExampleTest { 15 | 16 | @Test 17 | public void test() { 18 | new Example().sayHello(); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-multi-module/child/src/test/java/ExampleTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | import org.junit.Test; 13 | 14 | public class ExampleTest { 15 | 16 | @Test 17 | public void test() { 18 | new Example().sayHello(); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-multiple-executions/src/test/java/ExampleTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | import org.junit.Test; 13 | 14 | public class ExampleTest { 15 | 16 | @Test 17 | public void test() { 18 | new Example().sayHello(); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-offline-instrumentation/child-without-main-classes/src/test/java/ExampleTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | import org.junit.Test; 13 | 14 | public class ExampleTest { 15 | 16 | @Test 17 | public void test() { 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-check-passes/src/main/java/Example.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * Kyle Lieber - implementation of CheckMojo 11 | * 12 | *******************************************************************************/ 13 | public class Example { 14 | 15 | public void sayHello() { 16 | System.out.println("Hello world"); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-includes-excludes/src/main/java/org/project/FileUtil.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.project; 13 | 14 | 15 | public class FileUtil { 16 | public void doStuff() { 17 | System.out.println("Do FileUtil Stuff"); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-includes-excludes/src/main/java/org/project/TestUtil.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.project; 13 | 14 | 15 | public class TestUtil { 16 | public void doStuff() { 17 | System.out.println("Do TestUtil Stuff"); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-java9/src/main/java/Example.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | public class Example { 13 | 14 | public void sayHello(String name) { 15 | // http://openjdk.java.net/jeps/280 16 | System.out.println("Hello, " + name); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-multi-module/child/src/main/java/somepackage/Example.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package somepackage; 13 | 14 | public class Example { 15 | 16 | public void sayHello() { 17 | System.out.println("Hello world"); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-report-without-debug/src/test/java/ExampleTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | import org.junit.Test; 13 | 14 | public class ExampleTest { 15 | 16 | @Test 17 | public void test() { 18 | new Example().sayHello(); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-check-fails-halt/src/main/java/Example.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * Kyle Lieber - implementation of CheckMojo 11 | * 12 | *******************************************************************************/ 13 | public class Example { 14 | 15 | public void sayHello() { 16 | System.out.println("Hello world"); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-offline-instrumentation/child/src/test/java/ExampleTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | import org.junit.Test; 13 | 14 | public class ExampleTest { 15 | 16 | @Test 17 | public void test() { 18 | new Example().sayHello(); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-check-fails-no-halt/src/main/java/Example.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * Kyle Lieber - implementation of CheckMojo 11 | * 12 | *******************************************************************************/ 13 | public class Example { 14 | 15 | public void sayHello() { 16 | System.out.println("Hello world"); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-includes-excludes/src/main/java/org/project/DatabaseUtil.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.project; 13 | 14 | 15 | public class DatabaseUtil { 16 | public void doStuff() { 17 | System.out.println("Do DatabaseUtil Stuff"); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-java9-offline-instrumentation/src/main/java/org/example/Example.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.example; 13 | 14 | public class Example { 15 | 16 | public void sayHello() { 17 | System.out.println("Hello world"); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-report-aggregate/report/src/test/java/packagereport/ReportTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package packagereport; 13 | 14 | import org.junit.Test; 15 | 16 | public class ReportTest { 17 | 18 | @Test 19 | public void test() { 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-merge-passes/it-merge-passes-project1/src/test/java/ExampleTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Mads Mohr Christensen - implementation of MergeMojo 10 | * 11 | *******************************************************************************/ 12 | import org.junit.Test; 13 | 14 | public class ExampleTest { 15 | 16 | @Test 17 | public void test() { 18 | new Example().sayHello(); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-merge-passes/it-merge-passes-project2/src/test/java/ExampleTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Mads Mohr Christensen - implementation of MergeMojo 10 | * 11 | *******************************************************************************/ 12 | import org.junit.Test; 13 | 14 | public class ExampleTest { 15 | 16 | @Test 17 | public void test() { 18 | new Example().sayHello(); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /org.jacoco.core/src/org/jacoco/core/tools/package-info.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | 13 | /** 14 | * Collection of tools build on top of the JaCoCo core APIs. The tools offer 15 | * more high-level functionality useful for integrating JaCoCo. 16 | */ 17 | package org.jacoco.core.tools; 18 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-check-fails-halt/src/test/java/ExampleTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * Kyle Lieber - implementation of CheckMojo 11 | * 12 | *******************************************************************************/ 13 | import org.junit.Test; 14 | 15 | public class ExampleTest { 16 | 17 | @Test 18 | public void test() { 19 | new Example(); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-check-fails-no-halt/src/test/java/ExampleTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * Kyle Lieber - implementation of CheckMojo 11 | * 12 | *******************************************************************************/ 13 | import org.junit.Test; 14 | 15 | public class ExampleTest { 16 | 17 | @Test 18 | public void test() { 19 | new Example(); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-site-failsafe/src/main/java/Example.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | public class Example { 13 | 14 | public void sayHello() { 15 | System.out.println("Hello world"); 16 | } 17 | 18 | public void sayHelloIT() { 19 | System.out.println("Hello world"); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-check-passes/src/test/java/ExampleTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * Kyle Lieber - implementation of CheckMojo 11 | * 12 | *******************************************************************************/ 13 | import org.junit.Test; 14 | 15 | public class ExampleTest { 16 | 17 | @Test 18 | public void test() { 19 | new Example().sayHello(); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-report-aggregate/child2/src/test/java/package2/Example2Test.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann, Jan Wloka - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package package2; 13 | 14 | import org.junit.Test; 15 | 16 | public class Example2Test { 17 | 18 | @Test 19 | public void test() { 20 | new Example2().a(); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /org.jacoco.core/src/org/jacoco/core/instr/package-info.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | 13 | /** 14 | *

15 | * Instrumentation of Java class files for code coverage. The main entry point 16 | * is the class {@link org.jacoco.core.instr.Instrumenter}. 17 | *

18 | */ 19 | package org.jacoco.core.instr; 20 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-includes-excludes/src/test/java/org/project/TestDatabaseUtil.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.project; 13 | 14 | import org.junit.Test; 15 | 16 | public class TestDatabaseUtil { 17 | @Test 18 | public void testDoStuff() { 19 | new DatabaseUtil().doStuff(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-java9-offline-instrumentation/src/test/java/org/example/ExampleTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.example; 13 | 14 | import org.junit.Test; 15 | 16 | public class ExampleTest { 17 | 18 | @Test 19 | public void test() { 20 | new Example().sayHello(); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-report-aggregate/child1/src/test/java/package1/Example1aTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann, Jan Wloka - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package package1; 13 | 14 | import org.junit.Test; 15 | 16 | public class Example1aTest { 17 | 18 | @Test 19 | public void test() { 20 | new Example1a().a(); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-report-aggregate/child2v2/src/test/java/package2/Example2Test.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann, Jan Wloka - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package package2; 13 | 14 | import org.junit.Test; 15 | 16 | public class Example2Test { 17 | 18 | @Test 19 | public void test() { 20 | new Example2().a(); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /org.jacoco.startup.test/src/test/resources/verify.groovy: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Mirko Friedenhagen - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | File realBaseDir = new File(basedir, "../../../target/it/build"); 13 | assert new File(realBaseDir, "target/site/jacoco/index.html").exists(); 14 | assert !new File(realBaseDir, "target/site/jacoco-it/index.html").exists(); 15 | return true; 16 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-report-aggregate/child1-test/src/test/java/package1/Example1bTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann, Jan Wloka - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package package1; 13 | 14 | import org.junit.Test; 15 | 16 | public class Example1bTest { 17 | 18 | @Test 19 | public void test() { 20 | new Example1b().b(); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /org.jacoco.startup.test/src/test/resources/verify-it.groovy: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Mirko Friedenhagen - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | File realBaseDir = new File(basedir, "../../../target/it-it/build"); 13 | assert new File(realBaseDir, "target/site/jacoco/index.html").exists(); 14 | assert new File(realBaseDir, "target/site/jacoco-it/index.html").exists(); 15 | return true; 16 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-report-aggregate-customization/child1/src/test/java/package1/Example1Test.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann, Jan Wloka - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package package1; 13 | 14 | import org.junit.Test; 15 | 16 | public class Example1Test { 17 | 18 | @Test 19 | public void test() { 20 | new Example1().a(); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-report-aggregate-customization/child2/src/test/java/package2/Example2Test.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann, Jan Wloka - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package package2; 13 | 14 | import org.junit.Test; 15 | 16 | public class Example2Test { 17 | 18 | @Test 19 | public void test() { 20 | new Example2().a(); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /org.jacoco.core.test.validation.kotlin/src/org/jacoco/core/test/validation/kotlin/targets/KotlinTopLevelFunctionTarget.kt: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.test.validation.kotlin.targets 13 | 14 | /** 15 | * This test target is top level function. 16 | */ 17 | fun main(args: Array) { 18 | } // assertFullyCovered() 19 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-prepend-property-skip/src/test/java/ExampleTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | import org.junit.Test; 13 | 14 | import static org.junit.Assert.assertNotNull; 15 | 16 | public class ExampleTest { 17 | 18 | @Test 19 | public void test() { 20 | assertNotNull(System.getProperty("foo")); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-report-unreadable-dump/verify.bsh: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | import java.io.*; 13 | import org.codehaus.plexus.util.*; 14 | 15 | String buildLog = FileUtils.fileRead( new File( basedir, "build.log" ) ); 16 | if ( buildLog.indexOf( "Invalid execution data file." ) < 0 ) { 17 | throw new RuntimeException( "Error was not printed" ); 18 | } 19 | -------------------------------------------------------------------------------- /org.jacoco.core.test/src/org/jacoco/core/runtime/LoggerRuntimeTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.runtime; 13 | 14 | /** 15 | * Unit tests for {@link LoggerRuntime}. 16 | */ 17 | public class LoggerRuntimeTest extends RuntimeTestBase { 18 | 19 | @Override 20 | IRuntime createRuntime() { 21 | return new LoggerRuntime(); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-report-without-debug/verify.bsh: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | import java.io.*; 13 | import org.codehaus.plexus.util.*; 14 | 15 | String buildLog = FileUtils.fileRead( new File( basedir, "build.log" ) ); 16 | if ( buildLog.indexOf( "with debug information" ) < 0 ) { 17 | throw new RuntimeException( "No warning about debug information" ); 18 | } 19 | -------------------------------------------------------------------------------- /org.jacoco.core/about.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | About 6 | 7 | 8 | 9 |

About This Content

10 | 11 |

12 | @build.date@ 13 |

14 | 15 |

License

16 | 17 |

18 | All Content in this plug-in is made available by Mountainminds GmbH & Co. 19 | KG, Munich. Unless otherwise indicated below, the Content is provided to you 20 | under the terms and conditions of the Eclipse Public License Version 1.0 21 | ("EPL"). A copy of the EPL is available at 22 | http://www.eclipse.org/legal/epl-v10.html. 23 | For purposes of the EPL, "Program" will mean the Content. 24 |

25 | 26 | 27 | -------------------------------------------------------------------------------- /org.jacoco.doc/about.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | About 6 | 7 | 8 | 9 |

About This Content

10 | 11 |

12 | @build.date@ 13 |

14 | 15 |

License

16 | 17 |

18 | All Content in this plug-in is made available by Mountainminds GmbH & Co. 19 | KG, Munich. Unless otherwise indicated below, the Content is provided to you 20 | under the terms and conditions of the Eclipse Public License Version 1.0 21 | ("EPL"). A copy of the EPL is available at 22 | http://www.eclipse.org/legal/epl-v10.html. 23 | For purposes of the EPL, "Program" will mean the Content. 24 |

25 | 26 | 27 | -------------------------------------------------------------------------------- /org.jacoco.agent.test/about.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | About 6 | 7 | 8 | 9 |

About This Content

10 | 11 |

12 | @build.date@ 13 |

14 | 15 |

License

16 | 17 |

18 | All Content in this plug-in is made available by Mountainminds GmbH & Co. 19 | KG, Munich. Unless otherwise indicated below, the Content is provided to you 20 | under the terms and conditions of the Eclipse Public License Version 1.0 21 | ("EPL"). A copy of the EPL is available at 22 | http://www.eclipse.org/legal/epl-v10.html. 23 | For purposes of the EPL, "Program" will mean the Content. 24 |

25 | 26 | 27 | -------------------------------------------------------------------------------- /org.jacoco.cli.test/about.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | About 6 | 7 | 8 | 9 |

About This Content

10 | 11 |

12 | @build.date@ 13 |

14 | 15 |

License

16 | 17 |

18 | All Content in this plug-in is made available by Mountainminds GmbH & Co. 19 | KG, Munich. Unless otherwise indicated below, the Content is provided to you 20 | under the terms and conditions of the Eclipse Public License Version 1.0 21 | ("EPL"). A copy of the EPL is available at 22 | http://www.eclipse.org/legal/epl-v10.html. 23 | For purposes of the EPL, "Program" will mean the Content. 24 |

25 | 26 | 27 | -------------------------------------------------------------------------------- /org.jacoco.core.test/about.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | About 6 | 7 | 8 | 9 |

About This Content

10 | 11 |

12 | @build.date@ 13 |

14 | 15 |

License

16 | 17 |

18 | All Content in this plug-in is made available by Mountainminds GmbH & Co. 19 | KG, Munich. Unless otherwise indicated below, the Content is provided to you 20 | under the terms and conditions of the Eclipse Public License Version 1.0 21 | ("EPL"). A copy of the EPL is available at 22 | http://www.eclipse.org/legal/epl-v10.html. 23 | For purposes of the EPL, "Program" will mean the Content. 24 |

25 | 26 | 27 | -------------------------------------------------------------------------------- /org.jacoco.startup/about.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | About 6 | 7 | 8 | 9 |

About This Content

10 | 11 |

12 | @build.date@ 13 |

14 | 15 |

License

16 | 17 |

18 | All Content in this plug-in is made available by Mountainminds GmbH & Co. 19 | KG, Munich. Unless otherwise indicated below, the Content is provided to you 20 | under the terms and conditions of the Eclipse Public License Version 1.0 21 | ("EPL"). A copy of the EPL is available at 22 | http://www.eclipse.org/legal/epl-v10.html. 23 | For purposes of the EPL, "Program" will mean the Content. 24 |

25 | 26 | 27 | -------------------------------------------------------------------------------- /org.jacoco.agent.rt.test/about.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | About 6 | 7 | 8 | 9 |

About This Content

10 | 11 |

12 | @build.date@ 13 |

14 | 15 |

License

16 | 17 |

18 | All Content in this plug-in is made available by Mountainminds GmbH & Co. 19 | KG, Munich. Unless otherwise indicated below, the Content is provided to you 20 | under the terms and conditions of the Eclipse Public License Version 1.0 21 | ("EPL"). A copy of the EPL is available at 22 | http://www.eclipse.org/legal/epl-v10.html. 23 | For purposes of the EPL, "Program" will mean the Content. 24 |

25 | 26 | 27 | -------------------------------------------------------------------------------- /org.jacoco.ant/src/org/jacoco/ant/antlib.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /org.jacoco.core/src/org/jacoco/core/dao/CoverageRateRecordDao.java: -------------------------------------------------------------------------------- 1 | package org.jacoco.core.dao; 2 | 3 | import org.jfaster.mango.annotation.DB; 4 | import org.jfaster.mango.annotation.SQL; 5 | 6 | /** 7 | * 8 | * @author yanpengfang 9 | * @create 2019-12-30 3:45 PM 10 | */ 11 | @DB(table = "coverage_rate_record") 12 | public interface CoverageRateRecordDao { 13 | 14 | String COLS = "project,class_name,method,covered"; 15 | 16 | @SQL("select covered from #table where project=:1 and class_name=:2 and method=:3") 17 | Integer getCovered(String project, String className, String method); 18 | 19 | @SQL("insert into #table(" + COLS + ") values(:project,:className,:method,:covered) ON DUPLICATE KEY UPDATE covered=:covered") 20 | int addOrUpdate(CoverageRateDto coverage); 21 | 22 | @SQL("delete from #table where project=:1 and class_name=:2 and method=:3") 23 | int deletePreRateRecord(String project, String className, String method); 24 | } 25 | -------------------------------------------------------------------------------- /org.jacoco.startup.test/about.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | About 6 | 7 | 8 | 9 |

About This Content

10 | 11 |

12 | @build.date@ 13 |

14 | 15 |

License

16 | 17 |

18 | All Content in this plug-in is made available by Mountainminds GmbH & Co. 19 | KG, Munich. Unless otherwise indicated below, the Content is provided to you 20 | under the terms and conditions of the Eclipse Public License Version 1.0 21 | ("EPL"). A copy of the EPL is available at 22 | http://www.eclipse.org/legal/epl-v10.html. 23 | For purposes of the EPL, "Program" will mean the Content. 24 |

25 | 26 | 27 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-report-without-dump/verify.bsh: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | import java.io.*; 13 | import org.codehaus.plexus.util.*; 14 | 15 | String buildLog = FileUtils.fileRead( new File( basedir, "build.log" ) ); 16 | if ( buildLog.indexOf( "Skipping JaCoCo execution due to missing execution data file" ) < 0 ) { 17 | throw new RuntimeException( "Execution was not skipped" ); 18 | } 19 | -------------------------------------------------------------------------------- /org.jacoco.startup/build/src/main/java/org/jacoco/examples/expressions/Const.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.startup.expressions; 13 | 14 | public class Const implements IExpression { 15 | 16 | private final double value; 17 | 18 | public Const(final double value) { 19 | this.value = value; 20 | } 21 | 22 | public double evaluate() { 23 | return value; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /org.jacoco.core.test/src/org/jacoco/core/runtime/SystemPropertiesRuntimeTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.runtime; 13 | 14 | /** 15 | * Unit tests for {@link SystemPropertiesRuntime}. 16 | */ 17 | public class SystemPropertiesRuntimeTest extends RuntimeTestBase { 18 | 19 | @Override 20 | IRuntime createRuntime() { 21 | return new SystemPropertiesRuntime(); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-dump/verify.bsh: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * Kyle Lieber - implementation of CheckMojo 11 | * 12 | *******************************************************************************/ 13 | import java.io.*; 14 | import org.codehaus.plexus.util.*; 15 | 16 | String buildLog = FileUtils.fileRead( new File( basedir, "build.log" ) ); 17 | if ( buildLog.indexOf( "All coverage checks have been met." ) < 0 ) { 18 | throw new RuntimeException( "Coverage checks were not met." ); 19 | } 20 | -------------------------------------------------------------------------------- /org.jacoco.core/src/org/jacoco/core/internal/flow/IProbeIdGenerator.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.internal.flow; 13 | 14 | /** 15 | * Internal interface to create probe ids unique within a class. 16 | */ 17 | public interface IProbeIdGenerator { 18 | 19 | /** 20 | * Returns the next unique probe id. 21 | * 22 | * @return unique probe id 23 | */ 24 | int nextId(); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-check-passes/verify.bsh: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * Kyle Lieber - implementation of CheckMojo 11 | * 12 | *******************************************************************************/ 13 | import java.io.*; 14 | import org.codehaus.plexus.util.*; 15 | 16 | String buildLog = FileUtils.fileRead( new File( basedir, "build.log" ) ); 17 | if ( buildLog.indexOf( "All coverage checks have been met." ) < 0 ) { 18 | throw new RuntimeException( "Coverage checks were not met." ); 19 | } 20 | -------------------------------------------------------------------------------- /org.jacoco.startup.test/src/test/resources/verify-offline.groovy: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Mirko Friedenhagen - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | File realBaseDir = new File(basedir, "../../../target/it-offline/build"); 13 | assert new File(realBaseDir, "target/site/jacoco/index.html").exists(); 14 | assert !new File(realBaseDir, "target/site/jacoco-it/index.html").exists(); 15 | assert new File(realBaseDir, "build.log").getText().contains(":restore-instrumented-classes"); 16 | return true; 17 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-multi-module/child/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 14 | 4.0.0 15 | 16 | 17 | jacoco 18 | it-multi-module 19 | 1.0-SNAPSHOT 20 | 21 | 22 | child 23 | 24 | -------------------------------------------------------------------------------- /org.jacoco.doc/javadoc/overview.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

5 | This is the public JaCoCo API that can be used for integration. JaCoCo is 6 | packed as several bundles. While the bundles formally fulfill the OSGi 7 | specification, there is no dependency on OSGi. They can also be used as 8 | regular JARs in your classpath. 9 |

10 | 11 |

Bundle org.jacoco.core

12 | 13 |

14 | The core bundle implements the code coverage technology itself. It provides 15 | APIs and implementation for 16 |

17 | 18 | 23 | 24 |

Bundle org.jacoco.agent

25 | 26 |

27 | Provides the runtime Java agent (JAR file) as a resource. 28 |

29 | 30 | 31 |

Bundle org.jacoco.report

32 | 33 |

34 | APIs and implementation to create coverage reports in several formats. 35 |

36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /org.jacoco.core.test/src/org/jacoco/core/test/perf/IPerfScenario.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.test.perf; 13 | 14 | /** 15 | * Interface for a performance scenario. 16 | */ 17 | public interface IPerfScenario { 18 | 19 | /** 20 | * Runs the performance scenario and reports the result to the given 21 | * interface. 22 | * 23 | * @param output 24 | */ 25 | void run(IPerfOutput output) throws Exception; 26 | 27 | } 28 | -------------------------------------------------------------------------------- /org.jacoco.core.test.validation.java5/src/org/jacoco/core/test/validation/java5/targets/AnnotationInitializerTarget.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.test.validation.java5.targets; 13 | 14 | /** 15 | * This test target is an annotation with an initializer. 16 | */ 17 | public @interface AnnotationInitializerTarget { 18 | 19 | Object CONST = new Object(); // assertFullyCovered() 20 | 21 | int value() default 0; // assertEmpty() 22 | 23 | } 24 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-offline-instrumentation/child/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 14 | 4.0.0 15 | 16 | 17 | jacoco 18 | it-offline-instrumentation 19 | 1.0-SNAPSHOT 20 | 21 | 22 | child 23 | 24 | 25 | -------------------------------------------------------------------------------- /org.jacoco.core/src/org/jacoco/core/dao/CoverageRecordDao.java: -------------------------------------------------------------------------------- 1 | package org.jacoco.core.dao; 2 | 3 | import org.jfaster.mango.annotation.DB; 4 | import org.jfaster.mango.annotation.SQL; 5 | 6 | /** 7 | * 8 | * @author yanpengfang 9 | * @create 2019-12-30 3:45 PM 10 | */ 11 | @DB(table = "coverage_record") 12 | public interface CoverageRecordDao { 13 | 14 | String COLS = "project,class_name,method,line,method_md5,line_md5,type"; 15 | 16 | @SQL("select type from #table where project=:1 and class_name=:2 and method_md5=:3 and line_md5=:4") 17 | String getType(String project, String className,String methodMd5, String lineMd5); 18 | 19 | @SQL("insert into #table(" + COLS + ") values(:project,:className,:method,:line,:methodMd5," + 20 | ":lineMd5,:type) ON DUPLICATE KEY UPDATE type=:type") 21 | int addOrUpdate(CoverageDto coverage); 22 | 23 | @SQL("delete from #table where project=:1 and class_name=:2 and method=:3") 24 | int deletePreRecord(String project, String className, String method); 25 | } 26 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-merge-passes/it-merge-passes-project1/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 14 | 4.0.0 15 | 16 | 17 | jacoco 18 | it-merge-passes 19 | 1.0-SNAPSHOT 20 | 21 | 22 | it-merge-passes-project1 23 | 24 | 25 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-merge-passes/it-merge-passes-project2/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 14 | 4.0.0 15 | 16 | 17 | jacoco 18 | it-merge-passes 19 | 1.0-SNAPSHOT 20 | 21 | 22 | it-merge-passes-project2 23 | 24 | 25 | -------------------------------------------------------------------------------- /org.jacoco.core/src/org/jacoco/core/internal/instr/IProbeInserter.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.internal.instr; 13 | 14 | /** 15 | * Internal interface for insertion of probes into in the instruction sequence 16 | * of a method. 17 | */ 18 | interface IProbeInserter { 19 | 20 | /** 21 | * Inserts the probe with the given id. 22 | * 23 | * @param id 24 | * id of the probe to insert 25 | */ 26 | void insertProbe(int id); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /org.jacoco.startup/build/src/main/java/org/jacoco/examples/expressions/Add.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.startup.expressions; 13 | 14 | public class Add implements IExpression { 15 | 16 | private final IExpression l; 17 | 18 | private final IExpression r; 19 | 20 | public Add(final IExpression l, final IExpression r) { 21 | this.l = l; 22 | this.r = r; 23 | } 24 | 25 | public double evaluate() { 26 | return l.evaluate() + r.evaluate(); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /org.jacoco.startup/build/src/main/java/org/jacoco/examples/expressions/Div.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.startup.expressions; 13 | 14 | public class Div implements IExpression { 15 | 16 | private final IExpression l; 17 | 18 | private final IExpression r; 19 | 20 | public Div(final IExpression l, final IExpression r) { 21 | this.l = l; 22 | this.r = r; 23 | } 24 | 25 | public double evaluate() { 26 | return l.evaluate() / r.evaluate(); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /org.jacoco.startup/build/src/main/java/org/jacoco/examples/expressions/Mul.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.startup.expressions; 13 | 14 | public class Mul implements IExpression { 15 | 16 | private final IExpression l; 17 | 18 | private final IExpression r; 19 | 20 | public Mul(final IExpression l, final IExpression r) { 21 | this.l = l; 22 | this.r = r; 23 | } 24 | 25 | public double evaluate() { 26 | return l.evaluate() * r.evaluate(); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /org.jacoco.startup/build/src/main/java/org/jacoco/examples/expressions/Sub.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.startup.expressions; 13 | 14 | public class Sub implements IExpression { 15 | 16 | private final IExpression l; 17 | 18 | private final IExpression r; 19 | 20 | public Sub(final IExpression l, final IExpression r) { 21 | this.l = l; 22 | this.r = r; 23 | } 24 | 25 | public double evaluate() { 26 | return l.evaluate() - r.evaluate(); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-report-aggregate/child1/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 14 | 4.0.0 15 | 16 | 17 | jacoco 18 | it-report-aggregate 19 | 1.0-SNAPSHOT 20 | 21 | 22 | child1 23 | jar 24 | 25 | 26 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-report-aggregate/child2/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 14 | 4.0.0 15 | 16 | 17 | jacoco 18 | it-report-aggregate 19 | 1.0-SNAPSHOT 20 | 21 | 22 | child2 23 | jar 24 | 25 | 26 | -------------------------------------------------------------------------------- /org.jacoco.core.test/src/org/jacoco/core/test/perf/targets/Target02.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.test.perf.targets; 13 | 14 | import java.util.concurrent.Callable; 15 | 16 | /** 17 | * Simple Loop. 18 | */ 19 | public class Target02 implements Callable { 20 | 21 | public Void call() throws Exception { 22 | @SuppressWarnings("unused") 23 | int count = 0; 24 | for (int i = 0; i < 10000000; i++) { 25 | count++; 26 | } 27 | return null; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-report-aggregate/child2v2/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 14 | 4.0.0 15 | 16 | 17 | jacoco 18 | it-report-aggregate 19 | 1.0-SNAPSHOT 20 | 21 | 22 | child2 23 | 2.0-SNAPSHOT 24 | 25 | 26 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-offline-instrumentation/child-without-main-classes/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 14 | 4.0.0 15 | 16 | 17 | jacoco 18 | it-offline-instrumentation 19 | 1.0-SNAPSHOT 20 | 21 | 22 | child-without-main-classes 23 | 24 | 25 | -------------------------------------------------------------------------------- /org.jacoco.core/src/org/jacoco/core/analysis/ISourceFileCoverage.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.analysis; 13 | 14 | /** 15 | * Coverage data of a single source file. The name of this node is the local 16 | * name of the source file. 17 | */ 18 | public interface ISourceFileCoverage extends ISourceNode { 19 | 20 | /** 21 | * Returns the VM name of the package the source file belongs to. 22 | * 23 | * @return package name 24 | */ 25 | String getPackageName(); 26 | 27 | } 28 | -------------------------------------------------------------------------------- /org.jacoco.report.test/src/org/jacoco/report/internal/html/HTMLSupport.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.report.internal.html; 13 | 14 | import javax.xml.parsers.ParserConfigurationException; 15 | 16 | import org.jacoco.report.internal.xml.XMLSupport; 17 | 18 | /** 19 | * Support for verifying XHTML documents. 20 | */ 21 | public class HTMLSupport extends XMLSupport { 22 | 23 | public HTMLSupport() throws ParserConfigurationException { 24 | super(HTMLSupport.class); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /org.jacoco.core.test.validation.java5/src/org/jacoco/core/test/validation/java5/AnnotationGeneratedTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.test.validation.java5; 13 | 14 | import org.jacoco.core.test.validation.ValidationTestBase; 15 | import org.jacoco.core.test.validation.java5.targets.AnnotationGeneratedTarget; 16 | 17 | public class AnnotationGeneratedTest extends ValidationTestBase { 18 | 19 | public AnnotationGeneratedTest() { 20 | super(AnnotationGeneratedTarget.class); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-multi-module/child-jar-without-sources/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 14 | 4.0.0 15 | 16 | 17 | jacoco 18 | it-multi-module 19 | 1.0-SNAPSHOT 20 | 21 | 22 | 23 | child-jar-without-sources 24 | 25 | -------------------------------------------------------------------------------- /org.jacoco.core/src/org/jacoco/core/analysis/ICoverageVisitor.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.analysis; 13 | 14 | /** 15 | * Interface for coverage data output as a stream of {@link IClassCoverage} 16 | * instances. 17 | */ 18 | public interface ICoverageVisitor { 19 | 20 | /** 21 | * For analyzed class coverage data is emitted to this method. 22 | * 23 | * @param coverage 24 | * coverage data for a class 25 | */ 26 | void visitCoverage(IClassCoverage coverage); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /org.jacoco.core/src/org/jacoco/core/internal/flow/IFrame.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.internal.flow; 13 | 14 | import org.objectweb.asm.MethodVisitor; 15 | 16 | /** 17 | * Representation of the current stackmap frame content. 18 | */ 19 | public interface IFrame { 20 | 21 | /** 22 | * Emits a frame event with the current content to the given visitor. 23 | * 24 | * @param mv 25 | * method visitor to emit frame event to 26 | */ 27 | void accept(MethodVisitor mv); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /org.jacoco.startup/build/src/main/java/org/jacoco/examples/parser/Main.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.startup.parser; 13 | 14 | import java.io.IOException; 15 | 16 | public class Main { 17 | 18 | public static void main(final String[] args) throws IOException { 19 | for (String expression : args) { 20 | ExpressionParser parser = new ExpressionParser(expression); 21 | double result = parser.parse().evaluate(); 22 | System.out.printf("%s = %s%n", expression, result); 23 | } 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /org.jacoco.doc/docroot/doc/empty.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | JaCoCo - XXX TITLE XXX 9 | 10 | 11 | 12 | 16 |
17 | 18 |

Title

19 | 20 |

21 | Text 22 |

23 | 24 |
25 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-merge-passes/verify.bsh: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Mads Mohr Christensen - implementation of MergeMojo 10 | * 11 | *******************************************************************************/ 12 | import java.io.*; 13 | import org.codehaus.plexus.util.*; 14 | 15 | String buildLog = FileUtils.fileRead( new File( basedir, "build.log" ) ); 16 | if ( buildLog.indexOf( "Loading execution data file" ) < 0 ) { 17 | throw new RuntimeException( "Could not load execution data file" ); 18 | } 19 | if ( buildLog.indexOf( "Writing merged execution data to" ) < 0 ) { 20 | throw new RuntimeException( "Could not write merged execution data" ); 21 | } 22 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-multi-module/skip-child/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 14 | 4.0.0 15 | 16 | 17 | jacoco 18 | it-multi-module 19 | 1.0-SNAPSHOT 20 | 21 | 22 | skip-child 23 | 24 | 25 | true 26 | 27 | 28 | -------------------------------------------------------------------------------- /org.jacoco.core.test.validation.java8/src/org/jacoco/core/test/validation/java8/targets/LambdaInInterfaceTarget.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.test.validation.java8.targets; 13 | 14 | import static org.jacoco.core.test.validation.targets.Stubs.nop; 15 | 16 | /** 17 | * This test target builds a constant with a lambda value in an interface. 18 | */ 19 | public interface LambdaInInterfaceTarget { 20 | 21 | public static final Runnable RUN = () -> { 22 | nop(); // assertFullyCovered() 23 | }; 24 | 25 | } 26 | -------------------------------------------------------------------------------- /org.jacoco.core.test.validation.kotlin/src/org/jacoco/core/test/validation/kotlin/targets/KotlinUnsafeCastOperatorTarget.kt: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.test.validation.kotlin.targets 13 | 14 | /** 15 | * This test target is "unsafe" cast operator. 16 | */ 17 | object KotlinUnsafeCastOperatorTarget { 18 | 19 | private fun nullable(): String? { 20 | return "" 21 | } 22 | 23 | @JvmStatic 24 | fun main(args: Array) { 25 | nullable() as String // assertFullyCovered() 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /org.jacoco.core/src/org/jacoco/core/analysis/IBundleCoverage.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.analysis; 13 | 14 | import java.util.Collection; 15 | 16 | /** 17 | * Coverage data of a bundle. A bundle groups a collection of packages. 18 | * 19 | * @see IPackageCoverage 20 | */ 21 | public interface IBundleCoverage extends ICoverageNode { 22 | 23 | /** 24 | * Returns all packages contained in this bundle. 25 | * 26 | * @return all packages 27 | */ 28 | Collection getPackages(); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /org.jacoco.report/src/org/jacoco/report/internal/html/table/ITableItem.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.report.internal.html.table; 13 | 14 | import org.jacoco.core.analysis.ICoverageNode; 15 | import org.jacoco.report.internal.html.ILinkable; 16 | 17 | /** 18 | * Interface for a item (row) in a coverage data table. 19 | */ 20 | public interface ITableItem extends ILinkable { 21 | 22 | /** 23 | * Returns the corresponding node data. 24 | * 25 | * @return node data 26 | */ 27 | ICoverageNode getNode(); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /org.jacoco.core.test.validation.kotlin/src/org/jacoco/core/test/validation/kotlin/KotlinCoroutineTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.test.validation.kotlin; 13 | 14 | import org.jacoco.core.test.validation.ValidationTestBase; 15 | import org.jacoco.core.test.validation.kotlin.targets.KotlinCoroutineTarget; 16 | 17 | /** 18 | * Test of coroutines. 19 | */ 20 | public class KotlinCoroutineTest extends ValidationTestBase { 21 | 22 | public KotlinCoroutineTest() { 23 | super(KotlinCoroutineTarget.class); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /org.jacoco.core.test.validation.kotlin/src/org/jacoco/core/test/validation/kotlin/targets/KotlinLateinitTarget.kt: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Fabian Mastenbroek - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.test.validation.kotlin.targets 13 | 14 | import org.jacoco.core.test.validation.targets.Stubs.nop 15 | 16 | /** 17 | * This test target is `lateinit` property. 18 | */ 19 | object KotlinLateinitTarget { 20 | private lateinit var x: String 21 | 22 | @JvmStatic 23 | fun main(args: Array) { 24 | x = "" 25 | nop(x) // assertFullyCovered() 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /org.jacoco.core.test.validation.kotlin/src/org/jacoco/core/test/validation/kotlin/KotlinInlineTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.test.validation.kotlin; 13 | 14 | import org.jacoco.core.test.validation.ValidationTestBase; 15 | import org.jacoco.core.test.validation.kotlin.targets.KotlinInlineTargetKt; 16 | 17 | /** 18 | * Test of inline functions. 19 | */ 20 | public class KotlinInlineTest extends ValidationTestBase { 21 | 22 | public KotlinInlineTest() { 23 | super(KotlinInlineTargetKt.class); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /org.jacoco.core.test.validation.kotlin/src/org/jacoco/core/test/validation/kotlin/targets/KotlinSafeCastTarget.kt: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.test.validation.kotlin.targets 13 | 14 | /** 15 | * Test target for "safe" cast operator. 16 | */ 17 | object KotlinSafeCastTarget { 18 | 19 | private fun example(x: Any?): String? { 20 | return x as? String // assertFullyCovered(0, 2) 21 | } 22 | 23 | @JvmStatic 24 | fun main(args: Array) { 25 | example("") 26 | example(1) 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /org.jacoco.core.test.validation.kotlin/src/org/jacoco/core/test/validation/kotlin/targets/KotlinElvisOperatorTarget.kt: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.test.validation.kotlin.targets 13 | 14 | /** 15 | * Test target for elvis operator. 16 | */ 17 | object KotlinElvisOperatorTarget { 18 | 19 | private fun example(x: String?): String { 20 | return x ?: "" // assertFullyCovered(0, 2) 21 | } 22 | 23 | @JvmStatic 24 | fun main(args: Array) { 25 | example("") 26 | example(null) 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /org.jacoco.core.test.validation.java5/src/org/jacoco/core/test/validation/java5/EnumConstructorTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.test.validation.java5; 13 | 14 | import org.jacoco.core.test.validation.ValidationTestBase; 15 | import org.jacoco.core.test.validation.java5.targets.EnumConstructorTarget; 16 | 17 | /** 18 | * Test of filtering of enum constructors. 19 | */ 20 | public class EnumConstructorTest extends ValidationTestBase { 21 | 22 | public EnumConstructorTest() { 23 | super(EnumConstructorTarget.class); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /org.jacoco.core.test.validation.kotlin/src/org/jacoco/core/test/validation/kotlin/KotlinDataClassTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Fabian Mastenbroek - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.test.validation.kotlin; 13 | 14 | import org.jacoco.core.test.validation.ValidationTestBase; 15 | import org.jacoco.core.test.validation.kotlin.targets.KotlinDataClassTarget; 16 | 17 | /** 18 | * Test of data classes. 19 | */ 20 | public class KotlinDataClassTest extends ValidationTestBase { 21 | 22 | public KotlinDataClassTest() { 23 | super(KotlinDataClassTarget.class); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /org.jacoco.core.test.validation.kotlin/src/org/jacoco/core/test/validation/kotlin/KotlinLateinitTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Fabian Mastenbroek - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.test.validation.kotlin; 13 | 14 | import org.jacoco.core.test.validation.ValidationTestBase; 15 | import org.jacoco.core.test.validation.kotlin.targets.KotlinLateinitTarget; 16 | 17 | /** 18 | * Test of lateinit properties. 19 | */ 20 | public class KotlinLateinitTest extends ValidationTestBase { 21 | 22 | public KotlinLateinitTest() { 23 | super(KotlinLateinitTarget.class); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /org.jacoco.cli.test/src/org/jacoco/cli/internal/commands/VersionTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.cli.internal.commands; 13 | 14 | import org.jacoco.cli.internal.CommandTestBase; 15 | import org.jacoco.core.JaCoCo; 16 | import org.junit.Test; 17 | 18 | /** 19 | * Unit tests for {@link Version}. 20 | */ 21 | public class VersionTest extends CommandTestBase { 22 | 23 | @Test 24 | public void should_print_version() throws Exception { 25 | execute("version"); 26 | 27 | assertOk(); 28 | assertContains(JaCoCo.VERSION, out); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /org.jacoco.core.test.validation.kotlin/src/org/jacoco/core/test/validation/kotlin/KotlinElvisOperatorTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.test.validation.kotlin; 13 | 14 | import org.jacoco.core.test.validation.ValidationTestBase; 15 | import org.jacoco.core.test.validation.kotlin.targets.KotlinElvisOperatorTarget; 16 | 17 | /** 18 | * Test of elvis operator. 19 | */ 20 | public class KotlinElvisOperatorTest extends ValidationTestBase { 21 | 22 | public KotlinElvisOperatorTest() { 23 | super(KotlinElvisOperatorTarget.class); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /org.jacoco.core.test.validation.kotlin/src/org/jacoco/core/test/validation/kotlin/targets/KotlinSafeCallOperatorTarget.kt: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.test.validation.kotlin.targets 13 | 14 | /** 15 | * Test target for safe call operator. 16 | */ 17 | object KotlinSafeCallOperatorTarget { 18 | 19 | private fun example(x: String?): Int? { 20 | return x?.length // assertFullyCovered(0, 2) 21 | } 22 | 23 | @JvmStatic 24 | fun main(args: Array) { 25 | example("") 26 | example(null) 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /org.jacoco.core.test.validation.java5/src/org/jacoco/core/test/validation/java5/ClassInitializerTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.test.validation.java5; 13 | 14 | import org.jacoco.core.test.validation.ValidationTestBase; 15 | import org.jacoco.core.test.validation.java5.targets.ClassInitializerTarget; 16 | 17 | /** 18 | * Tests of static initializer in classes. 19 | */ 20 | public class ClassInitializerTest extends ValidationTestBase { 21 | 22 | public ClassInitializerTest() { 23 | super(ClassInitializerTarget.class); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /org.jacoco.core.test.validation.java5/src/org/jacoco/core/test/validation/java5/ControlStructuresTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.test.validation.java5; 13 | 14 | import org.jacoco.core.test.validation.ValidationTestBase; 15 | import org.jacoco.core.test.validation.java5.targets.ControlStructuresTarget; 16 | 17 | /** 18 | * Tests of basic Java control structures. 19 | */ 20 | public class ControlStructuresTest extends ValidationTestBase { 21 | 22 | public ControlStructuresTest() { 23 | super(ControlStructuresTarget.class); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /org.jacoco.core.test.validation.java8/src/org/jacoco/core/test/validation/java8/LambdaExpressionsTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.test.validation.java8; 13 | 14 | import org.jacoco.core.test.validation.ValidationTestBase; 15 | import org.jacoco.core.test.validation.java8.targets.LambdaExpressionsTarget; 16 | 17 | /** 18 | * Tests for different lambda expressions. 19 | */ 20 | public class LambdaExpressionsTest extends ValidationTestBase { 21 | 22 | public LambdaExpressionsTest() { 23 | super(LambdaExpressionsTarget.class); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-prepend-property/verify.bsh: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | import java.io.*; 13 | import org.codehaus.plexus.util.*; 14 | 15 | String agentOptions = "jacoco.exec -ea"; 16 | String buildLog = FileUtils.fileRead( new File( basedir, "build.log" ) ); 17 | if ( buildLog.indexOf( agentOptions ) < 0 ) { 18 | throw new RuntimeException( "Property was not configured" ); 19 | } 20 | 21 | File file = new File( basedir, "target/jacoco.exec" ); 22 | if ( !file.isFile() ) 23 | { 24 | throw new FileNotFoundException( "Could not find generated dump: " + file ); 25 | } 26 | -------------------------------------------------------------------------------- /org.jacoco.core.test.validation.java5/src/org/jacoco/core/test/validation/java5/BooleanExpressionsTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.test.validation.java5; 13 | 14 | import org.jacoco.core.test.validation.ValidationTestBase; 15 | import org.jacoco.core.test.validation.java5.targets.BooleanExpressionsTarget; 16 | 17 | /** 18 | * Tests of basic Java boolean expressions. 19 | */ 20 | public class BooleanExpressionsTest extends ValidationTestBase { 21 | 22 | public BooleanExpressionsTest() { 23 | super(BooleanExpressionsTarget.class); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /org.jacoco.core.test.validation.kotlin/src/org/jacoco/core/test/validation/kotlin/KotlinSafeCallOperatorTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.test.validation.kotlin; 13 | 14 | import org.jacoco.core.test.validation.ValidationTestBase; 15 | import org.jacoco.core.test.validation.kotlin.targets.KotlinSafeCallOperatorTarget; 16 | 17 | /** 18 | * Test of safe call operator. 19 | */ 20 | public class KotlinSafeCallOperatorTest extends ValidationTestBase { 21 | 22 | public KotlinSafeCallOperatorTest() { 23 | super(KotlinSafeCallOperatorTarget.class); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /org.jacoco.core.test.validation.kotlin/src/org/jacoco/core/test/validation/kotlin/KotlinWhenExpressionTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.test.validation.kotlin; 13 | 14 | import org.jacoco.core.test.validation.ValidationTestBase; 15 | import org.jacoco.core.test.validation.kotlin.targets.KotlinWhenExpressionTarget; 16 | 17 | /** 18 | * Test of when expressions. 19 | */ 20 | public class KotlinWhenExpressionTest extends ValidationTestBase { 21 | 22 | public KotlinWhenExpressionTest() { 23 | super(KotlinWhenExpressionTarget.class); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /org.jacoco.core/src/org/jacoco/core/data/IExecutionDataVisitor.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.data; 13 | 14 | /** 15 | * Interface for data output of collected execution data. This interface is 16 | * meant to be implemented by parties that want to retrieve data from the 17 | * coverage runtime. 18 | */ 19 | public interface IExecutionDataVisitor { 20 | 21 | /** 22 | * Provides execution data for a class. 23 | * 24 | * @param data 25 | * execution data for a class 26 | */ 27 | void visitClassExecution(ExecutionData data); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /org.jacoco.core.test.validation.kotlin/src/org/jacoco/core/test/validation/kotlin/KotlinCallableReferenceTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.test.validation.kotlin; 13 | 14 | import org.jacoco.core.test.validation.ValidationTestBase; 15 | import org.jacoco.core.test.validation.kotlin.targets.KotlinCallableReferenceTarget; 16 | 17 | /** 18 | * Test of callable references. 19 | */ 20 | public class KotlinCallableReferenceTest extends ValidationTestBase { 21 | 22 | public KotlinCallableReferenceTest() { 23 | super(KotlinCallableReferenceTarget.class); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /org.jacoco.core.test.validation.kotlin/src/org/jacoco/core/test/validation/kotlin/KotlinNotNullOperatorTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.test.validation.kotlin; 13 | 14 | import org.jacoco.core.test.validation.ValidationTestBase; 15 | import org.jacoco.core.test.validation.kotlin.targets.KotlinNotNullOperatorTarget; 16 | 17 | /** 18 | * Test of not-null assertion operator. 19 | */ 20 | public class KotlinNotNullOperatorTest extends ValidationTestBase { 21 | 22 | public KotlinNotNullOperatorTest() { 23 | super(KotlinNotNullOperatorTarget.class); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /org.jacoco.core.test.validation.kotlin/src/org/jacoco/core/test/validation/kotlin/KotlinTopLevelFunctionTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.test.validation.kotlin; 13 | 14 | import org.jacoco.core.test.validation.ValidationTestBase; 15 | import org.jacoco.core.test.validation.kotlin.targets.KotlinTopLevelFunctionTargetKt; 16 | 17 | /** 18 | * Test of top level function. 19 | */ 20 | public class KotlinTopLevelFunctionTest extends ValidationTestBase { 21 | 22 | public KotlinTopLevelFunctionTest() { 23 | super(KotlinTopLevelFunctionTargetKt.class); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /org.jacoco.cli/src/org/jacoco/cli/internal/CommandParser.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.cli.internal; 13 | 14 | import org.kohsuke.args4j.CmdLineParser; 15 | 16 | /** 17 | * Parser which remembers the parsed command to have additional context 18 | * information to produce help output. 19 | */ 20 | public class CommandParser extends CmdLineParser { 21 | 22 | private final Command command; 23 | 24 | CommandParser(final Command command) { 25 | super(command); 26 | this.command = command; 27 | } 28 | 29 | Command getCommand() { 30 | return command; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /org.jacoco.core.test.validation.java7/src/org/jacoco/core/test/validation/java7/StringSwitchTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.test.validation.java7; 13 | 14 | import org.jacoco.core.test.validation.ValidationTestBase; 15 | import org.jacoco.core.test.validation.java7.targets.StringSwitchTarget; 16 | 17 | /** 18 | * Test of filtering of a bytecode that is generated for a String in switch 19 | * statement. 20 | */ 21 | public class StringSwitchTest extends ValidationTestBase { 22 | 23 | public StringSwitchTest() { 24 | super(StringSwitchTarget.class); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /org.jacoco.core.test.validation.java5/src/org/jacoco/core/test/validation/java5/ExplicitInitialFrameTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.test.validation.java5; 13 | 14 | import org.jacoco.core.test.validation.ValidationTestBase; 15 | import org.jacoco.core.test.validation.java5.targets.ExplicitInitialFrameTarget; 16 | 17 | /** 18 | * Test for a methods having a explicit initial frame. 19 | */ 20 | public class ExplicitInitialFrameTest extends ValidationTestBase { 21 | 22 | public ExplicitInitialFrameTest() { 23 | super(ExplicitInitialFrameTarget.class); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /org.jacoco.core.test.validation.kotlin/src/org/jacoco/core/test/validation/kotlin/KotlinDefaultArgumentsTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.test.validation.kotlin; 13 | 14 | import org.jacoco.core.test.validation.ValidationTestBase; 15 | import org.jacoco.core.test.validation.kotlin.targets.KotlinDefaultArgumentsTarget; 16 | 17 | /** 18 | * Test of functions with default arguments. 19 | */ 20 | public class KotlinDefaultArgumentsTest extends ValidationTestBase { 21 | 22 | public KotlinDefaultArgumentsTest() { 23 | super(KotlinDefaultArgumentsTarget.class); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /org.jacoco.core.test.validation.kotlin/src/org/jacoco/core/test/validation/kotlin/KotlinUnsafeCastOperatorTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.test.validation.kotlin; 13 | 14 | import org.jacoco.core.test.validation.ValidationTestBase; 15 | import org.jacoco.core.test.validation.kotlin.targets.KotlinUnsafeCastOperatorTarget; 16 | 17 | /** 18 | * Test of "unsafe" cast operator. 19 | */ 20 | public class KotlinUnsafeCastOperatorTest extends ValidationTestBase { 21 | 22 | public KotlinUnsafeCastOperatorTest() { 23 | super(KotlinUnsafeCastOperatorTarget.class); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /org.jacoco.core.test/src/org/jacoco/core/JaCoCoTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core; 13 | 14 | import static org.junit.Assert.assertNotNull; 15 | 16 | import org.junit.Test; 17 | 18 | /** 19 | * Unit tests for {@link JaCoCo}. 20 | */ 21 | public class JaCoCoTest { 22 | 23 | @Test 24 | public void testVERSION() { 25 | assertNotNull(JaCoCo.VERSION); 26 | } 27 | 28 | @Test 29 | public void testHOMEURL() { 30 | assertNotNull(JaCoCo.HOMEURL); 31 | } 32 | 33 | @Test 34 | public void testRUNTIMEPACKAGE() { 35 | assertNotNull(JaCoCo.RUNTIMEPACKAGE); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /org.jacoco.ant.test/src/org/jacoco/ant/DumpTaskTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Brock Janiczak - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.ant; 13 | 14 | import java.io.File; 15 | 16 | import junit.framework.TestSuite; 17 | 18 | import org.apache.ant.antunit.junit3.AntUnitSuite; 19 | import org.apache.ant.antunit.junit4.AntUnitSuiteRunner; 20 | import org.junit.runner.RunWith; 21 | 22 | @RunWith(AntUnitSuiteRunner.class) 23 | public class DumpTaskTest { 24 | 25 | public static TestSuite suite() { 26 | final File file = new File("src/org/jacoco/ant/DumpTaskTest.xml"); 27 | return new AntUnitSuite(file, DumpTaskTest.class); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /org.jacoco.core.test.validation.java5/src/org/jacoco/core/test/validation/java5/ConstructorsTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.test.validation.java5; 13 | 14 | import org.jacoco.core.test.validation.ValidationTestBase; 15 | import org.jacoco.core.test.validation.java5.targets.ConstructorsTarget; 16 | 17 | /** 18 | * Tests for different constructors. Private empty constructors without 19 | * arguments are filtered. 20 | */ 21 | public class ConstructorsTest extends ValidationTestBase { 22 | 23 | public ConstructorsTest() { 24 | super(ConstructorsTarget.class); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /org.jacoco.core.test.validation.java5/src/org/jacoco/core/test/validation/java5/SyntheticTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.test.validation.java5; 13 | 14 | import org.jacoco.core.test.validation.ValidationTestBase; 15 | import org.jacoco.core.test.validation.java5.targets.SyntheticTarget; 16 | 17 | /** 18 | * Test of filtering of synthetic methods. 19 | */ 20 | public class SyntheticTest extends ValidationTestBase { 21 | 22 | public SyntheticTest() { 23 | super(SyntheticTarget.class); 24 | } 25 | 26 | public void test_method_count() { 27 | assertMethodCount(5); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /org.jacoco.ant.test/src/org/jacoco/ant/AgentTaskTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Brock Janiczak - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.ant; 13 | 14 | import java.io.File; 15 | 16 | import junit.framework.TestSuite; 17 | 18 | import org.apache.ant.antunit.junit3.AntUnitSuite; 19 | import org.apache.ant.antunit.junit4.AntUnitSuiteRunner; 20 | import org.junit.runner.RunWith; 21 | 22 | @RunWith(AntUnitSuiteRunner.class) 23 | public class AgentTaskTest { 24 | 25 | public static TestSuite suite() { 26 | final File file = new File("src/org/jacoco/ant/AgentTaskTest.xml"); 27 | return new AntUnitSuite(file, AgentTaskTest.class); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /org.jacoco.ant.test/src/org/jacoco/ant/MergeTaskTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Brock Janiczak - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.ant; 13 | 14 | import java.io.File; 15 | 16 | import junit.framework.TestSuite; 17 | 18 | import org.apache.ant.antunit.junit3.AntUnitSuite; 19 | import org.apache.ant.antunit.junit4.AntUnitSuiteRunner; 20 | import org.junit.runner.RunWith; 21 | 22 | @RunWith(AntUnitSuiteRunner.class) 23 | public class MergeTaskTest { 24 | 25 | public static TestSuite suite() { 26 | final File file = new File("src/org/jacoco/ant/MergeTaskTest.xml"); 27 | return new AntUnitSuite(file, MergeTaskTest.class); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /org.jacoco.core.test.validation.java8/src/org/jacoco/core/test/validation/java8/InterfaceOnlyDefaultMethodsTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.test.validation.java8; 13 | 14 | import org.jacoco.core.test.validation.ValidationTestBase; 15 | import org.jacoco.core.test.validation.java8.targets.InterfaceOnlyDefaultMethodsTarget; 16 | 17 | /** 18 | * Tests of default methods in interfaces. 19 | */ 20 | public class InterfaceOnlyDefaultMethodsTest extends ValidationTestBase { 21 | 22 | public InterfaceOnlyDefaultMethodsTest() { 23 | super(InterfaceOnlyDefaultMethodsTarget.class); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /org.jacoco.core.test.validation.java5/src/org/jacoco/core/test/validation/java5/ImplicitFieldInitializationTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.test.validation.java5; 13 | 14 | import org.jacoco.core.test.validation.ValidationTestBase; 15 | import org.jacoco.core.test.validation.java5.targets.ImplicitFieldInitializationTarget; 16 | 17 | /** 18 | * Test of a implicit field initialization. 19 | */ 20 | public class ImplicitFieldInitializationTest extends ValidationTestBase { 21 | 22 | public ImplicitFieldInitializationTest() { 23 | super(ImplicitFieldInitializationTarget.class); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /org.jacoco.core.test.validation.java8/src/org/jacoco/core/test/validation/java8/InterfaceDefaultMethodsTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.test.validation.java8; 13 | 14 | import org.jacoco.core.test.validation.ValidationTestBase; 15 | import org.jacoco.core.test.validation.java8.targets.InterfaceDefaultMethodsTarget; 16 | 17 | /** 18 | * Tests of static initializer and default methods in interfaces. 19 | */ 20 | public class InterfaceDefaultMethodsTest extends ValidationTestBase { 21 | 22 | public InterfaceDefaultMethodsTest() { 23 | super(InterfaceDefaultMethodsTarget.class); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /org.jacoco.core/src/org/jacoco/core/analysis/IMethodCoverage.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.analysis; 13 | 14 | /** 15 | * Coverage data of a single method. The name of this node is the local method 16 | * name. 17 | */ 18 | public interface IMethodCoverage extends ISourceNode { 19 | 20 | /** 21 | * Returns the descriptor of the method. 22 | * 23 | * @return descriptor 24 | */ 25 | String getDesc(); 26 | 27 | /** 28 | * Returns the generic signature of the method if defined. 29 | * 30 | * @return generic signature or null 31 | */ 32 | String getSignature(); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /org.jacoco.report/src/org/jacoco/report/internal/html/index/IIndexUpdate.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.report.internal.html.index; 13 | 14 | import org.jacoco.report.internal.html.ILinkable; 15 | 16 | /** 17 | * Every report page that should become part of the index must be added via this 18 | * interface. 19 | */ 20 | public interface IIndexUpdate { 21 | 22 | /** 23 | * Adds a class to the index. 24 | * 25 | * @param link 26 | * link to the class 27 | * @param classid 28 | * identifier of the class 29 | */ 30 | void addClass(ILinkable link, long classid); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-report-aggregate-customization/child1/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 14 | 4.0.0 15 | 16 | 17 | jacoco 18 | it-report-aggregate-customization 19 | 1.0-SNAPSHOT 20 | 21 | 22 | child1 23 | jar 24 | 25 | 26 | target/child1.coverage 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-report-aggregate-customization/child2/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 14 | 4.0.0 15 | 16 | 17 | jacoco 18 | it-report-aggregate-customization 19 | 1.0-SNAPSHOT 20 | 21 | 22 | child2 23 | jar 24 | 25 | 26 | target/child2.coverage 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /org.jacoco.core.test.validation.kotlin/src/org/jacoco/core/test/validation/kotlin/KotlinSafeCastTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.test.validation.kotlin; 13 | 14 | import org.jacoco.core.test.validation.ValidationTestBase; 15 | import org.jacoco.core.test.validation.kotlin.targets.KotlinElvisOperatorTarget; 16 | import org.jacoco.core.test.validation.kotlin.targets.KotlinSafeCastTarget; 17 | 18 | /** 19 | * Test of "safe" cast operator. 20 | */ 21 | public class KotlinSafeCastTest extends ValidationTestBase { 22 | 23 | public KotlinSafeCastTest() { 24 | super(KotlinSafeCastTarget.class); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-check-fails-halt/verify.bsh: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * Kyle Lieber - implementation of CheckMojo 11 | * 12 | *******************************************************************************/ 13 | import java.io.*; 14 | import org.codehaus.plexus.util.*; 15 | 16 | String buildLog = FileUtils.fileRead( new File( basedir, "build.log" ) ); 17 | if ( buildLog.indexOf( "Coverage checks have not been met." ) < 0 ) { 18 | throw new RuntimeException( "Coverage checks should not have been met." ); 19 | } 20 | 21 | if ( buildLog.indexOf( "methods missed count is 1, but expected maximum is 0" ) < 0 ) { 22 | throw new RuntimeException( "Should have displayed insufficient code coverage messages." ); 23 | } 24 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-check-fails-no-halt/verify.bsh: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * Kyle Lieber - implementation of CheckMojo 11 | * 12 | *******************************************************************************/ 13 | import java.io.*; 14 | import org.codehaus.plexus.util.*; 15 | 16 | String buildLog = FileUtils.fileRead( new File( basedir, "build.log" ) ); 17 | if ( buildLog.indexOf( "Coverage checks have not been met." ) < 0 ) { 18 | throw new RuntimeException( "Coverage checks should not have been met." ); 19 | } 20 | 21 | if ( buildLog.indexOf( "methods missed count is 1, but expected maximum is 0" ) < 0 ) { 22 | throw new RuntimeException( "Should have displayed insufficient code coverage messages." ); 23 | } 24 | -------------------------------------------------------------------------------- /org.jacoco.agent.rt/src/org/jacoco/agent/rt/RT.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.agent.rt; 13 | 14 | import org.jacoco.agent.rt.internal.Agent; 15 | 16 | /** 17 | * Entry point to access the JaCoCo agent runtime. 18 | */ 19 | public final class RT { 20 | 21 | private RT() { 22 | } 23 | 24 | /** 25 | * Returns the agent instance of the JaCoCo runtime in this JVM. 26 | * 27 | * @return agent instance 28 | * @throws IllegalStateException 29 | * if no Agent has been started yet 30 | */ 31 | public static IAgent getAgent() throws IllegalStateException { 32 | return Agent.getInstance(); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /org.jacoco.agent.rt/src/org/jacoco/agent/rt/internal/output/NoneOutput.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Mandrikov Evgeny - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.agent.rt.internal.output; 13 | 14 | import org.jacoco.core.runtime.AgentOptions; 15 | import org.jacoco.core.runtime.RuntimeData; 16 | 17 | /** 18 | * Output that does nothing. 19 | */ 20 | public class NoneOutput implements IAgentOutput { 21 | 22 | public final void startup(final AgentOptions options, final RuntimeData data) { 23 | // Nothing to do 24 | } 25 | 26 | public void writeExecutionData(final boolean reset) { 27 | // Nothing to do 28 | } 29 | 30 | public void shutdown() { 31 | // Nothing to do 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /org.jacoco.core.test.validation.kotlin/src/org/jacoco/core/test/validation/kotlin/targets/KotlinNotNullOperatorTarget.kt: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.test.validation.kotlin.targets 13 | 14 | /** 15 | * Test target for not-null assertion operator. 16 | */ 17 | object KotlinNotNullOperatorTarget { 18 | 19 | private fun example(x: String?): Int { 20 | return x!!.length // assertFullyCovered() 21 | } 22 | 23 | @JvmStatic 24 | fun main(args: Array) { 25 | example("") 26 | try { 27 | example(null) 28 | } catch (e: NullPointerException) { 29 | } 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /org.jacoco.core.test.validation.java8/src/org/jacoco/core/test/validation/java8/AnnotationOnLocalVariableTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Evgeny Mandrikov - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.test.validation.java8; 13 | 14 | import org.jacoco.core.test.validation.ValidationTestBase; 15 | import org.jacoco.core.test.validation.java8.targets.AnnotationOnLocalVariableTarget; 16 | 17 | /** 18 | * Test of ASM bug 19 | * #317815 20 | */ 21 | public class AnnotationOnLocalVariableTest extends ValidationTestBase { 22 | 23 | public AnnotationOnLocalVariableTest() { 24 | super(AnnotationOnLocalVariableTarget.class); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /org.jacoco.startup/assembly.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | distribution 14 | 15 | zip 16 | 17 | false 18 | 19 | 20 | ${basedir}/build 21 | /examples/build 22 | 0644 23 | 0755 24 | true 25 | 26 | 27 | ${basedir}/src/org/jacoco/startup 28 | /startup/java 29 | 0644 30 | 0755 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /org.jacoco.core.test/src/org/jacoco/core/runtime/URLStreamHandlerRuntimeTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.runtime; 13 | 14 | import org.junit.Assume; 15 | import org.junit.BeforeClass; 16 | 17 | /** 18 | * Unit tests for {@link URLStreamHandlerRuntime}. 19 | */ 20 | public class URLStreamHandlerRuntimeTest extends RuntimeTestBase { 21 | 22 | @Override 23 | IRuntime createRuntime() { 24 | return new URLStreamHandlerRuntime(); 25 | } 26 | 27 | @BeforeClass 28 | public static void checkJDK() { 29 | final boolean jdk9 = System.getProperty("java.version") 30 | .startsWith("9-"); 31 | Assume.assumeTrue(!jdk9); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /jacoco-maven-plugin/META-INF/m2e/lifecycle-mapping-metadata.xml: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | 14 | 15 | 16 | prepare-agent 17 | prepare-agent-integration 18 | merge 19 | report 20 | report-integration 21 | report-aggregate 22 | check 23 | dump 24 | instrument 25 | restore-instrumented-classes 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /org.jacoco.core.test.validation.java5/src/org/jacoco/core/test/validation/java5/targets/ExplicitInitialFrameTarget.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.test.validation.java5.targets; 13 | 14 | import static org.jacoco.core.test.validation.targets.Stubs.f; 15 | import static org.jacoco.core.test.validation.targets.Stubs.nop; 16 | 17 | /** 18 | * This test target needs an explicit initial frame as the first instruction 19 | * already is a jump target. 20 | */ 21 | public class ExplicitInitialFrameTarget { 22 | 23 | public static void main(String[] args) { 24 | 25 | do { 26 | nop(); // assertFullyCovered() 27 | } while (f()); 28 | 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /org.jacoco.core.test.validation.java5/src/org/jacoco/core/test/validation/java5/FieldInitializationInTwoConstructorsTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.test.validation.java5; 13 | 14 | import org.jacoco.core.test.validation.ValidationTestBase; 15 | import org.jacoco.core.test.validation.java5.targets.FieldInitializationInTwoConstructorsTarget; 16 | 17 | /** 18 | * Test of field initialization in two constructors. 19 | */ 20 | public class FieldInitializationInTwoConstructorsTest 21 | extends ValidationTestBase { 22 | 23 | public FieldInitializationInTwoConstructorsTest() { 24 | super(FieldInitializationInTwoConstructorsTarget.class); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /org.jacoco.core/src/org/jacoco/core/data/ISessionInfoVisitor.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.data; 13 | 14 | /** 15 | * Interface for data output of collected session information. This interface is 16 | * meant to be implemented by parties that want to retrieve data from the 17 | * coverage runtime. 18 | */ 19 | public interface ISessionInfoVisitor { 20 | 21 | /** 22 | * Provides session information for the subsequent execution data calls. In 23 | * case of merged sessions this method might be called multiple times. 24 | * 25 | * @param info 26 | * session information 27 | */ 28 | void visitSessionInfo(SessionInfo info); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /org.jacoco.core.test.validation.java5/src/org/jacoco/core/test/validation/java5/targets/ImplicitFieldInitializationTarget.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.test.validation.java5.targets; 13 | 14 | /** 15 | * This test target has instance members with implicit initializers. 16 | */ 17 | public class ImplicitFieldInitializationTarget { // assertFullyCovered() 18 | 19 | Object field1; // assertEmpty() 20 | 21 | Object field2 = this; // assertFullyCovered() 22 | 23 | int field3; // assertEmpty() 24 | 25 | int field4 = 2000; // assertFullyCovered() 26 | 27 | public static void main(String[] args) { 28 | new ImplicitFieldInitializationTarget(); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /org.jacoco.core.test.validation.groovy/src/org/jacoco/core/test/validation/groovy/GroovyDataClassTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Andres Almiray - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.test.validation.groovy; 13 | 14 | import org.jacoco.core.test.validation.ValidationTestBase; 15 | import org.jacoco.core.test.validation.groovy.targets.GroovyDataClassTarget; 16 | import org.junit.Test; 17 | 18 | /** 19 | * Test of data classes. 20 | */ 21 | public class GroovyDataClassTest extends ValidationTestBase { 22 | public GroovyDataClassTest() { 23 | super(GroovyDataClassTarget.class); 24 | } 25 | 26 | @Test 27 | public void test_method_count() { 28 | assertMethodCount(1); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /org.jacoco.core.test.validation.java5/src/org/jacoco/core/test/validation/java5/ControlStructureBeforeSuperConstructorTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.core.test.validation.java5; 13 | 14 | import org.jacoco.core.test.validation.ValidationTestBase; 15 | import org.jacoco.core.test.validation.java5.targets.ControlStructureBeforeSuperConstructorTarget; 16 | 17 | /** 18 | * Test of probes before the super constructor call. 19 | */ 20 | public class ControlStructureBeforeSuperConstructorTest 21 | extends ValidationTestBase { 22 | 23 | public ControlStructureBeforeSuperConstructorTest() { 24 | super(ControlStructureBeforeSuperConstructorTarget.class); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /org.jacoco.cli/src/org/jacoco/cli/internal/commands/Version.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.cli.internal.commands; 13 | 14 | import java.io.IOException; 15 | import java.io.PrintWriter; 16 | 17 | import org.jacoco.cli.internal.Command; 18 | import org.jacoco.core.JaCoCo; 19 | 20 | /** 21 | * The version command. 22 | */ 23 | public class Version extends Command { 24 | 25 | @Override 26 | public String description() { 27 | return "Print JaCoCo version information."; 28 | } 29 | 30 | @Override 31 | public int execute(final PrintWriter out, final PrintWriter err) 32 | throws IOException { 33 | out.println(JaCoCo.VERSION); 34 | return 0; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /jacoco-maven-plugin.test/it/it-dump/src/main/java/Server.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | 13 | import java.io.File; 14 | 15 | /** 16 | * Simple server which runs as long a termination file is created. 17 | */ 18 | public class Server { 19 | 20 | public static void main(String[] args) throws Exception { 21 | System.out.println("Test server started"); 22 | 23 | // Wait for termination file to turn up 24 | // This option puts the target in a pseudo 'server' mode 25 | if (args.length == 1) { 26 | final File termFile = new File(args[0]); 27 | 28 | while (!termFile.exists()) { 29 | Thread.sleep(100); 30 | } 31 | } 32 | 33 | System.out.println("Test server stopped"); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /org.jacoco.ant.test/src/org/jacoco/ant/DumpExecClassNames.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | *******************************************************************************/ 12 | package org.jacoco.ant; 13 | 14 | import java.io.File; 15 | 16 | import org.jacoco.core.data.ExecutionData; 17 | import org.jacoco.core.tools.ExecFileLoader; 18 | 19 | /** 20 | * Test utility to dump class names from exec file. 21 | */ 22 | public class DumpExecClassNames { 23 | 24 | public static void main(String[] args) throws Exception { 25 | final ExecFileLoader loader = new ExecFileLoader(); 26 | for (String f : args) { 27 | loader.load(new File(f)); 28 | } 29 | for (ExecutionData d : loader.getExecutionDataStore().getContents()) { 30 | System.out.println(d.getName()); 31 | } 32 | } 33 | 34 | } 35 | --------------------------------------------------------------------------------