aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorEvgeny Mandrikov <mandrikov@gmail.com>2011-04-07 01:02:25 +0400
committerEvgeny Mandrikov <mandrikov@gmail.com>2011-04-12 08:48:51 +0400
commitd6693ffe167bb5d92aaddbd28ff3780a7494f54d (patch)
tree83304225b7fb827ff3302e28722f8abd09440916 /plugins
parent07625d01d50a80c360156869b375f8672b3a280d (diff)
downloadsonarqube-d6693ffe167bb5d92aaddbd28ff3780a7494f54d.tar.gz
sonarqube-d6693ffe167bb5d92aaddbd28ff3780a7494f54d.zip
Improve ProjectFileSystem
* Use ProjectFileSystem instead of DefaultProjectFileSystem in tests * Use InputFileUtils in DefaultProjectFileSystem * Add MavenProjectFileSystem
Diffstat (limited to 'plugins')
-rw-r--r--plugins/sonar-cobertura-plugin/src/test/java/org/sonar/plugins/cobertura/api/CoberturaUtilsTest.java6
-rw-r--r--plugins/sonar-findbugs-plugin/src/test/java/org/sonar/plugins/findbugs/FindbugsSensorTest.java4
-rw-r--r--plugins/sonar-pmd-plugin/src/test/java/org/sonar/plugins/pmd/PmdViolationsXmlParserTest.java4
3 files changed, 7 insertions, 7 deletions
diff --git a/plugins/sonar-cobertura-plugin/src/test/java/org/sonar/plugins/cobertura/api/CoberturaUtilsTest.java b/plugins/sonar-cobertura-plugin/src/test/java/org/sonar/plugins/cobertura/api/CoberturaUtilsTest.java
index 59192a3a258..90a288e058f 100644
--- a/plugins/sonar-cobertura-plugin/src/test/java/org/sonar/plugins/cobertura/api/CoberturaUtilsTest.java
+++ b/plugins/sonar-cobertura-plugin/src/test/java/org/sonar/plugins/cobertura/api/CoberturaUtilsTest.java
@@ -27,7 +27,7 @@ import static org.mockito.Mockito.when;
import org.apache.maven.project.MavenProject;
import org.junit.Test;
import org.sonar.api.CoreProperties;
-import org.sonar.api.resources.DefaultProjectFileSystem;
+import org.sonar.api.resources.ProjectFileSystem;
import org.sonar.api.resources.Project;
import org.sonar.api.test.MavenTestUtils;
@@ -37,7 +37,7 @@ import java.net.URISyntaxException;
public class CoberturaUtilsTest {
@Test
public void shouldGetReportPathFromProperty() throws URISyntaxException {
- DefaultProjectFileSystem fileSystem = mock(DefaultProjectFileSystem.class);
+ ProjectFileSystem fileSystem = mock(ProjectFileSystem.class);
when(fileSystem.resolvePath("foo")).thenReturn(getCoverageReport());
Project project = mock(Project.class);
@@ -53,7 +53,7 @@ public class CoberturaUtilsTest {
public void shouldGetReportPathFromPom() {
MavenProject pom = MavenTestUtils.loadPom("/org/sonar/plugins/cobertura/CoberturaSensorTest/shouldGetReportPathFromPom/pom.xml");
- DefaultProjectFileSystem fileSystem = mock(DefaultProjectFileSystem.class);
+ ProjectFileSystem fileSystem = mock(ProjectFileSystem.class);
Project project = mock(Project.class);
when(project.getPom()).thenReturn(pom);
diff --git a/plugins/sonar-findbugs-plugin/src/test/java/org/sonar/plugins/findbugs/FindbugsSensorTest.java b/plugins/sonar-findbugs-plugin/src/test/java/org/sonar/plugins/findbugs/FindbugsSensorTest.java
index 149ec5daeaf..c4f0d70b9f0 100644
--- a/plugins/sonar-findbugs-plugin/src/test/java/org/sonar/plugins/findbugs/FindbugsSensorTest.java
+++ b/plugins/sonar-findbugs-plugin/src/test/java/org/sonar/plugins/findbugs/FindbugsSensorTest.java
@@ -24,7 +24,7 @@ import org.junit.Test;
import org.sonar.api.CoreProperties;
import org.sonar.api.batch.SensorContext;
import org.sonar.api.profiles.RulesProfile;
-import org.sonar.api.resources.DefaultProjectFileSystem;
+import org.sonar.api.resources.ProjectFileSystem;
import org.sonar.api.resources.JavaFile;
import org.sonar.api.resources.Project;
import org.sonar.api.resources.Resource;
@@ -147,7 +147,7 @@ public class FindbugsSensorTest extends FindbugsTests {
}
private Project createProject() {
- DefaultProjectFileSystem fileSystem = mock(DefaultProjectFileSystem.class);
+ ProjectFileSystem fileSystem = mock(ProjectFileSystem.class);
when(fileSystem.hasJavaSourceFiles()).thenReturn(Boolean.TRUE);
Project project = mock(Project.class);
diff --git a/plugins/sonar-pmd-plugin/src/test/java/org/sonar/plugins/pmd/PmdViolationsXmlParserTest.java b/plugins/sonar-pmd-plugin/src/test/java/org/sonar/plugins/pmd/PmdViolationsXmlParserTest.java
index 5286fcd3df8..4d6a4a0e73f 100644
--- a/plugins/sonar-pmd-plugin/src/test/java/org/sonar/plugins/pmd/PmdViolationsXmlParserTest.java
+++ b/plugins/sonar-pmd-plugin/src/test/java/org/sonar/plugins/pmd/PmdViolationsXmlParserTest.java
@@ -39,7 +39,7 @@ import org.junit.Test;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import org.sonar.api.batch.SensorContext;
-import org.sonar.api.resources.DefaultProjectFileSystem;
+import org.sonar.api.resources.ProjectFileSystem;
import org.sonar.api.resources.JavaFile;
import org.sonar.api.resources.Project;
import org.sonar.api.rules.Rule;
@@ -50,7 +50,7 @@ import org.sonar.api.test.IsViolation;
public class PmdViolationsXmlParserTest {
private void parse(SensorContext context, String xmlPath) throws URISyntaxException, XMLStreamException {
- DefaultProjectFileSystem fileSystem = mock(DefaultProjectFileSystem.class);
+ ProjectFileSystem fileSystem = mock(ProjectFileSystem.class);
when(fileSystem.getSourceDirs()).thenReturn(Arrays.asList(new File("/test/src/main/java")));
Project project = mock(Project.class);