aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-batch/src/test
diff options
context:
space:
mode:
authorEvgeny Mandrikov <mandrikov@gmail.com>2011-09-08 18:25:06 +0400
committerEvgeny Mandrikov <mandrikov@gmail.com>2011-09-08 18:47:51 +0400
commit157058813dd0bae520ac4273aa454b73b7e246d4 (patch)
tree650f23fb8858c3be0c519d3e0871039250c74d65 /sonar-batch/src/test
parent4d72a556429e94837eca3159b471518ae9221626 (diff)
downloadsonarqube-157058813dd0bae520ac4273aa454b73b7e246d4.tar.gz
sonarqube-157058813dd0bae520ac4273aa454b73b7e246d4.zip
SONAR-2744 Fix regression in usage of 'sonar.phase'
Diffstat (limited to 'sonar-batch/src/test')
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/bootstrap/BootstrapModuleTest.java8
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/phases/MavenPhaseExecutorTest.java20
2 files changed, 17 insertions, 11 deletions
diff --git a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/BootstrapModuleTest.java b/sonar-batch/src/test/java/org/sonar/batch/bootstrap/BootstrapModuleTest.java
index ff62f837bbd..f92f6084c35 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/BootstrapModuleTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/bootstrap/BootstrapModuleTest.java
@@ -19,6 +19,9 @@
*/
package org.sonar.batch.bootstrap;
+import static org.hamcrest.Matchers.is;
+import static org.junit.Assert.assertThat;
+
import org.junit.Test;
import org.sonar.api.batch.bootstrap.ProjectDefinition;
import org.sonar.api.batch.bootstrap.ProjectReactor;
@@ -26,13 +29,10 @@ import org.sonar.api.batch.maven.MavenPluginHandler;
import org.sonar.api.resources.Project;
import org.sonar.batch.MavenPluginExecutor;
-import static org.hamcrest.Matchers.is;
-import static org.junit.Assert.assertThat;
-
public class BootstrapModuleTest {
class MyMavenPluginExecutor implements MavenPluginExecutor {
- public void execute(Project project, String goal) {
+ public void execute(Project project, ProjectDefinition projectDef, String goal) {
}
public MavenPluginHandler execute(Project project, ProjectDefinition projectDef, MavenPluginHandler handler) {
diff --git a/sonar-batch/src/test/java/org/sonar/batch/phases/MavenPhaseExecutorTest.java b/sonar-batch/src/test/java/org/sonar/batch/phases/MavenPhaseExecutorTest.java
index 49effe0b450..28cb920be2a 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/phases/MavenPhaseExecutorTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/phases/MavenPhaseExecutorTest.java
@@ -19,32 +19,38 @@
*/
package org.sonar.batch.phases;
+import static org.mockito.Matchers.anyString;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.verify;
+
import org.apache.commons.configuration.PropertiesConfiguration;
import org.junit.Test;
+import org.sonar.api.batch.bootstrap.ProjectDefinition;
import org.sonar.api.resources.Project;
import org.sonar.batch.MavenPluginExecutor;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Mockito.*;
-
public class MavenPhaseExecutorTest {
@Test
public void doNothingIfNoPhase() {
+ ProjectDefinition projectDef = ProjectDefinition.create();
MavenPluginExecutor mavenPluginExecutor = mock(MavenPluginExecutor.class);
- MavenPhaseExecutor phaseExecutor = new MavenPhaseExecutor(mavenPluginExecutor);
+ MavenPhaseExecutor phaseExecutor = new MavenPhaseExecutor(projectDef, mavenPluginExecutor);
Project project = new Project("key");
phaseExecutor.execute(project);
- verify(mavenPluginExecutor, never()).execute(eq(project), anyString());
+ verify(mavenPluginExecutor, never()).execute(eq(project), eq(projectDef), anyString());
}
@Test
public void executePhase() {
+ ProjectDefinition projectDef = ProjectDefinition.create();
MavenPluginExecutor mavenPluginExecutor = mock(MavenPluginExecutor.class);
- MavenPhaseExecutor phaseExecutor = new MavenPhaseExecutor(mavenPluginExecutor);
+ MavenPhaseExecutor phaseExecutor = new MavenPhaseExecutor(projectDef, mavenPluginExecutor);
Project project = new Project("key");
PropertiesConfiguration conf = new PropertiesConfiguration();
@@ -53,6 +59,6 @@ public class MavenPhaseExecutorTest {
phaseExecutor.execute(project);
- verify(mavenPluginExecutor).execute(project, "myphase");
+ verify(mavenPluginExecutor).execute(project, projectDef, "myphase");
}
}