cryptoya commented on code in PR #51: URL: https://github.com/apache/rocketmq-e2e/pull/51#discussion_r1361642543
########## java/e2e-v4/src/test/java/org/apache/rocketmq/cluster/ClusterTest.java: ########## @@ -0,0 +1,138 @@ +/* + * 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.rocketmq.cluster; + +import org.apache.rocketmq.client.rmq.RMQNormalConsumer; +import org.apache.rocketmq.client.rmq.RMQNormalProducer; +import org.apache.rocketmq.common.message.Message; +import org.apache.rocketmq.enums.TESTSET; +import org.apache.rocketmq.factory.ConsumerFactory; +import org.apache.rocketmq.factory.ProducerFactory; +import org.apache.rocketmq.frame.BaseOperate; +import org.apache.rocketmq.listener.rmq.concurrent.RMQNormalListener; +import org.apache.rocketmq.utils.NameUtils; +import org.apache.rocketmq.utils.RandomUtils; +import org.apache.rocketmq.utils.VerifyUtils; +import org.junit.jupiter.api.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@Tag(TESTSET.MODEL) +@Tag(TESTSET.SMOKE) +public class ClusterTest extends BaseOperate { + private final Logger log = LoggerFactory.getLogger(ClusterTest.class); + private String tag; + private final static int SEND_NUM = 100; + private RMQNormalConsumer pushConsumer01; + private RMQNormalConsumer pushConsumer02; + private RMQNormalConsumer pushConsumer03; + private RMQNormalConsumer pullConsumer; + private RMQNormalProducer producer; + + @BeforeEach + public void setUp() { + tag = NameUtils.getRandomTagName(); + } + + @BeforeEach + public void tearDown() { + if (pushConsumer01 != null) { + pushConsumer01.shutdown(); + } + if (pushConsumer02 != null) { + pushConsumer02.shutdown(); + } + if (pushConsumer03 != null) { + pushConsumer03.shutdown(); + } + if (pullConsumer != null) { + pullConsumer.shutdown(); + } + if (producer != null) { + producer.shutdown(); + } + } + + @Test + @DisplayName("Send 100 normal messages synchronously, start three consumers on different GroupId, and expect each client to consume up to 100 messages") Review Comment: 增加一下MessageModel为广播模式的场景 ########## java/e2e-v4/src/test/java/org/apache/rocketmq/cluster/ClusterTest.java: ########## @@ -0,0 +1,138 @@ +/* + * 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.rocketmq.cluster; + +import org.apache.rocketmq.client.rmq.RMQNormalConsumer; +import org.apache.rocketmq.client.rmq.RMQNormalProducer; +import org.apache.rocketmq.common.message.Message; +import org.apache.rocketmq.enums.TESTSET; +import org.apache.rocketmq.factory.ConsumerFactory; +import org.apache.rocketmq.factory.ProducerFactory; +import org.apache.rocketmq.frame.BaseOperate; +import org.apache.rocketmq.listener.rmq.concurrent.RMQNormalListener; +import org.apache.rocketmq.utils.NameUtils; +import org.apache.rocketmq.utils.RandomUtils; +import org.apache.rocketmq.utils.VerifyUtils; +import org.junit.jupiter.api.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@Tag(TESTSET.MODEL) +@Tag(TESTSET.SMOKE) +public class ClusterTest extends BaseOperate { + private final Logger log = LoggerFactory.getLogger(ClusterTest.class); + private String tag; + private final static int SEND_NUM = 100; + private RMQNormalConsumer pushConsumer01; + private RMQNormalConsumer pushConsumer02; + private RMQNormalConsumer pushConsumer03; + private RMQNormalConsumer pullConsumer; + private RMQNormalProducer producer; + + @BeforeEach + public void setUp() { + tag = NameUtils.getRandomTagName(); + } + + @BeforeEach + public void tearDown() { + if (pushConsumer01 != null) { + pushConsumer01.shutdown(); + } + if (pushConsumer02 != null) { + pushConsumer02.shutdown(); + } + if (pushConsumer03 != null) { + pushConsumer03.shutdown(); + } + if (pullConsumer != null) { + pullConsumer.shutdown(); + } + if (producer != null) { + producer.shutdown(); + } + } + + @Test + @DisplayName("Send 100 normal messages synchronously, start three consumers on different GroupId, and expect each client to consume up to 100 messages") Review Comment: 增加一下MessageModel为广播模式的场景 -- 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: commits-unsubscr...@rocketmq.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org