diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2015-06-26 20:17:54 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2015-06-29 11:03:33 +0200 |
commit | 75b7b8905d81a5c54235ca432f12dffb40cd091e (patch) | |
tree | 6a728e3395d50c90e3fb6ce3774669ef55077425 /it | |
parent | b69c9535ee7abef287dfd9dd53332620cfe3a54a (diff) | |
download | sonarqube-75b7b8905d81a5c54235ca432f12dffb40cd091e.tar.gz sonarqube-75b7b8905d81a5c54235ca432f12dffb40cd091e.zip |
Add missing directory in integration tests
Diffstat (limited to 'it')
35 files changed, 341 insertions, 0 deletions
diff --git a/it/it-projects/testing/README.txt b/it/it-projects/testing/README.txt new file mode 100644 index 00000000000..c21c5ec3452 --- /dev/null +++ b/it/it-projects/testing/README.txt @@ -0,0 +1,2 @@ +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. diff --git a/it/it-projects/testing/xoo-half-covered/pom.xml b/it/it-projects/testing/xoo-half-covered/pom.xml new file mode 100644 index 00000000000..25b230c7864 --- /dev/null +++ b/it/it-projects/testing/xoo-half-covered/pom.xml @@ -0,0 +1,47 @@ +<?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> diff --git a/it/it-projects/testing/xoo-half-covered/sonar-project.properties b/it/it-projects/testing/xoo-half-covered/sonar-project.properties new file mode 100644 index 00000000000..ea64e84c3a0 --- /dev/null +++ b/it/it-projects/testing/xoo-half-covered/sonar-project.properties @@ -0,0 +1,5 @@ +sonar.projectKey=xoo-half-covered +sonar.projectName=Sample IT Coverage +sonar.projectVersion=1.0-SNAPSHOT +sonar.sources=src/main/xoo +sonar.language=xoo diff --git a/it/it-projects/testing/xoo-half-covered/src/main/xoo/org/sonar/tests/halfcovered/Covered.xoo b/it/it-projects/testing/xoo-half-covered/src/main/xoo/org/sonar/tests/halfcovered/Covered.xoo new file mode 100644 index 00000000000..fc6abc4a88e --- /dev/null +++ b/it/it-projects/testing/xoo-half-covered/src/main/xoo/org/sonar/tests/halfcovered/Covered.xoo @@ -0,0 +1,8 @@ +package org.sonar.tests.halfcovered; + +public class Covered { + + public int returnOne() { + return 1; + } +} diff --git a/it/it-projects/testing/xoo-half-covered/src/main/xoo/org/sonar/tests/halfcovered/Covered.xoo.coverage b/it/it-projects/testing/xoo-half-covered/src/main/xoo/org/sonar/tests/halfcovered/Covered.xoo.coverage new file mode 100644 index 00000000000..0f42ea6e2b5 --- /dev/null +++ b/it/it-projects/testing/xoo-half-covered/src/main/xoo/org/sonar/tests/halfcovered/Covered.xoo.coverage @@ -0,0 +1 @@ +6:1 diff --git a/it/it-projects/testing/xoo-half-covered/src/main/xoo/org/sonar/tests/halfcovered/UnCovered.xoo b/it/it-projects/testing/xoo-half-covered/src/main/xoo/org/sonar/tests/halfcovered/UnCovered.xoo new file mode 100644 index 00000000000..25f413c7c5a --- /dev/null +++ b/it/it-projects/testing/xoo-half-covered/src/main/xoo/org/sonar/tests/halfcovered/UnCovered.xoo @@ -0,0 +1,8 @@ +package org.sonar.tests.halfcovered; + +public class UnCovered { + + public int returnTwo() { + return 2; + } +} diff --git a/it/it-projects/testing/xoo-half-covered/src/main/xoo/org/sonar/tests/halfcovered/UnCovered.xoo.coverage b/it/it-projects/testing/xoo-half-covered/src/main/xoo/org/sonar/tests/halfcovered/UnCovered.xoo.coverage new file mode 100644 index 00000000000..126ba135e20 --- /dev/null +++ b/it/it-projects/testing/xoo-half-covered/src/main/xoo/org/sonar/tests/halfcovered/UnCovered.xoo.coverage @@ -0,0 +1 @@ +6:0 diff --git a/it/it-projects/testing/xoo-sample-it-coverage/sonar-project.properties b/it/it-projects/testing/xoo-sample-it-coverage/sonar-project.properties new file mode 100644 index 00000000000..18e56c6eb75 --- /dev/null +++ b/it/it-projects/testing/xoo-sample-it-coverage/sonar-project.properties @@ -0,0 +1,5 @@ +sonar.projectKey=sample-it-coverage +sonar.projectName=Sample IT Coverage +sonar.projectVersion=1.0-SNAPSHOT +sonar.sources=src/main/xoo +sonar.language=xoo diff --git a/it/it-projects/testing/xoo-sample-it-coverage/src/main/xoo/sample/Sample.xoo b/it/it-projects/testing/xoo-sample-it-coverage/src/main/xoo/sample/Sample.xoo new file mode 100644 index 00000000000..41871e123a3 --- /dev/null +++ b/it/it-projects/testing/xoo-sample-it-coverage/src/main/xoo/sample/Sample.xoo @@ -0,0 +1,16 @@ +package sample; + +public class Sample { + + public Sample(int i) { + int j = i++; + } + + private String myMethod() { + if (foo == bar) { + return "hello"; + } else { + throw new IllegalStateException(); + } + } +} diff --git a/it/it-projects/testing/xoo-sample-it-coverage/src/main/xoo/sample/Sample.xoo.itcoverage b/it/it-projects/testing/xoo-sample-it-coverage/src/main/xoo/sample/Sample.xoo.itcoverage new file mode 100644 index 00000000000..36860af51ff --- /dev/null +++ b/it/it-projects/testing/xoo-sample-it-coverage/src/main/xoo/sample/Sample.xoo.itcoverage @@ -0,0 +1,4 @@ +6:2 +10:0:2:1 +11:1 +13:0
\ No newline at end of file diff --git a/it/it-projects/testing/xoo-sample-overall-coverage/sonar-project.properties b/it/it-projects/testing/xoo-sample-overall-coverage/sonar-project.properties new file mode 100644 index 00000000000..65fb9b6ed33 --- /dev/null +++ b/it/it-projects/testing/xoo-sample-overall-coverage/sonar-project.properties @@ -0,0 +1,5 @@ +sonar.projectKey=sample-overall-coverage +sonar.projectName=Sample Overall Coverage +sonar.projectVersion=1.0-SNAPSHOT +sonar.sources=src/main/xoo +sonar.language=xoo diff --git a/it/it-projects/testing/xoo-sample-overall-coverage/src/main/xoo/sample/Sample.xoo b/it/it-projects/testing/xoo-sample-overall-coverage/src/main/xoo/sample/Sample.xoo new file mode 100644 index 00000000000..1674d4578dc --- /dev/null +++ b/it/it-projects/testing/xoo-sample-overall-coverage/src/main/xoo/sample/Sample.xoo @@ -0,0 +1,16 @@ +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(); + } + } +} diff --git a/it/it-projects/testing/xoo-sample-overall-coverage/src/main/xoo/sample/Sample.xoo.coverage b/it/it-projects/testing/xoo-sample-overall-coverage/src/main/xoo/sample/Sample.xoo.coverage new file mode 100644 index 00000000000..1c244dbc697 --- /dev/null +++ b/it/it-projects/testing/xoo-sample-overall-coverage/src/main/xoo/sample/Sample.xoo.coverage @@ -0,0 +1,4 @@ +6:2 +10:0:4:1 +11:1 +13:0
\ No newline at end of file diff --git a/it/it-projects/testing/xoo-sample-overall-coverage/src/main/xoo/sample/Sample.xoo.itcoverage b/it/it-projects/testing/xoo-sample-overall-coverage/src/main/xoo/sample/Sample.xoo.itcoverage new file mode 100644 index 00000000000..808d5b37e98 --- /dev/null +++ b/it/it-projects/testing/xoo-sample-overall-coverage/src/main/xoo/sample/Sample.xoo.itcoverage @@ -0,0 +1,4 @@ +6:2 +10:0:4:1 +11:0 +13:1
\ No newline at end of file diff --git a/it/it-projects/testing/xoo-sample-overall-coverage/src/main/xoo/sample/Sample.xoo.overallcoverage b/it/it-projects/testing/xoo-sample-overall-coverage/src/main/xoo/sample/Sample.xoo.overallcoverage new file mode 100644 index 00000000000..82024035bff --- /dev/null +++ b/it/it-projects/testing/xoo-sample-overall-coverage/src/main/xoo/sample/Sample.xoo.overallcoverage @@ -0,0 +1,4 @@ +6:2 +10:0:4:2 +11:1 +13:1
\ No newline at end of file diff --git a/it/it-projects/testing/xoo-sample-ut-coverage-no-condition/sonar-project.properties b/it/it-projects/testing/xoo-sample-ut-coverage-no-condition/sonar-project.properties new file mode 100644 index 00000000000..a931c4c7093 --- /dev/null +++ b/it/it-projects/testing/xoo-sample-ut-coverage-no-condition/sonar-project.properties @@ -0,0 +1,5 @@ +sonar.projectKey=sample-ut-coverage +sonar.projectName=Sample UT Coverage +sonar.projectVersion=1.0-SNAPSHOT +sonar.sources=src/main/xoo +sonar.language=xoo diff --git a/it/it-projects/testing/xoo-sample-ut-coverage-no-condition/src/main/xoo/sample/Sample.xoo b/it/it-projects/testing/xoo-sample-ut-coverage-no-condition/src/main/xoo/sample/Sample.xoo new file mode 100644 index 00000000000..41871e123a3 --- /dev/null +++ b/it/it-projects/testing/xoo-sample-ut-coverage-no-condition/src/main/xoo/sample/Sample.xoo @@ -0,0 +1,16 @@ +package sample; + +public class Sample { + + public Sample(int i) { + int j = i++; + } + + private String myMethod() { + if (foo == bar) { + return "hello"; + } else { + throw new IllegalStateException(); + } + } +} diff --git a/it/it-projects/testing/xoo-sample-ut-coverage-no-condition/src/main/xoo/sample/Sample.xoo.coverage b/it/it-projects/testing/xoo-sample-ut-coverage-no-condition/src/main/xoo/sample/Sample.xoo.coverage new file mode 100644 index 00000000000..5e59aed012e --- /dev/null +++ b/it/it-projects/testing/xoo-sample-ut-coverage-no-condition/src/main/xoo/sample/Sample.xoo.coverage @@ -0,0 +1,4 @@ +6:2 +10:0 +11:1 +13:0
\ No newline at end of file diff --git a/it/it-projects/testing/xoo-sample-ut-coverage/sonar-project.properties b/it/it-projects/testing/xoo-sample-ut-coverage/sonar-project.properties new file mode 100644 index 00000000000..a931c4c7093 --- /dev/null +++ b/it/it-projects/testing/xoo-sample-ut-coverage/sonar-project.properties @@ -0,0 +1,5 @@ +sonar.projectKey=sample-ut-coverage +sonar.projectName=Sample UT Coverage +sonar.projectVersion=1.0-SNAPSHOT +sonar.sources=src/main/xoo +sonar.language=xoo diff --git a/it/it-projects/testing/xoo-sample-ut-coverage/src/main/xoo/sample/Sample.xoo b/it/it-projects/testing/xoo-sample-ut-coverage/src/main/xoo/sample/Sample.xoo new file mode 100644 index 00000000000..41871e123a3 --- /dev/null +++ b/it/it-projects/testing/xoo-sample-ut-coverage/src/main/xoo/sample/Sample.xoo @@ -0,0 +1,16 @@ +package sample; + +public class Sample { + + public Sample(int i) { + int j = i++; + } + + private String myMethod() { + if (foo == bar) { + return "hello"; + } else { + throw new IllegalStateException(); + } + } +} diff --git a/it/it-projects/testing/xoo-sample-ut-coverage/src/main/xoo/sample/Sample.xoo.coverage b/it/it-projects/testing/xoo-sample-ut-coverage/src/main/xoo/sample/Sample.xoo.coverage new file mode 100644 index 00000000000..36860af51ff --- /dev/null +++ b/it/it-projects/testing/xoo-sample-ut-coverage/src/main/xoo/sample/Sample.xoo.coverage @@ -0,0 +1,4 @@ +6:2 +10:0:2:1 +11:1 +13:0
\ No newline at end of file diff --git a/it/it-projects/testing/xoo-sample-with-coverage-per-test/sonar-project.properties b/it/it-projects/testing/xoo-sample-with-coverage-per-test/sonar-project.properties new file mode 100644 index 00000000000..0f2415d0320 --- /dev/null +++ b/it/it-projects/testing/xoo-sample-with-coverage-per-test/sonar-project.properties @@ -0,0 +1,6 @@ +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 diff --git a/it/it-projects/testing/xoo-sample-with-coverage-per-test/src/main/xoo/sample/Sample.xoo b/it/it-projects/testing/xoo-sample-with-coverage-per-test/src/main/xoo/sample/Sample.xoo new file mode 100644 index 00000000000..b1210973dd9 --- /dev/null +++ b/it/it-projects/testing/xoo-sample-with-coverage-per-test/src/main/xoo/sample/Sample.xoo @@ -0,0 +1,12 @@ +package sample; + +public class Sample { + + public Sample(int i) { + int j = i++; + } + + private String myMethod() { + return "hello"; + } +} diff --git a/it/it-projects/testing/xoo-sample-with-coverage-per-test/src/main/xoo/sample/Sample2.xoo b/it/it-projects/testing/xoo-sample-with-coverage-per-test/src/main/xoo/sample/Sample2.xoo new file mode 100644 index 00000000000..ed097595590 --- /dev/null +++ b/it/it-projects/testing/xoo-sample-with-coverage-per-test/src/main/xoo/sample/Sample2.xoo @@ -0,0 +1,12 @@ +package sample; + +public class Sample2 { + + public Sample2(int i) { + int j = i++; + } + + private String myMethod() { + return "hello"; + } +} diff --git a/it/it-projects/testing/xoo-sample-with-coverage-per-test/src/test/xoo/sample/Sample2Test.xoo b/it/it-projects/testing/xoo-sample-with-coverage-per-test/src/test/xoo/sample/Sample2Test.xoo new file mode 100644 index 00000000000..fe2368fefaa --- /dev/null +++ b/it/it-projects/testing/xoo-sample-with-coverage-per-test/src/test/xoo/sample/Sample2Test.xoo @@ -0,0 +1,32 @@ +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"); + } + +} diff --git a/it/it-projects/testing/xoo-sample-with-coverage-per-test/src/test/xoo/sample/Sample2Test.xoo.test b/it/it-projects/testing/xoo-sample-with-coverage-per-test/src/test/xoo/sample/Sample2Test.xoo.test new file mode 100644 index 00000000000..9686b58c1d6 --- /dev/null +++ b/it/it-projects/testing/xoo-sample-with-coverage-per-test/src/test/xoo/sample/Sample2Test.xoo.test @@ -0,0 +1 @@ +another test:10:::OK:UT
\ No newline at end of file diff --git a/it/it-projects/testing/xoo-sample-with-coverage-per-test/src/test/xoo/sample/Sample2Test.xoo.testcoverage b/it/it-projects/testing/xoo-sample-with-coverage-per-test/src/test/xoo/sample/Sample2Test.xoo.testcoverage new file mode 100644 index 00000000000..b7f37235ced --- /dev/null +++ b/it/it-projects/testing/xoo-sample-with-coverage-per-test/src/test/xoo/sample/Sample2Test.xoo.testcoverage @@ -0,0 +1 @@ +another test;src/main/xoo/sample/Sample.xoo,6 diff --git a/it/it-projects/testing/xoo-sample-with-coverage-per-test/src/test/xoo/sample/SampleTest.xoo b/it/it-projects/testing/xoo-sample-with-coverage-per-test/src/test/xoo/sample/SampleTest.xoo new file mode 100644 index 00000000000..fe2368fefaa --- /dev/null +++ b/it/it-projects/testing/xoo-sample-with-coverage-per-test/src/test/xoo/sample/SampleTest.xoo @@ -0,0 +1,32 @@ +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"); + } + +} diff --git a/it/it-projects/testing/xoo-sample-with-coverage-per-test/src/test/xoo/sample/SampleTest.xoo.test b/it/it-projects/testing/xoo-sample-with-coverage-per-test/src/test/xoo/sample/SampleTest.xoo.test new file mode 100644 index 00000000000..b0259693199 --- /dev/null +++ b/it/it-projects/testing/xoo-sample-with-coverage-per-test/src/test/xoo/sample/SampleTest.xoo.test @@ -0,0 +1,4 @@ +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 diff --git a/it/it-projects/testing/xoo-sample-with-coverage-per-test/src/test/xoo/sample/SampleTest.xoo.testcoverage b/it/it-projects/testing/xoo-sample-with-coverage-per-test/src/test/xoo/sample/SampleTest.xoo.testcoverage new file mode 100644 index 00000000000..f6765cf74f0 --- /dev/null +++ b/it/it-projects/testing/xoo-sample-with-coverage-per-test/src/test/xoo/sample/SampleTest.xoo.testcoverage @@ -0,0 +1,2 @@ +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 diff --git a/it/it-projects/testing/xoo-sample-with-tests-execution/sonar-project.properties b/it/it-projects/testing/xoo-sample-with-tests-execution/sonar-project.properties new file mode 100644 index 00000000000..0f2415d0320 --- /dev/null +++ b/it/it-projects/testing/xoo-sample-with-tests-execution/sonar-project.properties @@ -0,0 +1,6 @@ +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 diff --git a/it/it-projects/testing/xoo-sample-with-tests-execution/src/main/xoo/sample/Sample.xoo b/it/it-projects/testing/xoo-sample-with-tests-execution/src/main/xoo/sample/Sample.xoo new file mode 100644 index 00000000000..b1210973dd9 --- /dev/null +++ b/it/it-projects/testing/xoo-sample-with-tests-execution/src/main/xoo/sample/Sample.xoo @@ -0,0 +1,12 @@ +package sample; + +public class Sample { + + public Sample(int i) { + int j = i++; + } + + private String myMethod() { + return "hello"; + } +} diff --git a/it/it-projects/testing/xoo-sample-with-tests-execution/src/test/xoo/sample/SampleTest.xoo b/it/it-projects/testing/xoo-sample-with-tests-execution/src/test/xoo/sample/SampleTest.xoo new file mode 100644 index 00000000000..fe2368fefaa --- /dev/null +++ b/it/it-projects/testing/xoo-sample-with-tests-execution/src/test/xoo/sample/SampleTest.xoo @@ -0,0 +1,32 @@ +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"); + } + +} diff --git a/it/it-projects/testing/xoo-sample-with-tests-execution/src/test/xoo/sample/SampleTest.xoo.measures b/it/it-projects/testing/xoo-sample-with-tests-execution/src/test/xoo/sample/SampleTest.xoo.measures new file mode 100644 index 00000000000..095af4b5e7b --- /dev/null +++ b/it/it-projects/testing/xoo-sample-with-tests-execution/src/test/xoo/sample/SampleTest.xoo.measures @@ -0,0 +1,5 @@ +tests:4 +test_execution_time:8 +skipped_tests:1 +test_errors:1 +test_failures:1
\ No newline at end of file diff --git a/it/it-projects/testing/xoo-sample-with-tests-execution/src/test/xoo/sample/SampleTest.xoo.test b/it/it-projects/testing/xoo-sample-with-tests-execution/src/test/xoo/sample/SampleTest.xoo.test new file mode 100644 index 00000000000..b0259693199 --- /dev/null +++ b/it/it-projects/testing/xoo-sample-with-tests-execution/src/test/xoo/sample/SampleTest.xoo.test @@ -0,0 +1,4 @@ +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 |