anton-vinogradov commented on code in PR #13434:
URL: https://github.com/apache/ignite/pull/13434#discussion_r3715041917


##########
modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/exec/rel/ContinuousExecutionTest.java:
##########
@@ -40,6 +40,8 @@
 import org.junit.runners.Parameterized;
 import org.junit.runners.Parameterized.Parameter;
 
+import static org.apache.ignite.marshaller.Marshallers.jdk;

Review Comment:
   Done, switched to `Marshallers.jdk()`.



##########
modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/message/CalciteCommunicationMessageSerializationTest.java:
##########
@@ -20,10 +20,16 @@
 import org.apache.ignite.internal.managers.AbstractMessageSerializationTest;
 import 
org.apache.ignite.plugin.extensions.communication.MessageFactoryProvider;
 
+import static org.apache.ignite.marshaller.Marshallers.jdk;
+
 /** */
 public class CalciteCommunicationMessageSerializationTest extends 
AbstractMessageSerializationTest {
     /** {@inheritDoc} */
     @Override protected MessageFactoryProvider messageFactory() {
-        return new CalciteMessageFactory();
+        CalciteMessageFactory msgFactory = new CalciteMessageFactory();
+
+        msgFactory.init(jdk(), jdk());

Review Comment:
   Done, switched to `Marshallers.jdk()`.



##########
modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/planner/PlanExecutionTest.java:
##########
@@ -82,8 +83,12 @@ public class PlanExecutionTest extends AbstractPlannerTest {
     @Override protected void beforeTest() throws Exception {
         super.beforeTest();
 
+        CalciteMessageFactory msgFactory = new CalciteMessageFactory();
+
+        msgFactory.init(jdk(), jdk());

Review Comment:
   Done, switched to `Marshallers.jdk()`.



##########
modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/planner/PlanExecutionTest.java:
##########
@@ -82,8 +83,12 @@ public class PlanExecutionTest extends AbstractPlannerTest {
     @Override protected void beforeTest() throws Exception {
         super.beforeTest();
 
+        CalciteMessageFactory msgFactory = new CalciteMessageFactory();
+
+        msgFactory.init(jdk(), jdk());
+
         // Register messages in Message#REGISTRATIONS and avoids failure in 
Message#directType().
-        new IgniteMessageFactoryImpl(new MessageFactoryProvider[]{new 
CalciteMessageFactory()});
+        new IgniteMessageFactoryImpl(new MessageFactoryProvider[]{msgFactory});

Review Comment:
   Added the assert.
   
   `@Nullable` would mean null is a valid input, but null only happens when 
`init()` was forgotten. The companions are instantiated inside `register()`, so 
a null marshaller gets baked into them right there and a later `init()` does 
not fix it.
   
   Checked that it fires first now. With the old test code the failure is
   
   ```
   AssertionError: Provider is not initialized, see init(), while registering 
...message.QueryStartRequest
       at AbstractMarshallableMessageFactoryProvider.register(...:73)
   ```
   
   instead of the previous `QueryStartRequestMarshaller takes a marshaller, but 
none was provided` deeper in `loadGenerated()`, which named the companion but 
not the actual mistake.
   



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