Skip to content

Commit 69d08ea

Browse files
committed
fix small test bugs in OpenHuFUBenchmarkTest
1 parent d21b8c2 commit 69d08ea

File tree

1 file changed

+10
-25
lines changed

1 file changed

+10
-25
lines changed

benchmark/src/test/java/com/hufudb/openhufu/benchmark/OpenHuFuBenchmarkTest.java

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import com.google.common.collect.ImmutableList;
66
import com.google.common.reflect.TypeToken;
77
import com.google.gson.Gson;
8-
import com.hufudb.openhufu.benchmark.OpenHuFuBenchmark;
98
import com.hufudb.openhufu.benchmark.enums.TPCHTableName;
109
import com.hufudb.openhufu.core.table.GlobalTableConfig;
1110
import com.hufudb.openhufu.data.schema.Schema;
@@ -29,32 +28,18 @@
2928
import java.util.ArrayList;
3029
import java.util.List;
3130

32-
import com.hufudb.openhufu.plan.Plan;
3331
import com.hufudb.openhufu.proto.OpenHuFuPlan;
32+
import org.junit.BeforeClass;
3433
import org.junit.Test;
35-
import org.junit.Before;
36-
import org.junit.After;
37-
import org.openjdk.jmh.annotations.Benchmark;
38-
import org.openjdk.jmh.annotations.Fork;
39-
import org.openjdk.jmh.annotations.Measurement;
40-
import org.openjdk.jmh.annotations.Setup;
41-
import org.openjdk.jmh.annotations.Warmup;
4234
import org.slf4j.Logger;
4335
import org.slf4j.LoggerFactory;
4436

45-
/**
46-
* OpenHuFuBenchmark Tester.
47-
*
48-
* @author <Authors name>
49-
* @since <pre>2月 15, 2023</pre>
50-
* @version 1.0
51-
*/
5237
public class OpenHuFuBenchmarkTest {
5338
private static final Logger LOG = LoggerFactory.getLogger(OpenHuFuBenchmark.class);
5439
private static final OpenHuFuUser user = new OpenHuFuUser();
5540

56-
@Before
57-
public void setUp() throws IOException {
41+
@BeforeClass
42+
public static void setUp() throws IOException {
5843

5944
List<String> endpoints =
6045
new Gson().fromJson(Files.newBufferedReader(
@@ -353,10 +338,10 @@ public void testGroupByAndOrder() {
353338
LeafPlan plan = new LeafPlan();
354339
plan.setTableName(tableName);
355340
plan.setSelectExps(
356-
ImmutableList.of(ExpressionFactory.createInputRef(0, ColumnType.STRING, Modifier.PUBLIC),
357-
ExpressionFactory.createInputRef(3, ColumnType.STRING, Modifier.PUBLIC)));
341+
ImmutableList.of(ExpressionFactory.createInputRef(0, ColumnType.LONG, Modifier.PUBLIC),
342+
ExpressionFactory.createInputRef(3, ColumnType.LONG, Modifier.PUBLIC)));
358343
plan.setAggExps(ImmutableList.of(
359-
ExpressionFactory.createAggFunc(ColumnType.STRING, Modifier.PUBLIC, AggFuncType.GROUPKEY.getId(),
344+
ExpressionFactory.createAggFunc(ColumnType.LONG, Modifier.PUBLIC, AggFuncType.GROUPKEY.getId(),
360345
ImmutableList
361346
.of(ExpressionFactory.createInputRef(1, ColumnType.STRING, Modifier.PUBLIC))),
362347
ExpressionFactory.createAggFunc(ColumnType.LONG, Modifier.PUBLIC, AggFuncType.COUNT.getId(),
@@ -368,11 +353,11 @@ public void testGroupByAndOrder() {
368353
DataSet dataset = user.executeQuery(plan);
369354
DataSetIterator it = dataset.getIterator();
370355
it.next();
371-
assertEquals(6, ((Number) it.get(1)).longValue());
372-
assertEquals("17", it.get(0));
356+
assertEquals(6L, it.get(1));
357+
assertEquals(17L, it.get(0));
373358
it.next();
374-
assertEquals(3, ((Number) it.get(1)).longValue());
375-
assertEquals("5", it.get(0));
359+
assertEquals(3L, it.get(1));
360+
assertEquals(24L, it.get(0));
376361
dataset.close();
377362
}
378363
}

0 commit comments

Comments
 (0)