diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2015-01-28 22:41:25 +0100 |
---|---|---|
committer | Julien HENRY <julien.henry@sonarsource.com> | 2015-02-10 17:16:01 +0100 |
commit | e9b5effe30cf68820a3dfb00bf736a325313206b (patch) | |
tree | 74323c9b304a2b5f76d2f77ca6c4b86d03fa4296 /plugins/sonar-cpd-plugin/src | |
parent | 46b6c6f692964e6202aa269245e579badb856e94 (diff) | |
download | sonarqube-e9b5effe30cf68820a3dfb00bf736a325313206b.tar.gz sonarqube-e9b5effe30cf68820a3dfb00bf736a325313206b.zip |
SONAR-6134, SONAR-6048 Improve performance of FS indexation
Diffstat (limited to 'plugins/sonar-cpd-plugin/src')
3 files changed, 5 insertions, 5 deletions
diff --git a/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/CpdSensorTest.java b/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/CpdSensorTest.java index 28a78f5cc50..a4cfc381ae8 100644 --- a/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/CpdSensorTest.java +++ b/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/CpdSensorTest.java @@ -52,7 +52,7 @@ public class CpdSensorTest { sonarBridgeEngine = new DefaultCpdEngine(indexFactory, new CpdMappings(), null, null, mock(BlockCache.class)); settings = new Settings(new PropertyDefinitions(CpdPlugin.class)); - DefaultFileSystem fs = new DefaultFileSystem(temp.newFolder()); + DefaultFileSystem fs = new DefaultFileSystem(temp.newFolder().toPath()); sensor = new CpdSensor(sonarEngine, sonarBridgeEngine, settings, fs); } diff --git a/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/JavaCpdEngineTest.java b/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/JavaCpdEngineTest.java index aa87b90dc13..182f57091d0 100644 --- a/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/JavaCpdEngineTest.java +++ b/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/JavaCpdEngineTest.java @@ -72,7 +72,7 @@ public class JavaCpdEngineTest { inputFile = new DeprecatedDefaultInputFile("foo", "src/main/java/Foo.java"); duplicationBuilder = spy(new DefaultDuplicationBuilder(inputFile)); when(context.duplicationBuilder(any(InputFile.class))).thenReturn(duplicationBuilder); - inputFile.setFile(temp.newFile("Foo.java")); + inputFile.setModuleBaseDir(temp.newFolder().toPath()); } @SuppressWarnings("unchecked") diff --git a/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/decorators/SumDuplicationsDecoratorTest.java b/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/decorators/SumDuplicationsDecoratorTest.java index 0c733e9227a..de90865b0d0 100644 --- a/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/decorators/SumDuplicationsDecoratorTest.java +++ b/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/decorators/SumDuplicationsDecoratorTest.java @@ -27,8 +27,8 @@ import org.sonar.api.resources.File; import org.sonar.api.resources.Qualifiers; import org.sonar.api.test.IsMeasure; -import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.greaterThan; +import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertThat; import static org.mockito.Matchers.any; import static org.mockito.Matchers.argThat; @@ -48,7 +48,7 @@ public class SumDuplicationsDecoratorTest { @Test public void doNotSetDuplicationsOnUnitTests() { SumDuplicationsDecorator decorator = new SumDuplicationsDecorator(); - File unitTest = new File("org/foo/BarTest.java"); + File unitTest = File.create("org/foo/BarTest.java"); unitTest.setQualifier(Qualifiers.UNIT_TEST_FILE); DecoratorContext context = mock(DecoratorContext.class); @@ -60,7 +60,7 @@ public class SumDuplicationsDecoratorTest { @Test public void saveZeroIfNoDuplications() { SumDuplicationsDecorator decorator = new SumDuplicationsDecorator(); - File file = new File("org/foo/BarTest.java"); + File file = File.create("org/foo/BarTest.java"); DecoratorContext context = mock(DecoratorContext.class); decorator.decorate(file, context); |