mirror of
https://github.com/wahyd4/java-dojo.git
synced 2026-08-09 04:56:17 +10:00
added cobertura for 100% coverage
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user