From 885033d25e863905348f37a566b8cdfc840702b7 Mon Sep 17 00:00:00 2001 From: Teryk Bellahsene Date: Thu, 30 Apr 2015 16:24:13 +0200 Subject: index tests - SONAR-6255 --- .../java/org/sonar/server/benchmark/SourceDbBenchmarkTest.java | 9 +++++---- .../org/sonar/server/benchmark/SourceIndexBenchmarkTest.java | 6 +++--- 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'server/sonar-server-benchmarks') diff --git a/server/sonar-server-benchmarks/src/test/java/org/sonar/server/benchmark/SourceDbBenchmarkTest.java b/server/sonar-server-benchmarks/src/test/java/org/sonar/server/benchmark/SourceDbBenchmarkTest.java index 85726d70af8..953f036f12e 100644 --- a/server/sonar-server-benchmarks/src/test/java/org/sonar/server/benchmark/SourceDbBenchmarkTest.java +++ b/server/sonar-server-benchmarks/src/test/java/org/sonar/server/benchmark/SourceDbBenchmarkTest.java @@ -31,7 +31,8 @@ import org.sonar.core.source.db.FileSourceDto; import org.sonar.server.db.DbClient; import org.sonar.server.source.db.FileSourceDao; import org.sonar.server.source.db.FileSourceDb; -import org.sonar.server.source.index.SourceFileResultSetIterator; +import org.sonar.server.source.index.FileSourcesUpdaterUtil; +import org.sonar.server.source.index.SourceLineResultSetIterator; import java.io.IOException; import java.sql.Connection; @@ -73,10 +74,10 @@ public class SourceDbBenchmarkTest { try { long start = System.currentTimeMillis(); - SourceFileResultSetIterator it = SourceFileResultSetIterator.create(dbClient, connection, 0L, null); + SourceLineResultSetIterator it = SourceLineResultSetIterator.create(dbClient, connection, 0L, null); while (it.hasNext()) { - SourceFileResultSetIterator.Row row = it.next(); - assertThat(row.getLineUpdateRequests().size()).isEqualTo(NUMBER_OF_LINES); + FileSourcesUpdaterUtil.Row row = it.next(); + assertThat(row.getUpdateRequests().size()).isEqualTo(NUMBER_OF_LINES); assertThat(row.getFileUuid()).isNotEmpty(); counter.incrementAndGet(); } diff --git a/server/sonar-server-benchmarks/src/test/java/org/sonar/server/benchmark/SourceIndexBenchmarkTest.java b/server/sonar-server-benchmarks/src/test/java/org/sonar/server/benchmark/SourceIndexBenchmarkTest.java index 23db5b1f112..de4c7e274e8 100644 --- a/server/sonar-server-benchmarks/src/test/java/org/sonar/server/benchmark/SourceIndexBenchmarkTest.java +++ b/server/sonar-server-benchmarks/src/test/java/org/sonar/server/benchmark/SourceIndexBenchmarkTest.java @@ -102,7 +102,7 @@ public class SourceIndexBenchmarkTest { // TODO assertions } - private static class SourceIterator implements Iterator { + private static class SourceIterator implements Iterator { private final long nbFiles; private final int nbLinesPerFile; private int currentProject = 0; @@ -125,7 +125,7 @@ public class SourceIndexBenchmarkTest { } @Override - public SourceFileResultSetIterator.Row next() { + public FileSourcesUpdaterUtil.Row next() { String projectUuid = "P" + currentProject; String fileUuid = "FILE" + count.get(); dataBuilder.clear(); @@ -155,7 +155,7 @@ public class SourceIndexBenchmarkTest { if (count.get() % 500 == 0) { currentProject++; } - return SourceFileResultSetIterator.toRow(projectUuid, fileUuid, new Date(), dataBuilder.build()); + return SourceLineResultSetIterator.toRow(projectUuid, fileUuid, new Date(), dataBuilder.build()); } @Override -- cgit v1.2.3