Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import org.apache.rocketmq.store.config.MessageStoreConfig;
import org.junit.After;
import org.junit.Assert;
import org.junit.Assume;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
Expand Down Expand Up @@ -60,7 +59,6 @@ public void cleanUp() {

@Before
public void setUp() throws IOException {
Assume.assumeFalse(MixAll.isMac());
BrokerConfig brokerConfig = new BrokerConfig();
Mockito.doReturn(brokerConfig).when(controller).getBrokerConfig();

Expand All @@ -77,7 +75,6 @@ public void setUp() throws IOException {
*/
@Test
public void testCommitOffset_Standard() {
Assume.assumeFalse(MixAll.isMac());
Assert.assertTrue(consumerOffsetManagerV2.load());

String clientHost = "localhost";
Expand All @@ -104,7 +101,6 @@ public void testCommitOffset_Standard() {
*/
@Test
public void testCommitOffset_LMQ() {
Assume.assumeFalse(MixAll.isMac());
Assert.assertTrue(consumerOffsetManagerV2.load());

String clientHost = "localhost";
Expand All @@ -130,7 +126,6 @@ public void testCommitOffset_LMQ() {
*/
@Test
public void testCommitPullOffset_LMQ() {
Assume.assumeFalse(MixAll.isMac());
Assert.assertTrue(consumerOffsetManagerV2.load());

String clientHost = "localhost";
Expand All @@ -155,7 +150,6 @@ public void testCommitPullOffset_LMQ() {
*/
@Test
public void testRemoveByTopicAtGroup() {
Assume.assumeFalse(MixAll.isMac());
Assert.assertTrue(consumerOffsetManagerV2.load());

String clientHost = "localhost";
Expand Down Expand Up @@ -188,7 +182,6 @@ public void testRemoveByTopicAtGroup() {
*/
@Test
public void testRemoveByGroup() {
Assume.assumeFalse(MixAll.isMac());
Assert.assertTrue(consumerOffsetManagerV2.load());

String clientHost = "localhost";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,13 @@
import java.io.IOException;
import org.apache.rocketmq.broker.BrokerController;
import org.apache.rocketmq.common.BrokerConfig;
import org.apache.rocketmq.common.MixAll;
import org.apache.rocketmq.remoting.protocol.subscription.GroupRetryPolicy;
import org.apache.rocketmq.remoting.protocol.subscription.GroupRetryPolicyType;
import org.apache.rocketmq.remoting.protocol.subscription.SubscriptionGroupConfig;
import org.apache.rocketmq.store.MessageStore;
import org.apache.rocketmq.store.config.MessageStoreConfig;
import org.junit.After;
import org.junit.Assert;
import org.junit.Assume;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
Expand Down Expand Up @@ -66,7 +64,6 @@ public void cleanUp() {

@Before
public void setUp() throws IOException {
Assume.assumeFalse(MixAll.isMac());
BrokerConfig brokerConfig = new BrokerConfig();
brokerConfig.setAutoCreateSubscriptionGroup(false);
Mockito.doReturn(brokerConfig).when(controller).getBrokerConfig();
Expand All @@ -85,7 +82,6 @@ public void setUp() throws IOException {

@Test
public void testUpdateSubscriptionGroupConfig() {
Assume.assumeFalse(MixAll.isMac());
SubscriptionGroupConfig subscriptionGroupConfig = new SubscriptionGroupConfig();
subscriptionGroupConfig.setGroupName("G1");
subscriptionGroupConfig.setConsumeEnable(true);
Expand Down Expand Up @@ -120,7 +116,6 @@ public void testUpdateSubscriptionGroupConfig() {

@Test
public void testDeleteSubscriptionGroupConfig() {
Assume.assumeFalse(MixAll.isMac());
SubscriptionGroupConfig subscriptionGroupConfig = new SubscriptionGroupConfig();
subscriptionGroupConfig.setGroupName("G1");
subscriptionGroupConfig.setConsumeEnable(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,11 @@

import org.apache.rocketmq.broker.BrokerController;
import org.apache.rocketmq.common.BrokerConfig;
import org.apache.rocketmq.common.MixAll;
import org.apache.rocketmq.common.TopicConfig;
import org.apache.rocketmq.store.MessageStore;
import org.apache.rocketmq.store.config.MessageStoreConfig;
import org.junit.After;
import org.junit.Assert;
import org.junit.Assume;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
Expand Down Expand Up @@ -63,7 +61,6 @@ public void cleanUp() {

@Before
public void setUp() throws IOException {
Assume.assumeFalse(MixAll.isMac());
BrokerConfig brokerConfig = new BrokerConfig();
Mockito.doReturn(brokerConfig).when(controller).getBrokerConfig();

Expand All @@ -80,7 +77,6 @@ public void setUp() throws IOException {

@Test
public void testUpdateTopicConfig() {
Assume.assumeFalse(MixAll.isMac());
TopicConfigManagerV2 topicConfigManagerV2 = new TopicConfigManagerV2(controller, configStorage);
topicConfigManagerV2.load();

Expand Down Expand Up @@ -117,7 +113,6 @@ public void testUpdateTopicConfig() {

@Test
public void testRemoveTopicConfig() {
Assume.assumeFalse(MixAll.isMac());
TopicConfig topicConfig = new TopicConfig();
String topicName = "T1";
topicConfig.setTopicName(topicName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ public class RocksDBLmqConsumerOffsetManagerTest {

@Before
public void setUp() {
if (MixAll.isMac()) {
return;
}
brokerController = Mockito.mock(BrokerController.class);
when(brokerController.getMessageStoreConfig()).thenReturn(Mockito.mock(MessageStoreConfig.class));
when(brokerController.getBrokerConfig()).thenReturn(new BrokerConfig());
Expand All @@ -61,9 +58,6 @@ public void setUp() {

@Test
public void testQueryOffsetForNonLmq() {
if (MixAll.isMac()) {
return;
}
long actualOffset = offsetManager.queryOffset(NON_LMQ_GROUP, NON_LMQ_TOPIC, QUEUE_ID);
// Verify
assertEquals("Offset should not be null.", -1, actualOffset);
Expand All @@ -72,9 +66,6 @@ public void testQueryOffsetForNonLmq() {

@Test
public void testQueryOffsetForLmqGroupWithExistingOffset() {
if (MixAll.isMac()) {
return;
}
offsetManager.commitOffset("127.0.0.1",LMQ_GROUP, LMQ_TOPIC, QUEUE_ID, OFFSET);

// Act
Expand All @@ -88,9 +79,6 @@ public void testQueryOffsetForLmqGroupWithExistingOffset() {

@Test
public void testQueryOffsetForLmqGroupWithoutExistingOffset() {
if (MixAll.isMac()) {
return;
}
// Act
Map<Integer, Long> actualOffsets = offsetManager.queryOffset(LMQ_GROUP, "nonExistingTopic");
// Assert
Expand All @@ -99,9 +87,6 @@ public void testQueryOffsetForLmqGroupWithoutExistingOffset() {

@Test
public void testQueryOffsetForNonLmqGroup() {
if (MixAll.isMac()) {
return;
}
// Arrange
Map<Integer, Long> mockOffsets = new HashMap<>();
mockOffsets.put(QUEUE_ID, OFFSET);
Expand All @@ -118,9 +103,6 @@ public void testQueryOffsetForNonLmqGroup() {

@Test
public void testCommitOffsetForLmq() {
if (MixAll.isMac()) {
return;
}
// Execute
offsetManager.commitOffset("clientHost", LMQ_GROUP, LMQ_TOPIC, QUEUE_ID, OFFSET);
// Verify
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import java.util.concurrent.ConcurrentMap;

import org.apache.rocketmq.broker.config.v1.RocksDBOffsetSerializeWrapper;
import org.apache.rocketmq.common.MixAll;
import org.junit.Before;
import org.junit.Test;

Expand All @@ -35,26 +34,17 @@ public class RocksDBOffsetSerializeWrapperTest {

@Before
public void setUp() {
if (MixAll.isMac()) {
return;
}
wrapper = new RocksDBOffsetSerializeWrapper();
}

@Test
public void testGetOffsetTable_ShouldReturnConcurrentHashMap() {
if (MixAll.isMac()) {
return;
}
ConcurrentMap<Integer, Long> offsetTable = wrapper.getOffsetTable();
assertNotNull("The offsetTable should not be null", offsetTable);
}

@Test
public void testSetOffsetTable_ShouldSetTheOffsetTableCorrectly() {
if (MixAll.isMac()) {
return;
}
ConcurrentMap<Integer, Long> newOffsetTable = new ConcurrentHashMap<>();
wrapper.setOffsetTable(newOffsetTable);
ConcurrentMap<Integer, Long> offsetTable = wrapper.getOffsetTable();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@
import org.apache.rocketmq.broker.BrokerController;
import org.apache.rocketmq.broker.offset.ConsumerOffsetManager;
import org.apache.rocketmq.common.BrokerConfig;
import org.apache.rocketmq.common.MixAll;
import org.awaitility.Awaitility;
import org.junit.Assert;
import org.junit.Assume;
import org.junit.Test;
import org.mockito.Mockito;

Expand All @@ -42,7 +40,6 @@ public class PopConsumerCacheTest {

@Test
public void consumerRecordsTest() {
Assume.assumeFalse(MixAll.isMac());
BrokerConfig brokerConfig = new BrokerConfig();
brokerConfig.setPopConsumerKVServiceLog(true);
PopConsumerCache.ConsumerRecords consumerRecords =
Expand Down Expand Up @@ -74,7 +71,6 @@ public void consumerRecordsTest() {

@Test
public void consumerOffsetTest() throws IllegalAccessException {
Assume.assumeFalse(MixAll.isMac());
BrokerController brokerController = Mockito.mock(BrokerController.class);
PopConsumerKVStore consumerKVStore = Mockito.mock(PopConsumerRocksdbStore.class);
PopConsumerLockService consumerLockService = Mockito.mock(PopConsumerLockService.class);
Expand All @@ -98,7 +94,6 @@ public void consumerOffsetTest() throws IllegalAccessException {

@Test
public void consumerCacheTest() {
Assume.assumeFalse(MixAll.isMac());
BrokerController brokerController = Mockito.mock(BrokerController.class);
PopConsumerKVStore consumerKVStore = Mockito.mock(PopConsumerRocksdbStore.class);
PopConsumerLockService consumerLockService = Mockito.mock(PopConsumerLockService.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,10 @@
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import org.apache.commons.io.FileUtils;
import org.apache.rocketmq.common.MixAll;
import org.apache.rocketmq.common.config.AbstractRocksDBStorage;
import org.apache.rocketmq.common.constant.LoggerName;
import org.apache.rocketmq.tieredstore.util.MessageStoreUtil;
import org.junit.Assert;
import org.junit.Assume;
import org.junit.Ignore;
import org.junit.Test;
import org.rocksdb.RocksDB;
Expand Down Expand Up @@ -66,7 +64,6 @@ public static PopConsumerRecord getConsumerRecord() {

@Test
public void rocksdbStoreWriteDeleteTest() {
Assume.assumeFalse(MixAll.isMac());
String filePath = getRandomStorePath();
PopConsumerKVStore consumerStore = new PopConsumerRocksdbStore(filePath);
Assert.assertEquals(filePath, consumerStore.getFilePath());
Expand Down Expand Up @@ -130,7 +127,6 @@ private long getDirectorySizeRecursive(File directory) {
@Ignore
@SuppressWarnings("ConstantValue")
public void tombstoneDeletionTest() throws IllegalAccessException, NoSuchFieldException {
Assume.assumeFalse(MixAll.isMac());
PopConsumerRocksdbStore rocksdbStore = new PopConsumerRocksdbStore(getRandomStorePath());
rocksdbStore.start();

Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
*/
package org.apache.rocketmq.common.attribute;

import org.apache.rocketmq.common.MixAll;
import org.junit.Assume;
import org.junit.Test;

import static org.junit.Assert.assertEquals;
Expand All @@ -26,7 +24,6 @@ public class CQTypeTest {

@Test
public void testValues() {
Assume.assumeFalse(MixAll.isMac());
CQType[] values = CQType.values();
assertEquals(3, values.length);
assertEquals(CQType.SimpleCQ, values[0]);
Expand All @@ -36,15 +33,13 @@ public void testValues() {

@Test
public void testValueOf() {
Assume.assumeFalse(MixAll.isMac());
assertEquals(CQType.SimpleCQ, CQType.valueOf("SimpleCQ"));
assertEquals(CQType.BatchCQ, CQType.valueOf("BatchCQ"));
assertEquals(CQType.RocksDBCQ, CQType.valueOf("RocksDBCQ"));
}

@Test(expected = IllegalArgumentException.class)
public void testValueOf_InvalidName() {
Assume.assumeFalse(MixAll.isMac());
CQType.valueOf("InvalidCQ");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,12 @@

import java.util.ArrayList;
import java.util.List;
import org.apache.rocketmq.common.MixAll;
import org.junit.Assert;
import org.junit.Test;

public class ExportRocksDBConfigToJsonRequestHeaderTest {
@Test
public void configTypeTest() {
if (MixAll.isMac()) {
return;
}
List<ExportRocksDBConfigToJsonRequestHeader.ConfigType> configTypes = new ArrayList<>();
configTypes.add(ExportRocksDBConfigToJsonRequestHeader.ConfigType.TOPICS);
configTypes.add(ExportRocksDBConfigToJsonRequestHeader.ConfigType.SUBSCRIPTION_GROUPS);
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Loading