diff options
author | Evgeny Mandrikov <mandrikov@gmail.com> | 2011-01-28 19:35:57 +0300 |
---|---|---|
committer | Evgeny Mandrikov <mandrikov@gmail.com> | 2011-01-28 19:36:53 +0300 |
commit | 73e6ee80edae3e5f2a543df88776e1039b425462 (patch) | |
tree | 9b5f7a81cbf0fc0bf3f7a8ef3983879f0866e66a /sonar-batch/src/test | |
parent | b69ae6b7c4981e63ba099a96d0c7d8ae9b9e65f0 (diff) | |
download | sonarqube-73e6ee80edae3e5f2a543df88776e1039b425462.tar.gz sonarqube-73e6ee80edae3e5f2a543df88776e1039b425462.zip |
Add workDir to ProjectDefinition
Diffstat (limited to 'sonar-batch/src/test')
-rw-r--r-- | sonar-batch/src/test/java/org/sonar/batch/InMemoryPomCreatorTest.java | 35 |
1 files changed, 7 insertions, 28 deletions
diff --git a/sonar-batch/src/test/java/org/sonar/batch/InMemoryPomCreatorTest.java b/sonar-batch/src/test/java/org/sonar/batch/InMemoryPomCreatorTest.java index c3bec7ff3f2..83550c40c0d 100644 --- a/sonar-batch/src/test/java/org/sonar/batch/InMemoryPomCreatorTest.java +++ b/sonar-batch/src/test/java/org/sonar/batch/InMemoryPomCreatorTest.java @@ -41,7 +41,8 @@ public class InMemoryPomCreatorTest { public void setUp() { properties = new Properties(); File baseDir = new File("."); - project = new ProjectDefinition(baseDir, properties); + File workDir = new File(baseDir, "sonar"); + project = new ProjectDefinition(baseDir, workDir, properties); } @Test @@ -54,6 +55,11 @@ public class InMemoryPomCreatorTest { assertThat(pom.getGroupId(), is("org.example")); assertThat(pom.getArtifactId(), is("example")); assertThat(pom.getProperties(), is(project.getProperties())); + assertThat(pom.getBasedir(), is(project.getBaseDir())); + String buildDirectory = project.getWorkDir().getAbsolutePath() + "/target"; + assertThat(pom.getBuild().getDirectory(), is(buildDirectory)); + assertThat(pom.getBuild().getOutputDirectory(), is(buildDirectory + "/classes")); + assertThat(pom.getReporting().getOutputDirectory(), is(buildDirectory + "/site")); } @Test @@ -84,33 +90,6 @@ public class InMemoryPomCreatorTest { } @Test - public void standardDirectoriesLayout() { - createRequiredProperties(); - - MavenProject pom = create(); - - assertThat(pom.getBasedir(), is(project.getBaseDir())); - String buildDirectory = project.getBaseDir().getAbsolutePath() + "/target"; - assertThat(pom.getBuild().getDirectory(), is(buildDirectory)); - assertThat(pom.getBuild().getOutputDirectory(), is(buildDirectory + "/classes")); - assertThat(pom.getReporting().getOutputDirectory(), is(buildDirectory + "/site")); - } - - @Test - public void nonStandardDirectoriesLayout() { - createRequiredProperties(); - properties.setProperty("project.build.directory", "build"); - properties.setProperty("project.build.outputDirectory", "classes"); - properties.setProperty("project.reporting.outputDirectory", "reports"); - - MavenProject pom = create(); - - assertThat(pom.getBuild().getDirectory(), is("build")); - assertThat(pom.getBuild().getOutputDirectory(), is("classes")); - assertThat(pom.getReporting().getOutputDirectory(), is("reports")); - } - - @Test public void shouldNotFailIfNoBinaries() throws Exception { createRequiredProperties(); |