added cobertura for 100% coverage

This commit is contained in:
Jeff Xiong
2013-03-13 08:46:27 +08:00
parent 77d7982ff6
commit 8826d8ad76
4 changed files with 48 additions and 13 deletions
+27
View File
@@ -16,4 +16,31 @@
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.5.2</version>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>cobertura</goal>
</goals>
</execution>
</executions>
<configuration>
<check>
<branchRate>100</branchRate>
<lineRate>100</lineRate>
<totalBranchRate>100</totalBranchRate>
<totalLineRate>100</totalLineRate>
<packageLineRate>100</packageLineRate>
<packageBranchRate>100</packageBranchRate>
</check>
</configuration>
</plugin>
</plugins>
</build>
</project>
@@ -0,0 +1,7 @@
package org.thoughtworkers;
public class Hello {
public String say() {
return "Hello, world!";
}
}
@@ -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!"));
}
}
@@ -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));
}
}