From 120cc721996f295724bc889d3497ff20aa1351c7 Mon Sep 17 00:00:00 2001 From: Evgeny Mandrikov Date: Tue, 26 Apr 2011 23:48:49 +0400 Subject: [PATCH] SONAR-2298 Rename MavenProjectBuilder to ProjectBuilder --- .../{MavenProjectBuilder.java => ProjectBuilder.java} | 7 +++---- sonar-batch/src/main/java/org/sonar/batch/ProjectTree.java | 6 +++--- ...avenProjectBuilderTest.java => ProjectBuilderTest.java} | 6 +++--- .../src/test/java/org/sonar/batch/ProjectTreeTest.java | 4 ++-- .../MavenPluginsConfiguratorTest/pom.xml | 0 .../isLatestAnalysis.xml | 0 .../isLatestAnalysisIfNeverAnalysed.xml | 0 .../isNotLatestAnalysis.xml | 0 8 files changed, 11 insertions(+), 12 deletions(-) rename sonar-batch/src/main/java/org/sonar/batch/{MavenProjectBuilder.java => ProjectBuilder.java} (96%) rename sonar-batch/src/test/java/org/sonar/batch/{MavenProjectBuilderTest.java => ProjectBuilderTest.java} (97%) rename sonar-batch/src/test/resources/org/sonar/batch/{MavenProjectBuilderTest => ProjectBuilderTest}/MavenPluginsConfiguratorTest/pom.xml (100%) rename sonar-batch/src/test/resources/org/sonar/batch/{MavenProjectBuilderTest => ProjectBuilderTest}/isLatestAnalysis.xml (100%) rename sonar-batch/src/test/resources/org/sonar/batch/{MavenProjectBuilderTest => ProjectBuilderTest}/isLatestAnalysisIfNeverAnalysed.xml (100%) rename sonar-batch/src/test/resources/org/sonar/batch/{MavenProjectBuilderTest => ProjectBuilderTest}/isNotLatestAnalysis.xml (100%) diff --git a/sonar-batch/src/main/java/org/sonar/batch/MavenProjectBuilder.java b/sonar-batch/src/main/java/org/sonar/batch/ProjectBuilder.java similarity index 96% rename from sonar-batch/src/main/java/org/sonar/batch/MavenProjectBuilder.java rename to sonar-batch/src/main/java/org/sonar/batch/ProjectBuilder.java index 48bc41730b0..c652ce8a76e 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/MavenProjectBuilder.java +++ b/sonar-batch/src/main/java/org/sonar/batch/ProjectBuilder.java @@ -36,12 +36,11 @@ import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; -// TODO Godin: rename to ProjectBuilder ? -public class MavenProjectBuilder { +public class ProjectBuilder { private DatabaseSession databaseSession; - public MavenProjectBuilder(DatabaseSession databaseSession) { + public ProjectBuilder(DatabaseSession databaseSession) { this.databaseSession = databaseSession; } @@ -49,7 +48,7 @@ public class MavenProjectBuilder { Configuration configuration = getStartupConfiguration(project); return new Project(loadProjectKey(project), loadProjectBranch(configuration), loadProjectName(project)) .setDescription(project.getProperties().getProperty(CoreProperties.PROJECT_DESCRIPTION_PROPERTY)) - .setPackaging("jar"); // FIXME http://jira.codehaus.org/browse/SONAR-2341 + .setPackaging("jar"); } Configuration getStartupConfiguration(ProjectDefinition project) { diff --git a/sonar-batch/src/main/java/org/sonar/batch/ProjectTree.java b/sonar-batch/src/main/java/org/sonar/batch/ProjectTree.java index ac2db745ec3..72a599821e6 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/ProjectTree.java +++ b/sonar-batch/src/main/java/org/sonar/batch/ProjectTree.java @@ -36,11 +36,11 @@ import java.util.*; public class ProjectTree { private List projects; - private MavenProjectBuilder projectBuilder; + private ProjectBuilder projectBuilder; private List definitions; public ProjectTree(Reactor sonarReactor, DatabaseSession databaseSession) { - this.projectBuilder = new MavenProjectBuilder(databaseSession); + this.projectBuilder = new ProjectBuilder(databaseSession); definitions = Lists.newArrayList(); for (ProjectDefinition project : sonarReactor.getSortedProjects()) { collectProjects(project, definitions); @@ -50,7 +50,7 @@ public class ProjectTree { /** * for unit tests */ - protected ProjectTree(MavenProjectBuilder projectBuilder, List poms) { + protected ProjectTree(ProjectBuilder projectBuilder, List poms) { this.projectBuilder = projectBuilder; definitions = Lists.newArrayList(); collectProjects(MavenProjectConverter.convert(poms), definitions); diff --git a/sonar-batch/src/test/java/org/sonar/batch/MavenProjectBuilderTest.java b/sonar-batch/src/test/java/org/sonar/batch/ProjectBuilderTest.java similarity index 97% rename from sonar-batch/src/test/java/org/sonar/batch/MavenProjectBuilderTest.java rename to sonar-batch/src/test/java/org/sonar/batch/ProjectBuilderTest.java index 734f4e64424..ffa872b0e1b 100644 --- a/sonar-batch/src/test/java/org/sonar/batch/MavenProjectBuilderTest.java +++ b/sonar-batch/src/test/java/org/sonar/batch/ProjectBuilderTest.java @@ -35,13 +35,13 @@ import static org.hamcrest.core.Is.is; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; -public class MavenProjectBuilderTest extends AbstractDbUnitTestCase { +public class ProjectBuilderTest extends AbstractDbUnitTestCase { - private MavenProjectBuilder builder = null; + private ProjectBuilder builder = null; @Before public void before() { - builder = new MavenProjectBuilder(getSession()); + builder = new ProjectBuilder(getSession()); } @Test 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 c494dfb02bc..fc05f42a4ac 100644 --- a/sonar-batch/src/test/java/org/sonar/batch/ProjectTreeTest.java +++ b/sonar-batch/src/test/java/org/sonar/batch/ProjectTreeTest.java @@ -200,7 +200,7 @@ public class ProjectTreeTest extends AbstractDbUnitTestCase { return pom; } - private MavenProjectBuilder newProjectBuilder() { - return new MavenProjectBuilder(getSession()); + private ProjectBuilder newProjectBuilder() { + return new ProjectBuilder(getSession()); } } diff --git a/sonar-batch/src/test/resources/org/sonar/batch/MavenProjectBuilderTest/MavenPluginsConfiguratorTest/pom.xml b/sonar-batch/src/test/resources/org/sonar/batch/ProjectBuilderTest/MavenPluginsConfiguratorTest/pom.xml similarity index 100% rename from sonar-batch/src/test/resources/org/sonar/batch/MavenProjectBuilderTest/MavenPluginsConfiguratorTest/pom.xml rename to sonar-batch/src/test/resources/org/sonar/batch/ProjectBuilderTest/MavenPluginsConfiguratorTest/pom.xml diff --git a/sonar-batch/src/test/resources/org/sonar/batch/MavenProjectBuilderTest/isLatestAnalysis.xml b/sonar-batch/src/test/resources/org/sonar/batch/ProjectBuilderTest/isLatestAnalysis.xml similarity index 100% rename from sonar-batch/src/test/resources/org/sonar/batch/MavenProjectBuilderTest/isLatestAnalysis.xml rename to sonar-batch/src/test/resources/org/sonar/batch/ProjectBuilderTest/isLatestAnalysis.xml diff --git a/sonar-batch/src/test/resources/org/sonar/batch/MavenProjectBuilderTest/isLatestAnalysisIfNeverAnalysed.xml b/sonar-batch/src/test/resources/org/sonar/batch/ProjectBuilderTest/isLatestAnalysisIfNeverAnalysed.xml similarity index 100% rename from sonar-batch/src/test/resources/org/sonar/batch/MavenProjectBuilderTest/isLatestAnalysisIfNeverAnalysed.xml rename to sonar-batch/src/test/resources/org/sonar/batch/ProjectBuilderTest/isLatestAnalysisIfNeverAnalysed.xml diff --git a/sonar-batch/src/test/resources/org/sonar/batch/MavenProjectBuilderTest/isNotLatestAnalysis.xml b/sonar-batch/src/test/resources/org/sonar/batch/ProjectBuilderTest/isNotLatestAnalysis.xml similarity index 100% rename from sonar-batch/src/test/resources/org/sonar/batch/MavenProjectBuilderTest/isNotLatestAnalysis.xml rename to sonar-batch/src/test/resources/org/sonar/batch/ProjectBuilderTest/isNotLatestAnalysis.xml -- 2.39.5