use of org.onosproject.cfg.ComponentConfigAdapter in project onos by opennetworkinglab.
the class IntentCleanupTestMock method setUp.
@Before
public void setUp() {
service = createMock(IntentService.class);
store = new SimpleIntentStore();
cleanup = new IntentCleanup();
cleanup.cfgService = new ComponentConfigAdapter();
cleanup.service = service;
cleanup.store = store;
cleanup.period = 1000;
cleanup.retryThreshold = 3;
assertTrue("store should be empty", Sets.newHashSet(cleanup.store.getIntents()).isEmpty());
super.setUp();
}
use of org.onosproject.cfg.ComponentConfigAdapter in project onos by opennetworkinglab.
the class FlowRuleManagerTest method setUp.
@Before
public void setUp() {
mgr = new FlowRuleManager();
mgr.store = new SimpleFlowRuleStore();
injectEventDispatcher(mgr, new TestEventDispatcher());
mgr.deviceService = new TestDeviceService();
mgr.mastershipService = new TestMastershipService();
mgr.coreService = new TestCoreService();
mgr.operationsService = MoreExecutors.newDirectExecutorService();
mgr.deviceInstallers = MoreExecutors.newDirectExecutorService();
mgr.cfgService = new ComponentConfigAdapter();
ClusterService mockClusterService = createMock(ClusterService.class);
NodeId nodeId = new NodeId(NODE_ID);
MockControllerNode mockControllerNode = new MockControllerNode(nodeId);
expect(mockClusterService.getLocalNode()).andReturn(mockControllerNode).anyTimes();
replay(mockClusterService);
mgr.clusterService = mockClusterService;
service = mgr;
registry = mgr;
DriverRegistryManager driverRegistry = new DriverRegistryManager();
driverService = new TestDriverManager(driverRegistry);
driverRegistry.addDriver(new DefaultDriver("foo", ImmutableList.of(), "", "", "", ImmutableMap.of(FlowRuleProgrammable.class, TestFlowRuleProgrammable.class), ImmutableMap.of()));
mgr.activate(null);
mgr.addListener(listener);
provider = new TestProvider(PID);
providerService = this.registry.register(provider);
appId = new TestApplicationId(0, "FlowRuleManagerTest");
assertTrue("provider should be registered", this.registry.getProviders().contains(provider.id()));
}
use of org.onosproject.cfg.ComponentConfigAdapter in project onos by opennetworkinglab.
the class DefaultTopologyProviderTest method setUp.
@Before
public void setUp() {
provider.deviceService = deviceService;
provider.linkService = linkService;
provider.providerRegistry = topologyService;
provider.cfgService = new ComponentConfigAdapter();
provider.activate(null);
}
use of org.onosproject.cfg.ComponentConfigAdapter in project onos by opennetworkinglab.
the class OpenFlowGroupProviderTest method setUp.
@Before
public void setUp() {
provider.controller = controller;
provider.providerRegistry = providerRegistry;
provider.cfgService = new ComponentConfigAdapter();
provider.driverService = new DriverServiceAdapter();
provider.activate(null);
}
use of org.onosproject.cfg.ComponentConfigAdapter 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();
}
Aggregations