This is an automated email from the ASF dual-hosted git repository. jackie pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/pinot.git
The following commit(s) were added to refs/heads/master by this push: new 5a909743e9 Move some mispositioned tests under pinot-core (#12884) 5a909743e9 is described below commit 5a909743e9e17af2c78c285dadaabdc897323ce6 Author: Xiaotian (Jackie) Jiang <17555551+jackie-ji...@users.noreply.github.com> AuthorDate: Thu Apr 11 11:44:49 2024 -0700 Move some mispositioned tests under pinot-core (#12884) --- .../common/request/context/LiteralContextTest.java | 0 .../common/utils/request/RequestUtilsTest.java | 31 +++++++++++++----- .../common/utils/request/RequestUtilsTest.java | 37 ---------------------- .../util/IntDoubleIndexedPriorityQueueTest.java | 3 +- .../util/IntObjectIndexedPriorityQueueTest.java | 3 +- .../util/QueryMultiThreadingUtilsTest.java | 3 +- .../converter/RealtimeSegmentConverterTest.java | 4 +-- .../pinot/spi/crypt/PinotCrypterFactoryTest.java | 0 8 files changed, 27 insertions(+), 54 deletions(-) diff --git a/pinot-core/src/test/java/org/apache/pinot/common/request/context/LiteralContextTest.java b/pinot-common/src/test/java/org/apache/pinot/common/request/context/LiteralContextTest.java similarity index 100% rename from pinot-core/src/test/java/org/apache/pinot/common/request/context/LiteralContextTest.java rename to pinot-common/src/test/java/org/apache/pinot/common/request/context/LiteralContextTest.java diff --git a/pinot-common/src/test/java/org/apache/pinot/common/utils/request/RequestUtilsTest.java b/pinot-common/src/test/java/org/apache/pinot/common/utils/request/RequestUtilsTest.java index 7b32c46c98..13f5b762b4 100644 --- a/pinot-common/src/test/java/org/apache/pinot/common/utils/request/RequestUtilsTest.java +++ b/pinot-common/src/test/java/org/apache/pinot/common/utils/request/RequestUtilsTest.java @@ -19,35 +19,50 @@ package org.apache.pinot.common.utils.request; import org.apache.calcite.sql.SqlDialect; +import org.apache.calcite.sql.SqlLiteral; +import org.apache.calcite.sql.parser.SqlParserPos; import org.apache.pinot.common.request.Expression; +import org.apache.pinot.common.request.ExpressionType; import org.apache.pinot.sql.parsers.PinotSqlType; import org.apache.pinot.sql.parsers.SqlNodeAndOptions; -import org.testng.Assert; import org.testng.annotations.Test; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertFalse; +import static org.testng.Assert.assertTrue; + public class RequestUtilsTest { + + @Test + public void testNullLiteralParsing() { + SqlLiteral nullLiteral = SqlLiteral.createNull(SqlParserPos.ZERO); + Expression nullExpr = RequestUtils.getLiteralExpression(nullLiteral); + assertEquals(nullExpr.getType(), ExpressionType.LITERAL); + assertTrue(nullExpr.getLiteral().getNullValue()); + } + // please check comments inside RequestUtils.getLiteralExpression() for why we need this test @Test public void testGetLiteralExpressionForObject() { Expression literalExpression = RequestUtils.getLiteralExpression(Float.valueOf(0.06f)); - Assert.assertEquals((literalExpression.getLiteral().getDoubleValue()), 0.06); + assertEquals((literalExpression.getLiteral().getDoubleValue()), 0.06); } @Test public void testGetLiteralExpressionForPrimitiveLong() { Expression literalExpression = RequestUtils.getLiteralExpression(4500L); - Assert.assertTrue(literalExpression.getLiteral().isSetLongValue()); - Assert.assertFalse(literalExpression.getLiteral().isSetDoubleValue()); - Assert.assertEquals(literalExpression.getLiteral().getLongValue(), 4500L); + assertTrue(literalExpression.getLiteral().isSetLongValue()); + assertFalse(literalExpression.getLiteral().isSetDoubleValue()); + assertEquals(literalExpression.getLiteral().getLongValue(), 4500L); } @Test public void testParseQuery() { SqlNodeAndOptions result = RequestUtils.parseQuery("select foo from countries where bar > 1"); - Assert.assertTrue(result.getParseTimeNs() > 0); - Assert.assertEquals(result.getSqlType(), PinotSqlType.DQL); - Assert.assertEquals(result.getSqlNode().toSqlString((SqlDialect) null).toString(), + assertTrue(result.getParseTimeNs() > 0); + assertEquals(result.getSqlType(), PinotSqlType.DQL); + assertEquals(result.getSqlNode().toSqlString((SqlDialect) null).toString(), "SELECT `foo`\n" + "FROM `countries`\n" + "WHERE `bar` > 1"); } } diff --git a/pinot-core/src/test/java/org/apache/pinot/common/utils/request/RequestUtilsTest.java b/pinot-core/src/test/java/org/apache/pinot/common/utils/request/RequestUtilsTest.java deleted file mode 100644 index 3c36a0de7f..0000000000 --- a/pinot-core/src/test/java/org/apache/pinot/common/utils/request/RequestUtilsTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.pinot.common.utils.request; - -import org.apache.calcite.sql.SqlLiteral; -import org.apache.calcite.sql.parser.SqlParserPos; -import org.apache.pinot.common.request.Expression; -import org.apache.pinot.common.request.ExpressionType; -import org.testng.Assert; -import org.testng.annotations.Test; - - -public class RequestUtilsTest { - @Test - public void testNullLiteralParsing() { - SqlLiteral nullLiteral = SqlLiteral.createNull(SqlParserPos.ZERO); - Expression nullExpr = RequestUtils.getLiteralExpression(nullLiteral); - Assert.assertEquals(nullExpr.getType(), ExpressionType.LITERAL); - Assert.assertEquals(nullExpr.getLiteral().getNullValue(), true); - } -} diff --git a/pinot-core/src/test/java/org/apache/pinot/util/IntDoubleIndexedPriorityQueueTest.java b/pinot-core/src/test/java/org/apache/pinot/core/util/IntDoubleIndexedPriorityQueueTest.java similarity index 97% rename from pinot-core/src/test/java/org/apache/pinot/util/IntDoubleIndexedPriorityQueueTest.java rename to pinot-core/src/test/java/org/apache/pinot/core/util/IntDoubleIndexedPriorityQueueTest.java index 7e9ca3e78e..642f44464b 100644 --- a/pinot-core/src/test/java/org/apache/pinot/util/IntDoubleIndexedPriorityQueueTest.java +++ b/pinot-core/src/test/java/org/apache/pinot/core/util/IntDoubleIndexedPriorityQueueTest.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.pinot.util; +package org.apache.pinot.core.util; import it.unimi.dsi.fastutil.ints.Int2DoubleMap; import it.unimi.dsi.fastutil.ints.Int2DoubleOpenHashMap; @@ -24,7 +24,6 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Random; -import org.apache.pinot.core.util.IntDoubleIndexedPriorityQueue; import org.apache.pinot.spi.utils.Pairs; import org.testng.Assert; import org.testng.annotations.Test; diff --git a/pinot-core/src/test/java/org/apache/pinot/util/IntObjectIndexedPriorityQueueTest.java b/pinot-core/src/test/java/org/apache/pinot/core/util/IntObjectIndexedPriorityQueueTest.java similarity index 97% rename from pinot-core/src/test/java/org/apache/pinot/util/IntObjectIndexedPriorityQueueTest.java rename to pinot-core/src/test/java/org/apache/pinot/core/util/IntObjectIndexedPriorityQueueTest.java index e67e8d18cf..aeb51ff7c1 100644 --- a/pinot-core/src/test/java/org/apache/pinot/util/IntObjectIndexedPriorityQueueTest.java +++ b/pinot-core/src/test/java/org/apache/pinot/core/util/IntObjectIndexedPriorityQueueTest.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.pinot.util; +package org.apache.pinot.core.util; import java.util.ArrayList; import java.util.Collections; @@ -24,7 +24,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Random; -import org.apache.pinot.core.util.IntObjectIndexedPriorityQueue; import org.apache.pinot.segment.local.customobject.AvgPair; import org.apache.pinot.spi.utils.Pairs; import org.testng.Assert; diff --git a/pinot-core/src/test/java/org/apache/pinot/util/QueryMultiThreadingUtilsTest.java b/pinot-core/src/test/java/org/apache/pinot/core/util/QueryMultiThreadingUtilsTest.java similarity index 97% rename from pinot-core/src/test/java/org/apache/pinot/util/QueryMultiThreadingUtilsTest.java rename to pinot-core/src/test/java/org/apache/pinot/core/util/QueryMultiThreadingUtilsTest.java index 92ac06f967..0c5c6ca555 100644 --- a/pinot-core/src/test/java/org/apache/pinot/util/QueryMultiThreadingUtilsTest.java +++ b/pinot-core/src/test/java/org/apache/pinot/core/util/QueryMultiThreadingUtilsTest.java @@ -16,13 +16,12 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.pinot.util; +package org.apache.pinot.core.util; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicInteger; -import org.apache.pinot.core.util.QueryMultiThreadingUtils; import org.testng.Assert; import org.testng.annotations.Test; diff --git a/pinot-core/src/test/java/org/apache/pinot/realtime/converter/RealtimeSegmentConverterTest.java b/pinot-segment-local/src/test/java/org/apache/pinot/segment/local/realtime/converter/RealtimeSegmentConverterTest.java similarity index 99% rename from pinot-core/src/test/java/org/apache/pinot/realtime/converter/RealtimeSegmentConverterTest.java rename to pinot-segment-local/src/test/java/org/apache/pinot/segment/local/realtime/converter/RealtimeSegmentConverterTest.java index 50f1396c10..ded9e85b69 100644 --- a/pinot-core/src/test/java/org/apache/pinot/realtime/converter/RealtimeSegmentConverterTest.java +++ b/pinot-segment-local/src/test/java/org/apache/pinot/segment/local/realtime/converter/RealtimeSegmentConverterTest.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.pinot.realtime.converter; +package org.apache.pinot.segment.local.realtime.converter; import com.google.common.base.Preconditions; import com.google.common.collect.Lists; @@ -34,8 +34,6 @@ import org.apache.pinot.common.metadata.segment.SegmentZKMetadata; import org.apache.pinot.segment.local.indexsegment.immutable.ImmutableSegmentImpl; import org.apache.pinot.segment.local.indexsegment.mutable.MutableSegmentImpl; import org.apache.pinot.segment.local.io.writer.impl.DirectMemoryManager; -import org.apache.pinot.segment.local.realtime.converter.ColumnIndicesForRealtimeTable; -import org.apache.pinot.segment.local.realtime.converter.RealtimeSegmentConverter; import org.apache.pinot.segment.local.realtime.impl.RealtimeSegmentConfig; import org.apache.pinot.segment.local.realtime.impl.RealtimeSegmentStatsHistory; import org.apache.pinot.segment.local.segment.index.column.PhysicalColumnIndexContainer; diff --git a/pinot-core/src/test/java/org/apache/pinot/spi/crypt/PinotCrypterFactoryTest.java b/pinot-spi/src/test/java/org/apache/pinot/spi/crypt/PinotCrypterFactoryTest.java similarity index 100% rename from pinot-core/src/test/java/org/apache/pinot/spi/crypt/PinotCrypterFactoryTest.java rename to pinot-spi/src/test/java/org/apache/pinot/spi/crypt/PinotCrypterFactoryTest.java --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org