Jackie-Jiang commented on code in PR #19090:
URL: https://github.com/apache/pinot/pull/19090#discussion_r3659615702


##########
pinot-tools/src/test/java/org/apache/pinot/tools/TestQuickStartBase.java:
##########
@@ -0,0 +1,98 @@
+/**
+ * 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.tools;
+
+import java.io.File;
+import java.nio.file.Files;
+import java.util.List;
+import java.util.Set;
+import java.util.stream.Collectors;
+import org.apache.commons.io.FileUtils;
+import org.testng.Assert;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+
+/**
+ * Tests for the sample-query guard that the merged quickstarts rely on. No 
cluster is started here; only the
+ * bootstrap bookkeeping is exercised.
+ */
+public class TestQuickStartBase {

Review Comment:
   We usually name it `BaseQuickStartTest`



##########
pinot-tools/src/test/java/org/apache/pinot/tools/TestQuickStartBase.java:
##########
@@ -0,0 +1,98 @@
+/**
+ * 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.tools;
+
+import java.io.File;
+import java.nio.file.Files;
+import java.util.List;
+import java.util.Set;
+import java.util.stream.Collectors;
+import org.apache.commons.io.FileUtils;
+import org.testng.Assert;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+
+/**

Review Comment:
   Markdown style, same for other javadoc



##########
pinot-tools/src/test/java/org/apache/pinot/tools/admin/command/TestQuickStartCommand.java:
##########
@@ -71,53 +63,61 @@ public void testMatchStringToCommand()
     Assert.assertEquals(quickStartClassFor("REALTIME-MINION"), 
RealtimeQuickStartWithMinion.class);
 
     Assert.assertEquals(quickStartClassFor("REALTIME"), 
RealtimeQuickStart.class);
+    Assert.assertEquals(quickStartClassFor("STREAM"), 
RealtimeQuickStart.class);
 
     Assert.assertEquals(quickStartClassFor("HYBRID"), HybridQuickstart.class);
 
-    Assert.assertEquals(quickStartClassFor("JOIN"), JoinQuickStart.class);
-
-    Assert.assertEquals(quickStartClassFor("UPSERT"), UpsertQuickStart.class);
-
-    Assert.assertEquals(quickStartClassFor("OFFLINE_JSON_INDEX"), 
JsonIndexQuickStart.class);
-    Assert.assertEquals(quickStartClassFor("OFFLINE-JSON-INDEX"), 
JsonIndexQuickStart.class);
-    Assert.assertEquals(quickStartClassFor("BATCH_JSON_INDEX"), 
JsonIndexQuickStart.class);
-    Assert.assertEquals(quickStartClassFor("BATCH-JSON-INDEX"), 
JsonIndexQuickStart.class);
-
-    Assert.assertEquals(quickStartClassFor("REALTIME_JSON_INDEX"), 
RealtimeJsonIndexQuickStart.class);
-    Assert.assertEquals(quickStartClassFor("REALTIME-JSON-INDEX"), 
RealtimeJsonIndexQuickStart.class);
-    Assert.assertEquals(quickStartClassFor("STREAM_JSON_INDEX"), 
RealtimeJsonIndexQuickStart.class);
-    Assert.assertEquals(quickStartClassFor("STREAM-JSON-INDEX"), 
RealtimeJsonIndexQuickStart.class);
-
-    Assert.assertEquals(quickStartClassFor("UPSERT_JSON_INDEX"), 
UpsertJsonQuickStart.class);
-    Assert.assertEquals(quickStartClassFor("UPSERT-JSON-INDEX"), 
UpsertJsonQuickStart.class);
-
-    Assert.assertEquals(quickStartClassFor("OFFLINE_COMPLEX_TYPE"),
-        OfflineComplexTypeHandlingQuickStart.class);
-    Assert.assertEquals(quickStartClassFor("OFFLINE-COMPLEX-TYPE"),
-        OfflineComplexTypeHandlingQuickStart.class);
-    Assert.assertEquals(quickStartClassFor("BATCH_COMPLEX_TYPE"),
-        OfflineComplexTypeHandlingQuickStart.class);
-    Assert.assertEquals(quickStartClassFor("BATCH-COMPLEX-TYPE"),
-        OfflineComplexTypeHandlingQuickStart.class);
-
-    Assert.assertEquals(quickStartClassFor("REALTIME_COMPLEX_TYPE"),
-        RealtimeComplexTypeHandlingQuickStart.class);
-    Assert.assertEquals(quickStartClassFor("REALTIME-COMPLEX-TYPE"),
-        RealtimeComplexTypeHandlingQuickStart.class);
-    Assert.assertEquals(quickStartClassFor("STREAM_COMPLEX_TYPE"),
-        RealtimeComplexTypeHandlingQuickStart.class);
-    Assert.assertEquals(quickStartClassFor("STREAM-COMPLEX-TYPE"),
-        RealtimeComplexTypeHandlingQuickStart.class);
-
-    Assert.assertEquals(quickStartClassFor("TIMESTAMP"),
-        TimestampIndexQuickstart.class);
-
     Assert.assertEquals(quickStartClassFor("MULTI_CLUSTER"),
         MultiClusterQuickstart.class);
     Assert.assertEquals(quickStartClassFor("MULTICLUSTER"),
         MultiClusterQuickstart.class);
   }
 
+  /**
+   * The batch-side quickstarts that only differed by their sample queries 
were merged into {@link Quickstart}; their
+   * types must keep resolving so that existing docs and scripts do not break.
+   */
+  @Test
+  public void testDeprecatedBatchTypesResolveToQuickstart()
+      throws InvocationTargetException, NoSuchMethodException, 
InstantiationException, IllegalAccessException {
+    for (String type : new String[]{
+        "MULTI_STAGE", "JOIN", "TIMESTAMP", "OFFLINE_JSON_INDEX", 
"OFFLINE-JSON-INDEX", "BATCH_JSON_INDEX",
+        "BATCH-JSON-INDEX", "OFFLINE_COMPLEX_TYPE", "OFFLINE-COMPLEX-TYPE", 
"BATCH_COMPLEX_TYPE", "BATCH-COMPLEX-TYPE"
+    }) {
+      Assert.assertEquals(quickStartClassFor(type), Quickstart.class, type);

Review Comment:
   Static import



##########
pinot-tools/src/test/java/org/apache/pinot/tools/admin/command/TestQuickStartCommand.java:
##########


Review Comment:
   Consider renaming to `QuickStartTest`



##########
pinot-tools/src/test/java/org/apache/pinot/tools/admin/command/TestQuickStartCommand.java:
##########
@@ -71,53 +63,61 @@ public void testMatchStringToCommand()
     Assert.assertEquals(quickStartClassFor("REALTIME-MINION"), 
RealtimeQuickStartWithMinion.class);
 
     Assert.assertEquals(quickStartClassFor("REALTIME"), 
RealtimeQuickStart.class);
+    Assert.assertEquals(quickStartClassFor("STREAM"), 
RealtimeQuickStart.class);
 
     Assert.assertEquals(quickStartClassFor("HYBRID"), HybridQuickstart.class);
 
-    Assert.assertEquals(quickStartClassFor("JOIN"), JoinQuickStart.class);
-
-    Assert.assertEquals(quickStartClassFor("UPSERT"), UpsertQuickStart.class);
-
-    Assert.assertEquals(quickStartClassFor("OFFLINE_JSON_INDEX"), 
JsonIndexQuickStart.class);
-    Assert.assertEquals(quickStartClassFor("OFFLINE-JSON-INDEX"), 
JsonIndexQuickStart.class);
-    Assert.assertEquals(quickStartClassFor("BATCH_JSON_INDEX"), 
JsonIndexQuickStart.class);
-    Assert.assertEquals(quickStartClassFor("BATCH-JSON-INDEX"), 
JsonIndexQuickStart.class);
-
-    Assert.assertEquals(quickStartClassFor("REALTIME_JSON_INDEX"), 
RealtimeJsonIndexQuickStart.class);
-    Assert.assertEquals(quickStartClassFor("REALTIME-JSON-INDEX"), 
RealtimeJsonIndexQuickStart.class);
-    Assert.assertEquals(quickStartClassFor("STREAM_JSON_INDEX"), 
RealtimeJsonIndexQuickStart.class);
-    Assert.assertEquals(quickStartClassFor("STREAM-JSON-INDEX"), 
RealtimeJsonIndexQuickStart.class);
-
-    Assert.assertEquals(quickStartClassFor("UPSERT_JSON_INDEX"), 
UpsertJsonQuickStart.class);
-    Assert.assertEquals(quickStartClassFor("UPSERT-JSON-INDEX"), 
UpsertJsonQuickStart.class);
-
-    Assert.assertEquals(quickStartClassFor("OFFLINE_COMPLEX_TYPE"),
-        OfflineComplexTypeHandlingQuickStart.class);
-    Assert.assertEquals(quickStartClassFor("OFFLINE-COMPLEX-TYPE"),
-        OfflineComplexTypeHandlingQuickStart.class);
-    Assert.assertEquals(quickStartClassFor("BATCH_COMPLEX_TYPE"),
-        OfflineComplexTypeHandlingQuickStart.class);
-    Assert.assertEquals(quickStartClassFor("BATCH-COMPLEX-TYPE"),
-        OfflineComplexTypeHandlingQuickStart.class);
-
-    Assert.assertEquals(quickStartClassFor("REALTIME_COMPLEX_TYPE"),
-        RealtimeComplexTypeHandlingQuickStart.class);
-    Assert.assertEquals(quickStartClassFor("REALTIME-COMPLEX-TYPE"),
-        RealtimeComplexTypeHandlingQuickStart.class);
-    Assert.assertEquals(quickStartClassFor("STREAM_COMPLEX_TYPE"),
-        RealtimeComplexTypeHandlingQuickStart.class);
-    Assert.assertEquals(quickStartClassFor("STREAM-COMPLEX-TYPE"),
-        RealtimeComplexTypeHandlingQuickStart.class);
-
-    Assert.assertEquals(quickStartClassFor("TIMESTAMP"),
-        TimestampIndexQuickstart.class);
-
     Assert.assertEquals(quickStartClassFor("MULTI_CLUSTER"),
         MultiClusterQuickstart.class);
     Assert.assertEquals(quickStartClassFor("MULTICLUSTER"),
         MultiClusterQuickstart.class);
   }
 
+  /**

Review Comment:
   Markdown



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to