]> source.dussan.org Git - sonar-scanner-cli.git/commitdiff
SONARPLUGINS-2203 Improve tests
authorFabrice Bellingard <fabrice.bellingard@sonarsource.com>
Thu, 6 Sep 2012 09:18:18 +0000 (11:18 +0200)
committerFabrice Bellingard <fabrice.bellingard@sonarsource.com>
Thu, 6 Sep 2012 09:18:18 +0000 (11:18 +0200)
12 files changed:
src/test/java/org/sonar/runner/model/SonarProjectBuilderTest.java
src/test/resources/org/sonar/runner/model/SonarProjectBuilderTest/multi-module-with-file/sonar-project.properties
src/test/resources/org/sonar/runner/model/SonarProjectBuilderTest/multi-module-with-path/sonar-project.properties
src/test/resources/org/sonar/runner/model/SonarProjectBuilderTest/multi-module-with-unexisting-basedir/sonar-project.properties
src/test/resources/org/sonar/runner/model/SonarProjectBuilderTest/multi-module-with-unexisting-file/sonar-project.properties
src/test/resources/org/sonar/runner/model/SonarProjectBuilderTest/multi-module/sonar-project.properties
src/test/resources/org/sonar/runner/model/SonarProjectBuilderTest/simple-project-with-deprecated-props/libs/lib1.txt [new file with mode: 0644]
src/test/resources/org/sonar/runner/model/SonarProjectBuilderTest/simple-project-with-deprecated-props/libs/lib2.txt [new file with mode: 0644]
src/test/resources/org/sonar/runner/model/SonarProjectBuilderTest/simple-project-with-deprecated-props/sonar-project.properties [new file with mode: 0644]
src/test/resources/org/sonar/runner/model/SonarProjectBuilderTest/simple-project-with-deprecated-props/sources/Fake.java [new file with mode: 0644]
src/test/resources/org/sonar/runner/model/SonarProjectBuilderTest/simple-project-with-unexisting-source-dir/sonar-project.properties
src/test/resources/org/sonar/runner/model/SonarProjectBuilderTest/simple-project/sonar-project.properties

index fe22db62b5ff95813e82d40eb513039f5ef14cd2..d27e88c860ba997ed62adcbd4603c00821dea5af 100644 (file)
@@ -56,6 +56,18 @@ public class SonarProjectBuilderTest {
         TestUtils.getResource(this.getClass(), "simple-project/libs/lib2.txt").getAbsolutePath());
   }
 
+  @Test
+  public void shouldDefineSimpleProjectWithDeprecatedProperties() throws IOException {
+    ProjectDefinition projectDefinition = loadProjectDefinition("simple-project-with-deprecated-props");
+
+    assertThat(projectDefinition.getSourceDirs()).contains("sources");
+    assertThat(projectDefinition.getTestDirs()).contains("tests");
+    assertThat(projectDefinition.getBinaries()).contains("target/classes");
+    assertThat(projectDefinition.getLibraries()).contains(
+        TestUtils.getResource(this.getClass(), "simple-project-with-deprecated-props/libs/lib2.txt").getAbsolutePath(),
+        TestUtils.getResource(this.getClass(), "simple-project-with-deprecated-props/libs/lib2.txt").getAbsolutePath());
+  }
+
   @Test
   public void shouldFailIfUnexistingSourceDirectory() throws IOException {
     thrown.expect(RunnerException.class);
index 4c655a7ede5a57a5ca0343c66e2537ffe6716fe6..782fd4ec48db8215d7e7b97205a6ecb9812eacbb 100644 (file)
@@ -3,9 +3,9 @@ sonar.projectName=Foo Project
 sonar.projectVersion=1.0-SNAPSHOT
 sonar.projectDescription=Description of Foo Project
 
-sources=sources
-tests=tests
-binaries=target/classes
+sonar.sources=sources
+sonar.tests=tests
+sonar.binaries=target/classes
 
 sonar.modules=module1
 
index 202de2e47a0dd8e2d0f513a365ad3ed72856bf53..ce5fa00914cfb44b7c09fa72252cffb884ff4ada 100644 (file)
@@ -3,9 +3,9 @@ sonar.projectName=Foo Project
 sonar.projectVersion=1.0-SNAPSHOT
 sonar.projectDescription=Description of Foo Project
 
-sources=sources
-tests=tests
-binaries=target/classes
+sonar.sources=sources
+sonar.tests=tests
+sonar.binaries=target/classes
 
 sonar.modules=module1
 
index 7249f0aeb1e9b822f1dc2c9a8ae58aa7059c9bb5..67fbf347c0ebbd2dae1349ce939b21305198c82d 100644 (file)
@@ -3,9 +3,9 @@ sonar.projectName=Foo Project
 sonar.projectVersion=1.0-SNAPSHOT
 sonar.projectDescription=Description of Foo Project
 
-sources=sources
-tests=tests
-binaries=target/classes
+sonar.sources=sources
+sonar.tests=tests
+sonar.binaries=target/classes
 
 sonar.modules=module1
 
index 4c655a7ede5a57a5ca0343c66e2537ffe6716fe6..782fd4ec48db8215d7e7b97205a6ecb9812eacbb 100644 (file)
@@ -3,9 +3,9 @@ sonar.projectName=Foo Project
 sonar.projectVersion=1.0-SNAPSHOT
 sonar.projectDescription=Description of Foo Project
 
-sources=sources
-tests=tests
-binaries=target/classes
+sonar.sources=sources
+sonar.tests=tests
+sonar.binaries=target/classes
 
 sonar.modules=module1
 
index 96eb03d0c644d4cb150e012a271cf92ac0b1b55d..4e299262e5d98b89cc8036326b329720afff7b0c 100644 (file)
@@ -3,9 +3,9 @@ sonar.projectName=Foo Project
 sonar.projectVersion=1.0-SNAPSHOT
 sonar.projectDescription=Description of Foo Project
 
-sources=sources
-tests=tests
-binaries=target/classes
+sonar.sources=sources
+sonar.tests=tests
+sonar.binaries=target/classes
 
 sonar.modules=module1,\
               module2
@@ -17,4 +17,4 @@ module2.sonar.projectKey=com.foo.project.module2
 module2.sonar.projectName=Foo Module 2
 # redefine some properties
 module2.sonar.projectDescription=Description of Module 2
-module2.sources=src
+module2.sonar.sources=src
diff --git a/src/test/resources/org/sonar/runner/model/SonarProjectBuilderTest/simple-project-with-deprecated-props/libs/lib1.txt b/src/test/resources/org/sonar/runner/model/SonarProjectBuilderTest/simple-project-with-deprecated-props/libs/lib1.txt
new file mode 100644 (file)
index 0000000..81d4e95
--- /dev/null
@@ -0,0 +1 @@
+lib1
\ No newline at end of file
diff --git a/src/test/resources/org/sonar/runner/model/SonarProjectBuilderTest/simple-project-with-deprecated-props/libs/lib2.txt b/src/test/resources/org/sonar/runner/model/SonarProjectBuilderTest/simple-project-with-deprecated-props/libs/lib2.txt
new file mode 100644 (file)
index 0000000..7dacac0
--- /dev/null
@@ -0,0 +1 @@
+lib2
\ No newline at end of file
diff --git a/src/test/resources/org/sonar/runner/model/SonarProjectBuilderTest/simple-project-with-deprecated-props/sonar-project.properties b/src/test/resources/org/sonar/runner/model/SonarProjectBuilderTest/simple-project-with-deprecated-props/sonar-project.properties
new file mode 100644 (file)
index 0000000..acf3c83
--- /dev/null
@@ -0,0 +1,10 @@
+sonar.projectKey=com.foo.project
+sonar.projectName=Foo Project
+sonar.projectVersion=1.0-SNAPSHOT
+sonar.projectDescription=Description of Foo Project
+
+# Those are the deprecated properties
+sources=sources
+tests=tests
+binaries=target/classes
+libraries=libs/*.txt
diff --git a/src/test/resources/org/sonar/runner/model/SonarProjectBuilderTest/simple-project-with-deprecated-props/sources/Fake.java b/src/test/resources/org/sonar/runner/model/SonarProjectBuilderTest/simple-project-with-deprecated-props/sources/Fake.java
new file mode 100644 (file)
index 0000000..5967658
--- /dev/null
@@ -0,0 +1 @@
+Fake
\ No newline at end of file
index 81bdf167b39fc8688ad2d66f0b6a2593f8bfb462..ea8a1b576ea020be1f143cc00406623b0e9cb977 100644 (file)
@@ -3,7 +3,7 @@ sonar.projectName=Foo Project
 sonar.projectVersion=1.0-SNAPSHOT
 sonar.projectDescription=Description of Foo Project
 
-sources=sources
-tests=tests
-binaries=target/classes
-libraries=libs/*.txt
+sonar.sources=sources
+sonar.tests=tests
+sonar.binaries=target/classes
+sonar.libraries=libs/*.txt