Vladsz83 commented on code in PR #13461:
URL: https://github.com/apache/ignite/pull/13461#discussion_r3758305203


##########
modules/core/src/test/java/org/apache/ignite/internal/codegen/MessageProcessorTest.java:
##########
@@ -683,6 +685,57 @@ public void testNonMarshallableSelfMarshallingFailed() {
             "or SelfMarshallingMessage, nor declare @Marshalled fields");
     }
 
+    /** Test that {@code @Marshalled} annotation on {@link Message} field will 
fail generation. */
+    @Test
+    public void testMarshalledOnMessageFieldFailGeneration() {
+        List<String> cases = Arrays.asList(
+            "MarshalledOnMessage.java",
+            "MarshalledOnMessageCollection.java",
+            "MarshalledOnMessageCollection2.java",
+            "MarshalledOnMessageCollection3.java",
+            "MarshalledOnMessageMap.java",
+            "MarshalledOnMessageMap2.java",
+            "MarshalledOnMessageMap3.java",
+            "MarshalledOnMessageArray.java",
+            "MarshalledOnMessageCollectionArray.java",
+            "MarshalledOnMessageSet.java",
+            "MarshalledOnMessageList.java",
+            "MarshalledOnMessageList2.java"
+        );
+
+        for (String file : cases) {
+            Compilation compilation = compile("TestMessage.java", file);
+
+            assertThat(compilation).failed();
+            assertThat(compilation).hadErrorContaining("Message must be 
written by dedicated message serializers");
+        }
+    }
+
+    /** Test that {@code @Marshalled} annotation on raw {@link Collection} 
fail generation. */
+    @Test
+    public void testRawCollectionFailGeneration() {
+        List<String> cases = Arrays.asList(
+            "TestRawListMessage.java",
+            "TestRawCollectionMessage.java"
+        );
+
+        for (String file : cases) {
+            Compilation compilation = compile("TestMessage.java", file);

Review Comment:
   Do we need "TestMessage.java"?



##########
modules/core/src/test/java/org/apache/ignite/internal/codegen/MessageProcessorTest.java:
##########
@@ -683,6 +685,57 @@ public void testNonMarshallableSelfMarshallingFailed() {
             "or SelfMarshallingMessage, nor declare @Marshalled fields");
     }
 
+    /** Test that {@code @Marshalled} annotation on {@link Message} field will 
fail generation. */
+    @Test
+    public void testMarshalledOnMessageFieldFailGeneration() {
+        List<String> cases = Arrays.asList(
+            "MarshalledOnMessage.java",
+            "MarshalledOnMessageCollection.java",
+            "MarshalledOnMessageCollection2.java",
+            "MarshalledOnMessageCollection3.java",
+            "MarshalledOnMessageMap.java",
+            "MarshalledOnMessageMap2.java",
+            "MarshalledOnMessageMap3.java",
+            "MarshalledOnMessageArray.java",
+            "MarshalledOnMessageCollectionArray.java",
+            "MarshalledOnMessageSet.java",
+            "MarshalledOnMessageList.java",
+            "MarshalledOnMessageList2.java"
+        );
+
+        for (String file : cases) {
+            Compilation compilation = compile("TestMessage.java", file);
+
+            assertThat(compilation).failed();
+            assertThat(compilation).hadErrorContaining("Message must be 
written by dedicated message serializers");
+        }
+    }
+
+    /** Test that {@code @Marshalled} annotation on raw {@link Collection} 
fail generation. */
+    @Test
+    public void testRawCollectionFailGeneration() {
+        List<String> cases = Arrays.asList(
+            "TestRawListMessage.java",
+            "TestRawCollectionMessage.java"
+        );
+
+        for (String file : cases) {
+            Compilation compilation = compile("TestMessage.java", file);
+
+            assertThat(compilation).failed();
+            assertThat(compilation).hadErrorContaining("Raw collection not 
supported");
+        }
+    }
+
+    /** Test that {@code @Marshalled} annotation on raw {@link Map} fail 
generation. */
+    @Test
+    public void testRawMapFailGeneration() {

Review Comment:
   Join with `testRawCollectionFailGeneration`? + The same, do we need 
"TestMessage.java"



##########
modules/core/src/test/resources/codegen/MarshalledOnMessageMap.java:
##########
@@ -0,0 +1,32 @@
+/*
+ * 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.ignite.internal;
+
+import org.apache.ignite.plugin.extensions.communication.Message;
+import java.util.Map;
+
+/** */
+public class MarshalledOnMessageMap implements Message {
+    /** */
+    @Marshalled("bytes")

Review Comment:
   There are `Collection<GridCacheVersion>` and `Collection<GridCacheVersion> 
mapVals;` Expected: `byte[]` arrays



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