@Test public void testGetClusterName() { BroadcastResultMergeService broadcastResultMergeService = (BroadcastResultMergeService) consumerContext.getBean("broadcastResultMergeService"); List<String> list = broadcastResultMergeService.getClusterName(); System.out.println(list); }
@Before public void init() { providerContext = new ClassPathXmlApplicationContext(providerConfigLocation); providerContext.start(); BroadcastResultMergeService bean = (BroadcastResultMergeService) providerContext.getBean("broadcastResultMergeService"); bean.setClusterName("dubbo-cluster-1"); providerContext2 = new ClassPathXmlApplicationContext(providerConfigLocation); providerContext2.start(); bean = (BroadcastResultMergeService) providerContext2.getBean("broadcastResultMergeService"); bean.setClusterName("dubbo-cluster-2"); consumerContext = new ClassPathXmlApplicationContext(consumerConfigLocation); consumerContext.start(); }