diff options
author | Evgeny Mandrikov <mandrikov@gmail.com> | 2011-09-08 18:25:06 +0400 |
---|---|---|
committer | Evgeny Mandrikov <mandrikov@gmail.com> | 2011-09-08 18:47:51 +0400 |
commit | 157058813dd0bae520ac4273aa454b73b7e246d4 (patch) | |
tree | 650f23fb8858c3be0c519d3e0871039250c74d65 /sonar-batch/src/test/java/org/sonar/batch/phases | |
parent | 4d72a556429e94837eca3159b471518ae9221626 (diff) | |
download | sonarqube-157058813dd0bae520ac4273aa454b73b7e246d4.tar.gz sonarqube-157058813dd0bae520ac4273aa454b73b7e246d4.zip |
SONAR-2744 Fix regression in usage of 'sonar.phase'
Diffstat (limited to 'sonar-batch/src/test/java/org/sonar/batch/phases')
-rw-r--r-- | sonar-batch/src/test/java/org/sonar/batch/phases/MavenPhaseExecutorTest.java | 20 |
1 files changed, 13 insertions, 7 deletions
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"); } } |