diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2013-06-17 11:27:25 +0200 |
---|---|---|
committer | Julien HENRY <julien.henry@sonarsource.com> | 2013-06-17 11:28:26 +0200 |
commit | 49ad8cb3a835bfc84648ad73164703c9f10c908c (patch) | |
tree | 9fe13c9f71bf7a6e48713983f029c82b64b7edef | |
parent | ffd92ddf3507c0b5ca28cc9ca31c2434bd077ae3 (diff) | |
download | sonarqube-49ad8cb3a835bfc84648ad73164703c9f10c908c.tar.gz sonarqube-49ad8cb3a835bfc84648ad73164703c9f10c908c.zip |
SONAR-4047 Fix UT
-rw-r--r-- | sonar-batch/src/test/java/org/sonar/batch/scan/maven/MavenProjectConverterTest.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sonar-batch/src/test/java/org/sonar/batch/scan/maven/MavenProjectConverterTest.java b/sonar-batch/src/test/java/org/sonar/batch/scan/maven/MavenProjectConverterTest.java index 9150be4031d..f4fc136cab9 100644 --- a/sonar-batch/src/test/java/org/sonar/batch/scan/maven/MavenProjectConverterTest.java +++ b/sonar-batch/src/test/java/org/sonar/batch/scan/maven/MavenProjectConverterTest.java @@ -73,12 +73,12 @@ public class MavenProjectConverterTest { public void shouldConvertModules() throws IOException { File basedir = temp.newFolder(); - MavenProject root = new MavenProject(); + MavenProject root = newMavenProject("com.foo", "parent", "1.0-SNAPSHOT"); root.setFile(new File(basedir, "pom.xml")); root.getBuild().setDirectory("target"); root.getBuild().setOutputDirectory("target/classes"); root.getModules().add("module/pom.xml"); - MavenProject module = new MavenProject(); + MavenProject module = newMavenProject("com.foo", "moduleA", "1.0-SNAPSHOT"); module.setFile(new File(basedir, "module/pom.xml")); module.getBuild().setDirectory("target"); module.getBuild().setOutputDirectory("target/classes"); @@ -87,6 +87,14 @@ public class MavenProjectConverterTest { assertThat(project.getSubProjects().size(), is(1)); } + private MavenProject newMavenProject(String groupId, String artifactId, String version) { + Model model = new Model(); + model.setGroupId(groupId); + model.setArtifactId(artifactId); + model.setVersion(version); + return new MavenProject(model); + } + @Test public void shouldConvertProperties() { MavenProject pom = new MavenProject(); |