Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

Ant script with EMMA code-coverage

scmuser created the topic: Ant script with EMMA code-coverage

Ant script with EMMA code-coverage so it can find runtime coverage data?

[code language=”css”]
<taskdef resource=”emma_ant.properties”>
<classpath>
<pathelement location=”lib/emma.jar” />
<pathelement location=”lib/emma_ant.jar” />
</classpath>
</taskdef>

<target name=”compile”>
<mkdir dir=”build”/> <!– vytvori adresar build –>
<mkdir dir=”build/classes”/>
<mkdir dir=”build/test”/>
<javac destdir=”build/classes” srcdir=”src” debug=”true” /> <!– prelozi zdrojove kody –>
<javac destdir=”build/test” srcdir=”test”> <!– prelozi testy –>
<classpath> <!– pro prelozeni testu je potreba junit a prelozena aplikace –>
<pathelement location=”lib/junit-4.5.jar” />
<pathelement location=”build/classes” />
</classpath>
</javac>
</target>

<target name=”build” depends=”compile”>
<jar destfile=”tetris.jar” basedir=”build/classes”> <!– zabali aplikaci do jaru –>
<manifest>
<attribute name=”Main-Class” value=”tetris.Main”/>
<attribute name=”Class-Path” value=”lib/mysql-connector-java-5.1.6-bin.jar lib/derbyclient.jar”/>
</manifest>
</jar>
</target>

<target name=”jar” depends=”build”></target>

<target name=”run” depends=”compile”>
<java classname=”tetris.Main” classpath=”build/classes”> <!– spusti aplikaci –>
<classpath>
<pathelement location=”lib/mysql-connector-java-5.1.6-bin.jar” />
<pathelement location=”lib/derbyclient.jar” />
</classpath>
</java>
</target>

<target name=”instrument” depends=”compile”>
<mkdir dir=”build/instrumented”/>

<emma verbosity=”verbose”> <!– vytvori tridy upravene pro sledovani coverage –>
<instr instrpath=”build/classes”
destdir=”build/instrumented”
metadatafile=”build/metadata.emma”
merge=”true” />
</emma>
</target>

<target name=”test” depends=”instrument”>
<mkdir dir=”reports” />
<mkdir dir=”reports/junit” />

<junit printsummary=”yes” haltonfailure=”no” fork=”true”> <!– pusti JUnit testy –>
<classpath>
<pathelement location=”build/test” />
<pathelement location=”build/classes” />
<pathelement location=”build/instrumented” />
<pathelement location=”lib/junit-4.5.jar” />
<pathelement location=”lib/emma.jar” />
<pathelement location=”lib/emma_ant.jar” />
</classpath>

<formatter usefile=”false” type=”brief” />
<formatter type=”plain”/>

<batchtest fork=”yes” todir=”reports/junit”> <!– reporty budou v adresari reports/junit –>
<fileset dir=”test”>
<include name=”**/TetrisSuite.java”/>
</fileset>
</batchtest>
<jvmarg value=”-Demma.coverage.out.file=build/coverage.emma”/>
<jvmarg value=”-Demma.coverage.out.merge=true” />
</junit>

<emma enabled=”true” verbosity=”verbose”> <!– vygeneruje report emmy –>
<report sourcepath=”src”>
<fileset dir=”build” includes=”*.emma” />

<html outfile=”reports/coverage.html” />
</report>
</emma>
</target>

<target name=”clean”>
<delete dir=”build”/> <!– smaze adresar build –>
<delete dir=”reports”/>
<delete file=”tetris.jar”/>
</target>
[/code]

processing input file […NetBeansProjects/Tetris3/build/metadata.emma] …
loaded 25 metadata entries
1 file(s) read and merged in 5 ms
nothing to do: no runtime coverage data found in any of the data files

Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments

Certification Courses

DevOpsSchool has introduced a series of professional certification courses designed to enhance your skills and expertise in cutting-edge technologies and methodologies. Whether you are aiming to excel in development, security, or operations, these certifications provide a comprehensive learning experience. Explore the following programs:

DevOps Certification, SRE Certification, and DevSecOps Certification by DevOpsSchool

Explore our DevOps Certification, SRE Certification, and DevSecOps Certification programs at DevOpsSchool. Gain the expertise needed to excel in your career with hands-on training and globally recognized certifications.

0
Would love your thoughts, please comment.x
()
x