From 76bed236592c538acd248009af0a0126b47354fb Mon Sep 17 00:00:00 2001 From: Evgeny Mandrikov Date: Wed, 4 May 2011 15:50:46 +0400 Subject: [PATCH] SONAR-2409 Remove ability to use deprecated property 'branch' --- .../main/java/org/sonar/batch/ProjectBuilder.java | 2 +- .../test/java/org/sonar/batch/ProjectTreeTest.java | 11 ----------- .../keyIncludesDeprecatedBranch/pom.xml | 12 ------------ 3 files changed, 1 insertion(+), 24 deletions(-) delete mode 100644 sonar-batch/src/test/resources/org/sonar/batch/ProjectTreeTest/keyIncludesDeprecatedBranch/pom.xml diff --git a/sonar-batch/src/main/java/org/sonar/batch/ProjectBuilder.java b/sonar-batch/src/main/java/org/sonar/batch/ProjectBuilder.java index b281c467154..1761431ce7f 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/ProjectBuilder.java +++ b/sonar-batch/src/main/java/org/sonar/batch/ProjectBuilder.java @@ -78,7 +78,7 @@ public class ProjectBuilder { } String loadProjectBranch(Configuration configuration) { - return configuration.getString(CoreProperties.PROJECT_BRANCH_PROPERTY, configuration.getString("branch" /* deprecated property */)); + return configuration.getString(CoreProperties.PROJECT_BRANCH_PROPERTY); } public void configure(Project project, ProjectDefinition def) { diff --git a/sonar-batch/src/test/java/org/sonar/batch/ProjectTreeTest.java b/sonar-batch/src/test/java/org/sonar/batch/ProjectTreeTest.java index fc05f42a4ac..baf1629cfc7 100644 --- a/sonar-batch/src/test/java/org/sonar/batch/ProjectTreeTest.java +++ b/sonar-batch/src/test/java/org/sonar/batch/ProjectTreeTest.java @@ -103,17 +103,6 @@ public class ProjectTreeTest extends AbstractDbUnitTestCase { assertThat(tree.getRootProject().getName(), is("Project BRANCH-1.X")); } - @Test - public void keyIncludesDeprecatedBranch() throws IOException, XmlPullParserException, URISyntaxException { - MavenProject pom = loadProject("/org/sonar/batch/ProjectTreeTest/keyIncludesDeprecatedBranch/pom.xml", true); - - ProjectTree tree = new ProjectTree(newProjectBuilder(), Arrays.asList(pom)); - tree.start(); - - assertThat(tree.getRootProject().getKey(), is("org.test:project:BRANCH-1.X")); - assertThat(tree.getRootProject().getName(), is("Project BRANCH-1.X")); - } - @Test public void doNotSkipAnyModules() { Project foo = newProjectWithArtifactId("root"); diff --git a/sonar-batch/src/test/resources/org/sonar/batch/ProjectTreeTest/keyIncludesDeprecatedBranch/pom.xml b/sonar-batch/src/test/resources/org/sonar/batch/ProjectTreeTest/keyIncludesDeprecatedBranch/pom.xml deleted file mode 100644 index 3fadbf40db1..00000000000 --- a/sonar-batch/src/test/resources/org/sonar/batch/ProjectTreeTest/keyIncludesDeprecatedBranch/pom.xml +++ /dev/null @@ -1,12 +0,0 @@ - - 4.0.0 - org.test - project - 0.1-SNAPSHOT - pom - Project - - BRANCH-1.X - - \ No newline at end of file -- 2.39.5