From 8826d8ad767e42ac609fd653bde1efb968f1d2f3 Mon Sep 17 00:00:00 2001 From: Jeff Xiong Date: Wed, 13 Mar 2013 08:46:27 +0800 Subject: [PATCH] added cobertura for 100% coverage --- pom.xml | 27 +++++++++++++++++++ src/main/java/org/thoughtworkers/Hello.java | 7 +++++ .../java/org/thoughtworkers/HelloTest.java | 14 ++++++++++ .../java/org/thoughtworkers/SmokeTest.java | 13 --------- 4 files changed, 48 insertions(+), 13 deletions(-) create mode 100644 src/main/java/org/thoughtworkers/Hello.java create mode 100644 src/test/java/org/thoughtworkers/HelloTest.java delete mode 100644 src/test/java/org/thoughtworkers/SmokeTest.java diff --git a/pom.xml b/pom.xml index 70a23bb..f849aa0 100644 --- a/pom.xml +++ b/pom.xml @@ -16,4 +16,31 @@ + + + + org.codehaus.mojo + cobertura-maven-plugin + 2.5.2 + + + test + + cobertura + + + + + + 100 + 100 + 100 + 100 + 100 + 100 + + + + + \ No newline at end of file diff --git a/src/main/java/org/thoughtworkers/Hello.java b/src/main/java/org/thoughtworkers/Hello.java new file mode 100644 index 0000000..169fcd1 --- /dev/null +++ b/src/main/java/org/thoughtworkers/Hello.java @@ -0,0 +1,7 @@ +package org.thoughtworkers; + +public class Hello { + public String say() { + return "Hello, world!"; + } +} diff --git a/src/test/java/org/thoughtworkers/HelloTest.java b/src/test/java/org/thoughtworkers/HelloTest.java new file mode 100644 index 0000000..ba514ce --- /dev/null +++ b/src/test/java/org/thoughtworkers/HelloTest.java @@ -0,0 +1,14 @@ +package org.thoughtworkers; + +import org.junit.Test; + +import static org.hamcrest.core.Is.is; +import static org.junit.Assert.assertThat; + +public class HelloTest { + @Test + public void shouldSayHelloToTheWorld() throws Exception { + Hello hello = new Hello(); + assertThat(hello.say(), is("Hello, world!")); + } +} diff --git a/src/test/java/org/thoughtworkers/SmokeTest.java b/src/test/java/org/thoughtworkers/SmokeTest.java deleted file mode 100644 index ff2c2a2..0000000 --- a/src/test/java/org/thoughtworkers/SmokeTest.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.thoughtworkers; - -import org.junit.Test; - -import static org.hamcrest.core.Is.is; -import static org.junit.Assert.assertThat; - -public class SmokeTest { - @Test - public void shouldAlwaysPass() throws Exception { - assertThat(1, is(1)); - } -}