Skip to content

Commit

Permalink
(WIP) add integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
Godin committed Apr 19, 2023
1 parent 31f16d8 commit d18b11c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
15 changes: 15 additions & 0 deletions org.jacoco.ant.test/src/org/jacoco/ant/CoverageTaskTest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,19 @@
</jacoco:coverage>
</target>

<target name="testSecurityManager">
<jacoco:coverage destfile="${exec.file}">
<java classname="org.jacoco.ant.TestTarget" fork="true" failonerror="true">
<classpath path="${org.jacoco.ant.coverageTaskTest.classes.dir}"/>
<jvmarg value="-Djacoco.agent=${_jacoco.agentFile}"/>
<jvmarg value="-Djava.security.manager"/>
<!-- Note that the use of two equal signs (==) below is not a typo -->
<jvmarg value="-Djava.security.policy==${basedir}/data/policy.txt"/>
</java>
</jacoco:coverage>

<au:assertFileExists file="${exec.file}"/>
<au:assertLogContains text="Target executed"/>
</target>

</project>
3 changes: 3 additions & 0 deletions org.jacoco.ant.test/src/org/jacoco/ant/data/policy.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
grant codeBase "file:${jacoco.agent}" {
permission java.security.AllPermission;
};

0 comments on commit d18b11c

Please sign in to comment.