Search in sources :

Example 1 with ClusterMetadataServiceAdapter

use of org.onosproject.cluster.ClusterMetadataServiceAdapter in project onos by opennetworkinglab.

the class NetworkConfigLinksProviderTest method setUp.

/**
 * Sets up a network config links provider under test and the services
 * required to run it.
 */
@Before
public void setUp() {
    provider = new NetworkConfigLinksProvider();
    provider.coreService = new CoreServiceAdapter();
    provider.packetService = new PacketServiceAdapter();
    LinkProviderRegistryAdapter linkRegistry = new LinkProviderRegistryAdapter();
    provider.providerRegistry = linkRegistry;
    provider.deviceService = new TestDeviceManager();
    provider.masterService = new TestMastershipService();
    provider.packetService = new TestPacketService();
    provider.clusterMetadataService = new ClusterMetadataServiceAdapter();
    provider.netCfgService = configRegistry;
    provider.activate();
    providerService = linkRegistry.registeredProvider();
}
Also used : CoreServiceAdapter(org.onosproject.core.CoreServiceAdapter) PacketServiceAdapter(org.onosproject.net.packet.PacketServiceAdapter) ClusterMetadataServiceAdapter(org.onosproject.cluster.ClusterMetadataServiceAdapter) LinkProviderRegistryAdapter(org.onosproject.net.link.LinkProviderRegistryAdapter) Before(org.junit.Before)

Example 2 with ClusterMetadataServiceAdapter

use of org.onosproject.cluster.ClusterMetadataServiceAdapter in project onos by opennetworkinglab.

the class LldpLinkProviderTest method setUp.

@Before
public void setUp() {
    deviceBlacklist = new HashSet<>();
    portBlacklist = new HashSet<>();
    cfg = new TestSuppressionConfig();
    coreService = createMock(CoreService.class);
    expect(coreService.registerApplication(appId.name())).andReturn(appId).anyTimes();
    replay(coreService);
    provider.cfgService = new ComponentConfigAdapter();
    provider.enabled = false;
    provider.coreService = coreService;
    provider.cfgRegistry = configRegistry;
    provider.deviceService = deviceService;
    provider.linkService = linkService;
    provider.packetService = packetService;
    provider.providerRegistry = linkRegistry;
    provider.masterService = masterService;
    provider.clusterMetadataService = new ClusterMetadataServiceAdapter();
    provider.activate(null);
    provider.eventExecutor = MoreExecutors.newDirectExecutorService();
    providerService = linkRegistry.registeredProvider();
}
Also used : ComponentConfigAdapter(org.onosproject.cfg.ComponentConfigAdapter) CoreService(org.onosproject.core.CoreService) ClusterMetadataServiceAdapter(org.onosproject.cluster.ClusterMetadataServiceAdapter) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)2 ClusterMetadataServiceAdapter (org.onosproject.cluster.ClusterMetadataServiceAdapter)2 ComponentConfigAdapter (org.onosproject.cfg.ComponentConfigAdapter)1 CoreService (org.onosproject.core.CoreService)1 CoreServiceAdapter (org.onosproject.core.CoreServiceAdapter)1 LinkProviderRegistryAdapter (org.onosproject.net.link.LinkProviderRegistryAdapter)1 PacketServiceAdapter (org.onosproject.net.packet.PacketServiceAdapter)1