DonalEvans commented on a change in pull request #6110:
URL: https://github.com/apache/geode/pull/6110#discussion_r591760383



##########
File path: 
geode-core/src/test/java/org/apache/geode/cache/query/internal/types/ExtendedNumericComparatorTest.java
##########
@@ -0,0 +1,83 @@
+/*
+ * 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.geode.cache.query.internal.types;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.Comparator;
+
+import org.junit.Test;
+
+import org.apache.geode.cache.query.QueryService;
+import org.apache.geode.cache.query.internal.index.IndexManager;
+
+public class ExtendedNumericComparatorTest {
+  Comparator comparator = TypeUtils.getExtendedNumericComparator();

Review comment:
       Warnings in this class can be fixed by using `Comparator<Object> 
comparator = uncheckedCast(TypeUtils.getExtendedNumericComparator());` here

##########
File path: 
geode-core/src/integrationTest/java/org/apache/geode/cache/query/internal/index/CompactRangeIndexJUnitTest.java
##########
@@ -442,6 +445,48 @@ public void doTestHook(final SPOTS spot, final 
DefaultQuery _ignored,
     }
   }
 
+  /**
+   * Tests adding entries to compact range index where there are undefined and 
null values
+   * for the key
+   */
+  @Test
+  public void testNullAndUndefinedValuesForMapKeyInCompactRangeIndex() throws 
Exception {
+    index = utils.createIndex("indexName", "positions['SUN']", SEPARATOR + 
"exampleRegion");
+    Region<Object, Object> region = 
utils.getCache().getRegion("exampleRegion");
+
+    // create objects
+    Portfolio p1 = new Portfolio(1);
+    p1.positions = new HashMap<>();
+    p1.positions.put("SUN", "yes");
+    region.put("KEY-" + 1, p1);
+
+    // null value for positions['SUN']

Review comment:
       This comment (and some others in this test) are inaccurate

##########
File path: 
geode-core/src/integrationTest/java/org/apache/geode/cache/query/internal/index/CompactRangeIndexJUnitTest.java
##########
@@ -442,6 +445,48 @@ public void doTestHook(final SPOTS spot, final 
DefaultQuery _ignored,
     }
   }
 
+  /**
+   * Tests adding entries to compact range index where there are undefined and 
null values
+   * for the key
+   */
+  @Test
+  public void testNullAndUndefinedValuesForMapKeyInCompactRangeIndex() throws 
Exception {

Review comment:
       This test passes even with the changes in `ExtendedNumericComparator` 
reverted. Would it be possible to write a test that exercises the new behaviour?




----------------------------------------------------------------
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.

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


Reply via email to