You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2021/06/30 14:55:43 UTC
[GitHub] [ignite-3] sashapolo opened a new pull request #193: IGNITE-15018 Add support for message inheritance for @Transferable
sashapolo opened a new pull request #193:
URL: https://github.com/apache/ignite-3/pull/193
https://issues.apache.org/jira/browse/IGNITE-15018
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite-3] ibessonov merged pull request #193: IGNITE-15018 Add support for message inheritance for @Transferable
Posted by GitBox <gi...@apache.org>.
ibessonov merged pull request #193:
URL: https://github.com/apache/ignite-3/pull/193
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite-3] SammyVimes commented on a change in pull request #193: IGNITE-15018 Add support for message inheritance for @Transferable
Posted by GitBox <gi...@apache.org>.
SammyVimes commented on a change in pull request #193:
URL: https://github.com/apache/ignite-3/pull/193#discussion_r662450653
##########
File path: modules/network-annotation-processor/src/test/java/org/apache/ignite/internal/network/processor/InheritedMessageTest.java
##########
@@ -0,0 +1,93 @@
+/*
+ * 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.network.processor;
+
+import org.apache.ignite.network.serialization.MessageDeserializer;
+import org.apache.ignite.network.serialization.MessageReader;
+import org.apache.ignite.network.serialization.MessageSerializer;
+import org.apache.ignite.network.serialization.MessageWriter;
+import org.junit.jupiter.api.Test;
+import org.mockito.InOrder;
+
+import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.inOrder;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+/**
+ * Tests for support of network message inheritance hierarchies.
+ *
+ * @see InheritedMessage
+ */
+public class InheritedMessageTest {
+ /** */
+ private final TestMessagesFactory messageFactory = new TestMessagesFactory();
+
+ /** */
+ private final InheritedMessageSerializationFactory serializationFactory =
+ new InheritedMessageSerializationFactory(messageFactory);
+
+ /**
+ * Tests that the generated message implementation contains all fields from the superinterfaces and is serialized
+ * in the correct order.
+ */
+ @Test
+ void testSerialization() {
+ InheritedMessage msg = messageFactory.inheritedMessage()
+ .x(1).y(2).z(3)
+ .build();
+
+ MessageSerializer<InheritedMessage> serializer = serializationFactory.createSerializer();
+
+ var mockWriter = mock(MessageWriter.class);
+
+ when(mockWriter.isHeaderWritten()).thenReturn(true);
+ when(mockWriter.writeInt(anyString(), anyInt())).thenReturn(true);
+
+ serializer.writeMessage(msg, mockWriter);
+
+ InOrder inOrder = inOrder(mockWriter);
+
+ inOrder.verify(mockWriter).writeInt(eq("x"), anyInt());
Review comment:
Maybe put `1` instead of anyInt()?
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org