aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2014-10-14 23:03:04 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2014-10-15 09:19:06 +0200
commit967167d9f7b24b8f137f7fa8a594ed82a2a46d32 (patch)
treed23ed15604f0894fd37e9dd65c77c604e45760e1 /plugins
parent87d2f9a8a3093f5e1988f29fbc72a70ed471830b (diff)
downloadsonarqube-967167d9f7b24b8f137f7fa8a594ed82a2a46d32.tar.gz
sonarqube-967167d9f7b24b8f137f7fa8a594ed82a2a46d32.zip
Fix execution of SvnBlameCommandTest in Intellij
Diffstat (limited to 'plugins')
-rw-r--r--plugins/sonar-svn-plugin/src/test/java/org/sonar/plugins/scm/svn/SvnBlameCommandTest.java11
1 files changed, 5 insertions, 6 deletions
diff --git a/plugins/sonar-svn-plugin/src/test/java/org/sonar/plugins/scm/svn/SvnBlameCommandTest.java b/plugins/sonar-svn-plugin/src/test/java/org/sonar/plugins/scm/svn/SvnBlameCommandTest.java
index a3b5a79fc19..f7bb1fc66dc 100644
--- a/plugins/sonar-svn-plugin/src/test/java/org/sonar/plugins/scm/svn/SvnBlameCommandTest.java
+++ b/plugins/sonar-svn-plugin/src/test/java/org/sonar/plugins/scm/svn/SvnBlameCommandTest.java
@@ -20,6 +20,7 @@
package org.sonar.plugins.scm.svn;
import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.IOUtils;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -47,9 +48,7 @@ import java.util.List;
import static org.fest.assertions.Assertions.assertThat;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyLong;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
+import static org.mockito.Mockito.*;
public class SvnBlameCommandTest {
@@ -84,7 +83,7 @@ public class SvnBlameCommandTest {
@Override
public Integer answer(InvocationOnMock invocation) throws Throwable {
StreamConsumer outConsumer = (StreamConsumer) invocation.getArguments()[1];
- List<String> lines = FileUtils.readLines(new File("src/test/resources/blame.xml"), "UTF-8");
+ List<String> lines = IOUtils.readLines(getClass().getResourceAsStream("/blame.xml"), "UTF-8");
for (String line : lines) {
outConsumer.consumeLine(line);
}
@@ -115,7 +114,7 @@ public class SvnBlameCommandTest {
@Override
public Integer answer(InvocationOnMock invocation) throws Throwable {
StreamConsumer outConsumer = (StreamConsumer) invocation.getArguments()[1];
- List<String> lines = FileUtils.readLines(new File("src/test/resources/blame-with-anonymous-commit.xml"), "UTF-8");
+ List<String> lines = IOUtils.readLines(getClass().getResourceAsStream("/blame-with-anonymous-commit.xml"), "UTF-8");
for (String line : lines) {
outConsumer.consumeLine(line);
}
@@ -146,7 +145,7 @@ public class SvnBlameCommandTest {
@Override
public Integer answer(InvocationOnMock invocation) throws Throwable {
StreamConsumer outConsumer = (StreamConsumer) invocation.getArguments()[1];
- List<String> lines = FileUtils.readLines(new File("src/test/resources/blame-with-uncomitted-changes.xml"), "UTF-8");
+ List<String> lines = IOUtils.readLines(getClass().getResourceAsStream("/blame-with-uncomitted-changes.xml"), "UTF-8");
for (String line : lines) {
outConsumer.consumeLine(line);
}