Search in sources :

Example 1 with DistroComponentHolder

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);
}
Also used : DistroComponentHolder(com.alibaba.nacos.core.distributed.distro.component.DistroComponentHolder) Before(org.junit.Before)

Example 2 with DistroComponentHolder

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);
}
Also used : Member(com.alibaba.nacos.core.cluster.Member) DistroComponentHolder(com.alibaba.nacos.core.distributed.distro.component.DistroComponentHolder) LinkedList(java.util.LinkedList) Before(org.junit.Before)

Aggregations

DistroComponentHolder (com.alibaba.nacos.core.distributed.distro.component.DistroComponentHolder)2 Before (org.junit.Before)2 Member (com.alibaba.nacos.core.cluster.Member)1 LinkedList (java.util.LinkedList)1