oleg-vlsk commented on code in PR #13583:
URL: https://github.com/apache/ignite/pull/13583#discussion_r4056491774


##########
modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DuplicateKeyValueClassesSelfTest.java:
##########
@@ -42,32 +48,51 @@ public class DuplicateKeyValueClassesSelfTest extends 
AbstractIndexingCommonTest
         grid(0).destroyCache(CACHE_NAME);
     }
 
-    /**
-     * Test duplicate key class.
-     *
-     * @throws Exception If failed.
-     */
+    /** Checks that the same key class can be used with different value 
classes. */
     @Test
-    public void testDuplicateKeyClass() throws Exception {
+    public void testDuplicateKeyClass() {
         CacheConfiguration ccfg = new CacheConfiguration()
             .setName(CACHE_NAME)
             .setIndexedTypes(UUID.class, Clazz1.class, UUID.class, 
Clazz2.class);
 
         grid(0).createCache(ccfg);
+
+        Collection<QueryEntity> entities = 
grid(0).context().cache().cacheConfiguration(CACHE_NAME).getQueryEntities();
+
+        assertEquals(2, entities.size());
+
+        Set<String> valTypes = new HashSet<>();
+
+        for (QueryEntity entity : entities) {
+            assertEquals(UUID.class.getName(), entity.getKeyType());
+
+            valTypes.add(entity.getValueType());
+        }
+
+        Set<String> expValTypes = new 
HashSet<>(Arrays.asList(Clazz1.class.getName(), Clazz2.class.getName()));
+
+        assertEquals(expValTypes, valTypes);
     }
 
     /**
-     * Test duplicate value class.
-     *
-     * @throws Exception If failed.
+     * Checks that conflicting key types configured for the same value class 
are rejected instead of silently
+     * discarding one of the query entity configurations.
      */
     @Test
-    public void testDuplicateValueClass() throws Exception {
+    public void testConflictingKeyTypesForSameValueClass() {
         CacheConfiguration ccfg = new CacheConfiguration()
-            .setName(CACHE_NAME)
-            .setIndexedTypes(UUID.class, Clazz1.class, String.class, 
Clazz1.class);
+            .setName(CACHE_NAME);
 
-        grid(0).createCache(ccfg);
+        String msg = String.format("Failed to merge query entities due to 
conflicting metadata " +

Review Comment:
   Done.



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

Reply via email to