Index: trunk/JavaCommons/build.xml
===================================================================
--- trunk/JavaCommons/build.xml	(revision 279)
+++ trunk/JavaCommons/build.xml	(revision 280)
@@ -97,4 +97,16 @@
 	<path id="JFCMonitor.classpath" />
 
+	<!-- Emma Configuration -->
+	<property name="coverage.location" value="coverage" />
+	<property name="coverage.instrumented" value="inst" />
+	<property name="coverage.instrumented.javahelperlib" value="${coverage.instrumented}/javahelperlib" />
+	<property name="coverage.instrumented.eventbenchcore" value="${coverage.instrumented}/eventbenchcore" />
+	<path id="emma.classpath">
+		<pathelement location="lib-test/emma.jar" />
+		<pathelement location="lib-test/emma_ant.jar" />
+	</path>
+
+	<taskdef resource="emma_ant.properties" classpathref="emma.classpath" />
+
 	<!-- JUnit Test General Properties -->
 	<property name="test.location.results" value="test-results" />
@@ -111,9 +123,15 @@
 	<property name="test.eventbenchcore.main-class" value="de.ugoe.cs.eventbench.TestAll" />
 	<property name="test.eventbenchcore.results" value="${test.location.results}/eventbenchcore" />
-	<path id="EventBenchCoreTest.classpath">
+	<path id="EventBenchCoreJUnitCompile.classpath">
 		<pathelement location="${test.location.eventbenchcore}" />
+		<!--<pathelement location="${coverage.instrumented.eventbenchcore}" /> -->
 		<path refid="EventBenchCore.classpath" />
 		<path refid="JUnit.classpath" />
 	</path>
+	<path id="EventBenchCoreJUnitExecute.classpath">
+			<pathelement location="${coverage.instrumented.eventbenchcore}" />
+			<path refid="EventBenchCoreJUnitCompile.classpath" />
+			<path refid="emma.classpath" />
+		</path>
 
 	<!-- JUnit Test JavaHelperLib Properties -->
@@ -122,9 +140,16 @@
 	<property name="test.javahelperlib.main-class" value="de.ugoe.cs.util.TestAll" />
 	<property name="test.javahelperlib.results" value="${test.location.results}/javahelperlib" />
-	<path id="JavaHelperLibTest.classpath">
+	<path id="JavaHelperLibJUnitCompile.classpath">
 		<pathelement location="${test.location.javahelperlib}" />
 		<path refid="JavaHelperLib.classpath" />
 		<path refid="JUnit.classpath" />
 	</path>
+	<path id="JavaHelperLibJUnitExecute.classpath">
+		<pathelement location="${coverage.instrumented.javahelperlib}" />
+		<path refid="JavaHelperLibJUnitCompile.classpath" />
+		<path refid="emma.classpath" />
+	</path>
+
+
 
 	<!-- Initialization Targets -->
@@ -138,5 +163,5 @@
 	</target>
 	<target name="init.downloads">
-		<mkdir dir="${downloads.location}"/>
+		<mkdir dir="${downloads.location}" />
 	</target>
 	<target name="init.javadoc">
@@ -169,4 +194,8 @@
 		</copy>
 	</target>
+	<target name="init.emma">
+		<mkdir dir="${coverage.instrumented}" />
+		<mkdir dir="${coverage.location}" />
+	</target>
 
 	<!-- Clean-up Targets -->
@@ -185,5 +214,10 @@
 		<delete dir="${test.location.output}" />
 	</target>
-	<target depends="clean.build,clean.dist,clean.javadoc,clean.junit" name="clean.all" />
+	<target name="clean.emma">
+		<delete dir="${coverage.instrumented}" />
+		<delete dir="${coverage.location}" />
+	</target>
+	<target depends="clean.build,clean.dist,clean.javadoc,clean.junit"
+		name="clean.all" />
 
 	<!-- Build Targets -->
@@ -286,5 +320,5 @@
 		</copy>
 	</target>
-	
+
 
 	<target depends="init.downloads,dist" name="createDownloads">
@@ -304,5 +338,6 @@
 
 	<!-- Javadoc Targets -->
-	<target depends="init.javadoc" name="javadoc" description="o Create Javadocs (Requires Javadoc 1.4+)">
+	<target depends="init.javadoc" name="javadoc"
+		description="o Create Javadocs (Requires Javadoc 1.4+)">
 		<javadoc destdir="${javadoc.location}"
 			additionalparam="-J-Dorg.apache.commons.attributes.javadoc.CATaglet.sources=${basedir}">
@@ -320,40 +355,72 @@
 
 	<!-- JUnit Targets -->
-	<target depends="init.eventbenchcore-test" name="build.eventbenchcore-test">
+	<target depends="init.eventbenchcore-test, emma.instrument.eventbenchcore"
+		name="build.eventbenchcore-test">
 		<javac debug="true" debuglevel="${debuglevel}" destdir="${test.location.eventbenchcore}"
 			source="${source}" target="${target}" includeantruntime="false">
 			<src path="${EventBenchCoreTest.location}/src" />
-			<classpath refid="EventBenchCoreTest.classpath" />
-		</javac>
-	</target>
-	<target depends="init.javahelperlib-test" name="build.javahelperlib-test">
+			<classpath refid="EventBenchCoreJUnitCompile.classpath" />
+		</javac>
+	</target>
+	<target depends="init.javahelperlib-test, emma.instrument.javahelperlib"
+		name="build.javahelperlib-test">
 		<javac debug="true" debuglevel="${debuglevel}" destdir="${test.location.javahelperlib}"
 			source="${source}" target="${target}" includeantruntime="false">
 			<src path="${JavaHelperLibTest.location}/src" />
-			<classpath refid="JavaHelperLibTest.classpath" />
-		</javac>
-	</target>
-
-	<target depends="build.eventbenchcore,build.eventbenchcore-test"
+			<classpath refid="JavaHelperLibJUnitCompile.classpath" />
+		</javac>
+	</target>
+
+	<target depends="emma.instrument.eventbenchcore,build.eventbenchcore-test"
 		name="junit.eventbenchcore">
 		<junit fork="on" printsummary="yes" haltonfailure="no">
-			<classpath refid="EventBenchCoreTest.classpath" />
+			<classpath refid="EventBenchCoreJUnitExecute.classpath" />
 			<test name="${test.eventbenchcore.main-class}" haltonfailure="no"
 				outfile="${test.eventbenchcore.results}">
 				<formatter type="xml" />
 			</test>
+			<jvmarg
+							value="-Demma.coverage.out.file=${coverage.location}/eventbenchcore.emma" />
+						<jvmarg value="-Demma.coverage.out.merge=true" />
 		</junit>
 	</target>
-	<target depends="build.javahelperlib,build.javahelperlib-test"
+	<target depends="emma.instrument.javahelperlib,build.javahelperlib-test"
 		name="junit.javahelperlib">
 		<junit fork="on" printsummary="yes" haltonfailure="no">
-			<classpath refid="JavaHelperLibTest.classpath" />
+			<classpath refid="JavaHelperLibJUnitExecute.classpath" />
 			<test name="${test.javahelperlib.main-class}" haltonfailure="no"
 				outfile="${test.javahelperlib.results}">
 				<formatter type="xml" />
 			</test>
+			<jvmarg
+				value="-Demma.coverage.out.file=${coverage.location}/javahelperlib.emma" />
+			<jvmarg value="-Demma.coverage.out.merge=true" />
 		</junit>
 	</target>
-	
-	<target depends="junit.eventbenchcore,junit.javahelperlib" name="junit" />
+
+	<target depends="junit.javahelperlib,junit.eventbenchcore" name="junit" />
+
+	<!-- Emma Targets -->
+	<target depends="build.javahelperlib, init.emma" name="emma.instrument.javahelperlib">
+		<emma enabled="true">
+			<instr instrpath="${build.location.javahelperlib}" destdir="${coverage.instrumented.javahelperlib}"
+				metadatafile="${coverage.location}/javahelperlib.emma" merge="true" />
+		</emma>
+	</target>
+	<target depends="build.eventbenchcore, init.emma" name="emma.instrument.eventbenchcore">
+		<emma enabled="true">
+			<instr instrpath="${build.location.eventbenchcore}" destdir="${coverage.instrumented.eventbenchcore}"
+				metadatafile="${coverage.location}/eventbenchcore.emma" merge="true" />
+		</emma>
+	</target>
+	<target depends="junit" name="emma.report">
+		<emma enabled="true">
+			<report sourcepath="${JavaHelperLib.location}">
+				<fileset dir="${coverage.location}">
+					<include name="*.emma" />
+				</fileset>
+				<xml outfile="${coverage.location}/coverage.xml" depth="method" />
+			</report>
+		</emma>
+	</target>
 </project>
