petrov-mg commented on code in PR #13275:
URL: https://github.com/apache/ignite/pull/13275#discussion_r3476191080


##########
modules/core/src/test/java/org/apache/ignite/internal/thread/context/OperationContextAttributesTest.java:
##########
@@ -831,36 +847,74 @@ public void testContextAwareDelayQueue() throws Exception 
{
     /** */
     @Test
     public void testSendAttributesByDiscovery() throws Exception {
-        byte attrId1 = 0;
-        byte attrId2 = 
DistributedOperationContextManager.MAX_DISTRIBUTED_ATTR_CNT - 1;
+        doTestOperationContextAttributesPropagation(true);
+    }
 
-        InetSocketAddressMessage dfltDistAttr1Val = new 
InetSocketAddressMessage(InetAddress.getLoopbackAddress(), 80);
-        GridCacheVersion dfltDistrAttr2Val = new GridCacheVersion(1, 1, 1);
+    /** */
+    @Test
+    public void testSendAttributesByCommunication() throws Exception {
+        doTestOperationContextAttributesPropagation(false);
+    }
+
+    /** */
+    private void doTestOperationContextAttributesPropagation(boolean 
discovery) throws Exception {
+        OperationContextAttribute<InetSocketAddressMessage> dAttr1 =
+            OperationContextAttribute.newInstance(new 
InetSocketAddressMessage(InetAddress.getLoopbackAddress(), 80));
+
+        OperationContextAttribute<GridCacheVersion> dAttr2 =
+            OperationContextAttribute.newInstance(new GridCacheVersion(1, 1, 
1));
+
+        pluginProvider = new AbstractTestPluginProvider() {

Review Comment:
   Who knows. But creating an `TestIgniteComponent` imitation will help 
demonstrate how the attributes and the dispatcher are intended to be used. And 
moving this code into a separate class makes it more readable.



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