Browse files

add emma plugin with sample

  • Loading branch information...
1 parent 943e168 commit 810c399f7aa5fa1dfed821b2039a0f816e334122 Rene Groeschke committed Apr 15, 2010
View
BIN emmaPlugin/.DS_Store
Binary file not shown.
View
46 emmaPlugin/emma.gradle
@@ -0,0 +1,46 @@
+apply plugin:'java'
+
+String EMMA_REPORT_PATH = "${reportsDir.absolutePath}/emma"
+String EMMA_COVERAGE_FILE_NAME_PATH = "coverage"
+String EMMA_TMP_DIR = "$buildDir/tmp/emma"
+String EMMA_INSTR_DIR = EMMA_TMP_DIR + "/instr"
+String EMMA_META_DATA_FILEPATH = EMMA_TMP_DIR + "/metadata.emma"
+String EMMA_VERBOSITY_LEVEL = "quiet"
+
+configurations{
+ emma
+}
+
+test{
+ //setup JVM Arguments for emma coverage
+ jvmArgs "-Demma.coverage.out.file=$EMMA_META_DATA_FILEPATH", "-Demma.coverage.out.merge=true"
+
+ //add
+ doFirst{
+ ant.taskdef( resource:"emma_ant.properties", classpath: configurations.emma.asPath)
+ ant.path(id:"run.classpath"){
+ pathelement(location:sourceSets.main.classesDir.absolutePath )
+ }
+ ant.emma(verbosity:EMMA_VERBOSITY_LEVEL){
+ instr(merge:"true", destdir:EMMA_INSTR_DIR, instrpathref:"run.classpath", metadatafile:EMMA_META_DATA_FILEPATH){
+ instrpath{
+ fileset(dir:sourceSets.main.classesDir.absolutePath, includes:"*.class")
+ }
+ }
+ setClasspath(files(EMMA_INSTR_DIR) + getClasspath())
+ }
+ }
+
+ doLast{
+ ant.emma(enabled:"true"){
+ report(sourcepath:"src/main/java"){
+ fileset(dir:EMMA_TMP_DIR){
+ include(name:"*.emma")
+ }
+ txt(outfile:"$EMMA_REPORT_PATH/coverage.txt")
+ html(outfile:"$EMMA_REPORT_PATH/coverage.html")
+ xml(outfile:"$EMMA_REPORT_PATH/coverage.xml")
+ }
+ }
+ }
+}
View
BIN emmaPlugin/sample/.DS_Store
Binary file not shown.
View
BIN emmaPlugin/sample/.gradle/0.9-preview-1/taskArtifacts/cache.bin
Binary file not shown.
View
1 emmaPlugin/sample/.gradle/0.9-preview-1/taskArtifacts/cache.properties
@@ -0,0 +1 @@
+#Thu Apr 15 21:17:40 CEST 2010
View
19 emmaPlugin/sample/build.gradle
@@ -0,0 +1,19 @@
+apply plugin:'java'
+apply from:'../emma.gradle'
+
+repositories{
+ mavenCentral()
+}
+
+configurations{
+ emma
+}
+
+
+dependencies{
+ emma "emma:emma:2.0.5312"
+ emma "emma:emma_ant:2.0.5312"
+
+ testCompile "junit:junit:4.7"
+ testCompile "emma:emma:2.0.5312"
+}
View
33 emmaPlugin/sample/src/main/java/org/acme/CutPojo.java
@@ -0,0 +1,33 @@
+package org.acme;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: Rene
+ * Date: 14.04.2010
+ * Time: 21:41:47
+ * To change this template use File | Settings | File Templates.
+ */
+public class CutPojo {
+
+
+ private String prop1;
+
+ private String prop2;
+
+ public String getProp2() {
+ return prop2;
+ }
+
+ public void setProp2(String prop2) {
+ this.prop2 = prop2;
+ }
+
+
+ public String getProp1() {
+ return prop1;
+ }
+
+ public void setProp1(String prop1) {
+ this.prop1 = prop1;
+ }
+}
View
23 emmaPlugin/sample/src/test/java/org/acme/CutPojoTest.java
@@ -0,0 +1,23 @@
+package org.acme;
+
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: Rene
+ * Date: 14.04.2010
+ * Time: 21:46:29
+ * To change this template use File | Settings | File Templates.
+ */
+public class CutPojoTest {
+
+ private CutPojo cut = new CutPojo();
+
+ @Test
+ public void testSetterGetterProp1(){
+ cut.setProp1("prop1");
+ assertEquals("prop1", cut.getProp1());
+ }
+}

0 comments on commit 810c399

Please sign in to comment.