--- /dev/null
+Note that if you expect "test_execution_time" greater than zero, then you should guarantee execution time at least in 1 second.
+So use Thread.sleep in order to have stable test.
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>com.sonarsource.it.exclusions</groupId>
+ <artifactId>java-half-covered</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <name>Sonar :: Integration Tests :: Java Half Covered</name>
+
+ <url>http://www.javahalfcovered.org</url>
+
+ <issueManagement>
+ <system>jira</system>
+ <url>http://jira.codehaus.org/browse/JAVAHALFCOVERED</url>
+ </issueManagement>
+
+ <scm>
+ <connection>scm:git:git@github.com:SonarSource/javahalfcovered.git</connection>
+ <developerConnection>scm:git:git@github.com:SonarSource/javahalfcovered.git</developerConnection>
+ <url>https://github.com/SonarSource/javahalfcovered</url>
+ </scm>
+
+ <properties>
+ <sonar.scm.disabled>true</sonar.scm.disabled>
+ </properties>
+
+ <ciManagement>
+ <system>bamboo</system>
+ <url>http://bamboo.ci.codehaus.org/browse/JAVAHALFCOVERED</url>
+ </ciManagement>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.2</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.easytesting</groupId>
+ <artifactId>fest-assert</artifactId>
+ <version>1.4</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+</project>
--- /dev/null
+sonar.projectKey=xoo-half-covered
+sonar.projectName=Sample IT Coverage
+sonar.projectVersion=1.0-SNAPSHOT
+sonar.sources=src/main/xoo
+sonar.language=xoo
--- /dev/null
+package org.sonar.tests.halfcovered;
+
+public class Covered {
+
+ public int returnOne() {
+ return 1;
+ }
+}
--- /dev/null
+package org.sonar.tests.halfcovered;
+
+public class UnCovered {
+
+ public int returnTwo() {
+ return 2;
+ }
+}
--- /dev/null
+sonar.projectKey=sample-it-coverage
+sonar.projectName=Sample IT Coverage
+sonar.projectVersion=1.0-SNAPSHOT
+sonar.sources=src/main/xoo
+sonar.language=xoo
--- /dev/null
+package sample;
+
+public class Sample {
+
+ public Sample(int i) {
+ int j = i++;
+ }
+
+ private String myMethod() {
+ if (foo == bar) {
+ return "hello";
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+}
--- /dev/null
+6:2
+10:0:2:1
+11:1
+13:0
\ No newline at end of file
--- /dev/null
+sonar.projectKey=sample-overall-coverage
+sonar.projectName=Sample Overall Coverage
+sonar.projectVersion=1.0-SNAPSHOT
+sonar.sources=src/main/xoo
+sonar.language=xoo
--- /dev/null
+package sample;
+
+public class Sample {
+
+ public Sample(int i) {
+ int j = i++;
+ }
+
+ private String myMethod() {
+ if (foo == bar && biz > 1) {
+ return "hello";
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+}
--- /dev/null
+6:2
+10:0:4:1
+11:1
+13:0
\ No newline at end of file
--- /dev/null
+6:2
+10:0:4:1
+11:0
+13:1
\ No newline at end of file
--- /dev/null
+6:2
+10:0:4:2
+11:1
+13:1
\ No newline at end of file
--- /dev/null
+sonar.projectKey=sample-ut-coverage
+sonar.projectName=Sample UT Coverage
+sonar.projectVersion=1.0-SNAPSHOT
+sonar.sources=src/main/xoo
+sonar.language=xoo
--- /dev/null
+package sample;
+
+public class Sample {
+
+ public Sample(int i) {
+ int j = i++;
+ }
+
+ private String myMethod() {
+ if (foo == bar) {
+ return "hello";
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+}
--- /dev/null
+6:2
+10:0
+11:1
+13:0
\ No newline at end of file
--- /dev/null
+sonar.projectKey=sample-ut-coverage
+sonar.projectName=Sample UT Coverage
+sonar.projectVersion=1.0-SNAPSHOT
+sonar.sources=src/main/xoo
+sonar.language=xoo
--- /dev/null
+package sample;
+
+public class Sample {
+
+ public Sample(int i) {
+ int j = i++;
+ }
+
+ private String myMethod() {
+ if (foo == bar) {
+ return "hello";
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+}
--- /dev/null
+6:2
+10:0:2:1
+11:1
+13:0
\ No newline at end of file
--- /dev/null
+sonar.projectKey=sample-with-tests
+sonar.projectName=Sample with tests
+sonar.projectVersion=1.0-SNAPSHOT
+sonar.sources=src/main/xoo
+sonar.tests=src/test/xoo
+sonar.language=xoo
\ No newline at end of file
--- /dev/null
+package sample;
+
+public class Sample {
+
+ public Sample(int i) {
+ int j = i++;
+ }
+
+ private String myMethod() {
+ return "hello";
+ }
+}
--- /dev/null
+package sample;
+
+public class Sample2 {
+
+ public Sample2(int i) {
+ int j = i++;
+ }
+
+ private String myMethod() {
+ return "hello";
+ }
+}
--- /dev/null
+package sample;
+
+import org.hamcrest.CoreMatchers;
+import org.junit.Test;
+
+import static org.junit.Assert.assertThat;
+
+public class SampleTest {
+
+ @Test
+ @Ignore
+ public void skipped() {
+ Sample sample = new Sample(1);
+ assertThat(sample.getI(), CoreMatchers.is(1));
+ }
+
+ @Test
+ public void failure() {
+ fail();
+ }
+
+ @Test
+ public void error() {
+ throw new IllegalStateException("Foo");
+ }
+
+ @Test
+ public void success() {
+ System.out.println("OK");
+ }
+
+}
--- /dev/null
+another test:10:::OK:UT
\ No newline at end of file
--- /dev/null
+another test;src/main/xoo/sample/Sample.xoo,6
--- /dev/null
+package sample;
+
+import org.hamcrest.CoreMatchers;
+import org.junit.Test;
+
+import static org.junit.Assert.assertThat;
+
+public class SampleTest {
+
+ @Test
+ @Ignore
+ public void skipped() {
+ Sample sample = new Sample(1);
+ assertThat(sample.getI(), CoreMatchers.is(1));
+ }
+
+ @Test
+ public void failure() {
+ fail();
+ }
+
+ @Test
+ public void error() {
+ throw new IllegalStateException("Foo");
+ }
+
+ @Test
+ public void success() {
+ System.out.println("OK");
+ }
+
+}
--- /dev/null
+skipped::::SKIPPED:UNIT
+failure:2:Failure::FAILURE:UNIT
+error:2:Error:The stack:ERROR:UNIT
+success:4:::OK:INTEGRATION
\ No newline at end of file
--- /dev/null
+success;src/main/xoo/sample/Sample.xoo,6,10;src/main/xoo/sample/Sample2.xoo,10
+failure;src/main/xoo/sample/Sample.xoo,6
\ No newline at end of file
--- /dev/null
+sonar.projectKey=sample-with-tests
+sonar.projectName=Sample with tests
+sonar.projectVersion=1.0-SNAPSHOT
+sonar.sources=src/main/xoo
+sonar.tests=src/test/xoo
+sonar.language=xoo
\ No newline at end of file
--- /dev/null
+package sample;
+
+public class Sample {
+
+ public Sample(int i) {
+ int j = i++;
+ }
+
+ private String myMethod() {
+ return "hello";
+ }
+}
--- /dev/null
+package sample;
+
+import org.hamcrest.CoreMatchers;
+import org.junit.Test;
+
+import static org.junit.Assert.assertThat;
+
+public class SampleTest {
+
+ @Test
+ @Ignore
+ public void skipped() {
+ Sample sample = new Sample(1);
+ assertThat(sample.getI(), CoreMatchers.is(1));
+ }
+
+ @Test
+ public void failure() {
+ fail();
+ }
+
+ @Test
+ public void error() {
+ throw new IllegalStateException("Foo");
+ }
+
+ @Test
+ public void success() {
+ System.out.println("OK");
+ }
+
+}
--- /dev/null
+tests:4
+test_execution_time:8
+skipped_tests:1
+test_errors:1
+test_failures:1
\ No newline at end of file
--- /dev/null
+skipped::::SKIPPED:UNIT
+failure:2:Failure::FAILURE:UNIT
+error:2:Error:The stack:ERROR:UNIT
+success:4:::OK:INTEGRATION
\ No newline at end of file