@@ -0,0 +1,1424 @@
+package com.alibaba.rocketmq.client.consumer.rebalance;%0A%0Aimport com.alibaba.rocketmq.common.message.MessageQueue;%0Aimport org.junit.Test;%0A%0Aimport java.lang.reflect.Method;%0Aimport java.util.ArrayList;%0Aimport java.util.HashMap;%0Aimport java.util.List;%0Aimport java.util.Map;%0A%0Apublic class AllocateMessageQueueByDataCenterTest %7B%0A%0A    @Test%0A    public void testAllocateByCircle() throws Exception %7B%0A        List%3CMessageQueue%3E messageQueues = new ArrayList%3C%3E();%0A        for (int i = 0; i %3C 10; i++) %7B%0A            MessageQueue messageQueue = new MessageQueue(%22Test%22, %22DefaultCluster_2_broker%22 + (i + 1), i);%0A            messageQueues.add(messageQueue);%0A        %7D%0A%0A        List%3CString%3E clientIds = new ArrayList%3C%3E();%0A        clientIds.add(%22C1%22);%0A        clientIds.add(%22C2%22);%0A        clientIds.add(%22C3%22);%0A%0A        Map%3CString, List%3CMessageQueue%3E%3E result = new HashMap%3C%3E();%0A%0A        Class clazz = AllocateMessageQueueByDataCenter.class;%0A        Method method = clazz.getDeclaredMethod(%22allocateByCircle%22, new Class%5B%5D %7BList.class, List.class, HashMap.class%7D);%0A        method.setAccessible(true);%0A        method.invoke(null, messageQueues, clientIds, result);%0A        for (Map.Entry%3CString, List%3CMessageQueue%3E%3E next : result.entrySet()) %7B%0A            System.out.println(next.getKey() + %22--%3E%22);%0A            for (MessageQueue messageQueue : next.getValue()) %7B%0A                System.out.println(messageQueue);%0A            %7D%0A        %7D%0A    %7D%0A%7D

Add comment.