You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@storm.apache.org by GitBox <gi...@apache.org> on 2020/04/07 14:57:58 UTC

[GitHub] [storm] Ethanlm commented on a change in pull request #3233: [STORM-1293] port storm.messaging.netty-integration-test to java

Ethanlm commented on a change in pull request #3233: [STORM-1293] port storm.messaging.netty-integration-test to java
URL: https://github.com/apache/storm/pull/3233#discussion_r404873673
 
 

 ##########
 File path: storm-core/test/jvm/org/apache/storm/messaging/NettyIntegrationTest.java
 ##########
 @@ -0,0 +1,93 @@
+/*
+ * Copyright 2018 The Apache Software Foundation.
+ *
+ * Licensed 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.storm.messaging;
+
+import org.apache.storm.Config;
+import org.apache.storm.LocalCluster;
+import org.apache.storm.Testing;
+import org.apache.storm.generated.StormTopology;
+import org.apache.storm.testing.CompleteTopologyParam;
+import org.apache.storm.testing.FixedTuple;
+import org.apache.storm.testing.IntegrationTest;
+import org.apache.storm.testing.MockedSources;
+import org.apache.storm.testing.TestGlobalCount;
+import org.apache.storm.testing.TestWordSpout;
+import org.apache.storm.topology.TopologyBuilder;
+import org.apache.storm.tuple.Values;
+import org.junit.jupiter.api.Test;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+@IntegrationTest
+public class NettyIntegrationTest {
+
+    @Test
+    public void testIntegration() throws Exception {
+        Map<String, Object> daemonConf = new HashMap<>();
+        daemonConf.put(Config.STORM_LOCAL_MODE_ZMQ, true);
+        daemonConf.put(Config.STORM_MESSAGING_TRANSPORT, "org.apache.storm.messaging.netty.Context");
+        daemonConf.put(Config.STORM_MESSAGING_NETTY_AUTHENTICATION, false);
+        daemonConf.put(Config.STORM_MESSAGING_NETTY_BUFFER_SIZE, 1024000);
+        daemonConf.put(Config.STORM_MESSAGING_NETTY_MIN_SLEEP_MS, 1000);
+        daemonConf.put(Config.STORM_MESSAGING_NETTY_MAX_SLEEP_MS, 5000);
+        daemonConf.put(Config.STORM_MESSAGING_NETTY_CLIENT_WORKER_THREADS, 1);
+        daemonConf.put(Config.STORM_MESSAGING_NETTY_SERVER_WORKER_THREADS, 1);
+
+        try (LocalCluster cluster = new LocalCluster.Builder().withSimulatedTime().withSupervisors(4)
 
 Review comment:
   We can separate this to be 
   ```
   Builder builder = new Builder()
   .withSimulatedTime()
   .withSupervisors(4)
   .withSupervisorSlotPortMin(6710)
   .withDaemonConf(daemonConf);
   
   try (LocalCluster cluster = builder.build()) {
   xxx
   }
   
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services