use of com.alibaba.nacos.core.distributed.distro.component.DistroComponentHolder in project nacos by alibaba.
the class DistroClientComponentRegistryTest method setUp.
@Before
public void setUp() throws Exception {
componentHolder = new DistroComponentHolder();
distroClientComponentRegistry = new DistroClientComponentRegistry(serverMemberManager, distroProtocol, componentHolder, taskEngineHolder, clientManager, clusterRpcClientProxy, upgradeJudgement);
}
use of com.alibaba.nacos.core.distributed.distro.component.DistroComponentHolder in project nacos by alibaba.
the class DistroLoadDataTaskTest method setUp.
@Before
public void setUp() throws Exception {
List<Member> memberList = new LinkedList<>();
memberList.add(Member.builder().ip("2.2.2.2").port(8848).build());
memberList.add(Member.builder().ip("1.1.1.1").port(8848).build());
when(memberManager.allMembersWithoutSelf()).thenReturn(memberList);
componentHolder = new DistroComponentHolder();
componentHolder.registerDataStorage(type, distroDataStorage);
componentHolder.registerTransportAgent(type, distroTransportAgent);
componentHolder.registerFailedTaskHandler(type, distroFailedTaskHandler);
when(distroDataProcessor.processType()).thenReturn(type);
componentHolder.registerDataProcessor(distroDataProcessor);
when(distroTransportAgent.getDatumSnapshot(any(String.class))).thenReturn(distroData);
when(distroDataProcessor.processSnapshot(distroData)).thenReturn(true);
distroLoadDataTask = new DistroLoadDataTask(memberManager, componentHolder, distroConfig, loadCallback);
}
Aggregations