本文整理汇总了Java中org.onosproject.net.AbstractProjectableModel.setDriverService方法的典型用法代码示例。如果您正苦于以下问题:Java AbstractProjectableModel.setDriverService方法的具体用法?Java AbstractProjectableModel.setDriverService怎么用?Java AbstractProjectableModel.setDriverService使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.onosproject.net.AbstractProjectableModel
的用法示例。
在下文中一共展示了AbstractProjectableModel.setDriverService方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUp
import org.onosproject.net.AbstractProjectableModel; //导入方法依赖的package包/类
@Before
public void setUp() {
AbstractProjectableModel.setDriverService(null, new MockDriverService());
sut = new OpticalOduIntentCompiler();
coreService = createMock(CoreService.class);
expect(coreService.registerApplication("org.onosproject.net.intent"))
.andReturn(appId);
sut.coreService = coreService;
sut.deviceService = new MockDeviceService();
sut.resourceService = new MockResourceService();
sut.topologyService = new MockTopologyService();
Intent.bindIdGenerator(idGenerator);
intentExtensionService = createMock(IntentExtensionService.class);
intentExtensionService.registerCompiler(OpticalOduIntent.class, sut);
intentExtensionService.unregisterCompiler(OpticalOduIntent.class);
sut.intentManager = intentExtensionService;
replay(coreService, intentExtensionService);
}
示例2: setUp
import org.onosproject.net.AbstractProjectableModel; //导入方法依赖的package包/类
@Before
public void setUp() {
coreService = createMock(CoreService.class);
expect(coreService.registerApplication(appId.name()))
.andReturn(appId).anyTimes();
replay(coreService);
provider.coreService = coreService;
provider.providerRegistry = linkRegistry;
provider.deviceService = deviceService;
provider.mastershipService = mastershipService;
provider.linkService = linkService;
provider.cfgService = new ComponentConfigAdapter();
AbstractProjectableModel.setDriverService(null, new DriverServiceAdapter());
provider.activate(null);
providerService = linkRegistry.registeredProvider();
}
示例3: setUp
import org.onosproject.net.AbstractProjectableModel; //导入方法依赖的package包/类
@Before
public void setUp() {
AbstractProjectableModel.setDriverService(null, new MockDriverService());
sut = new OpticalOduIntentCompiler();
coreService = createMock(CoreService.class);
expect(coreService.registerApplication("org.onosproject.net.intent"))
.andReturn(appId);
sut.coreService = coreService;
sut.deviceService = new MockDeviceService();
sut.resourceService = new MockResourceService();
sut.topologyService = new MockTopologyService();
super.setUp();
intentExtensionService = createMock(IntentExtensionService.class);
intentExtensionService.registerCompiler(OpticalOduIntent.class, sut);
intentExtensionService.unregisterCompiler(OpticalOduIntent.class);
sut.intentManager = intentExtensionService;
replay(coreService, intentExtensionService);
}
示例4: addDevice
import org.onosproject.net.AbstractProjectableModel; //导入方法依赖的package包/类
@Test
public void addDevice() {
assertTrue("Event should be relevant", provider.cfgLister.isRelevant(deviceAddedEvent));
provider.cfgLister.event(deviceAddedEvent);
AbstractProjectableModel.setDriverService(null, new MockDriverService());
//FIXME this needs sleep
assertAfter(500, () ->
assertNotNull("Device should be added to controller", controller.getDevice(deviceId)));
assertTrue("Device should be reachable", provider.isReachable(deviceId));
}
示例5: setUp
import org.onosproject.net.AbstractProjectableModel; //导入方法依赖的package包/类
@Before
public void setUp() {
provider.providerRegistry = providerRegistry;
provider.deviceService = deviceService;
provider.mastershipService = mastershipService;
AbstractProjectableModel.setDriverService(null, new DriverServiceAdapter());
provider.activate(context);
}
示例6: setUp
import org.onosproject.net.AbstractProjectableModel; //导入方法依赖的package包/类
@Before
public void setUp() throws IOException {
coreService = createMock(CoreService.class);
expect(coreService.registerApplication(APP_NAME))
.andReturn(appId).anyTimes();
replay(coreService);
provider.coreService = coreService;
provider.providerRegistry = deviceRegistry;
provider.mastershipService = mastershipService;
provider.deviceService = deviceService;
provider.providerService = providerService;
provider.cfgService = cfgService;
provider.controller = controller;
provider.deviceKeyAdminService = deviceKeyAdminService;
provider.componentConfigService = new ComponentConfigAdapter();
AbstractProjectableModel.setDriverService(null, new DriverServiceAdapter());
provider.activate(null);
devices.clear();
available = false;
firstRequest = true;
DeviceId subject = DeviceId.deviceId(NETCONF_DEVICE_ID_STRING);
DeviceId subjectIpv6 = DeviceId.deviceId(NETCONF_DEVICE_ID_STRING_IPV6);
String key = "netconf";
ObjectMapper mapper = new ObjectMapper();
JsonNode jsonNode = mapper.readTree(jsonStream);
ConfigApplyDelegate delegate = new MockDelegate();
netconfDeviceConfig.init(subject, key, jsonNode, mapper, delegate);
JsonNode jsonNodesshKey = mapper.readTree(jsonStreamSshKey);
netconfDeviceConfigSshKey.init(subject, key, jsonNodesshKey, mapper, delegate);
JsonNode jsonNodeEmpty = mapper.createObjectNode();
netconfDeviceConfigEmptyIpv4.init(subject, key, jsonNodeEmpty, mapper, delegate);
netconfDeviceConfigEmptyIpv6.init(subjectIpv6, key, jsonNodeEmpty, mapper, delegate);
deviceAdded = new CountDownLatch(0);
}
示例7: addDevice
import org.onosproject.net.AbstractProjectableModel; //导入方法依赖的package包/类
@Test
public void addDevice() {
assertTrue("Event should be relevant", provider.cfgLister.isRelevant(deviceAddedEvent));
provider.cfgLister.event(deviceAddedEvent);
AbstractProjectableModel.setDriverService(null, new MockDriverService());
//FIXME this needs sleep
assertAfter(DELAY, TEST_DURATION, () ->
assertNotNull("Device should be added to controller", controller.getDevice(deviceId)));
assertTrue("Device should be reachable", provider.isReachable(deviceId));
}
示例8: addDeviceNew
import org.onosproject.net.AbstractProjectableModel; //导入方法依赖的package包/类
@Test
public void addDeviceNew() {
assertTrue("Event should be relevant", provider.cfgLister.isRelevant(deviceAddedNewEvent));
provider.cfgLister.event(deviceAddedNewEvent);
AbstractProjectableModel.setDriverService(null, new MockDriverService());
//FIXME this needs sleep
assertAfter(DELAY, TEST_DURATION, () ->
assertNotNull("Device should be added to controller", controller.getDevice(deviceId)));
assertTrue("Device should be reachable", provider.isReachable(deviceId));
}
示例9: activate
import org.onosproject.net.AbstractProjectableModel; //导入方法依赖的package包/类
@Activate
protected void activate() {
AbstractProjectableModel.setDriverService(null, this);
log.info("Started");
}
示例10: deactivate
import org.onosproject.net.AbstractProjectableModel; //导入方法依赖的package包/类
@Deactivate
protected void deactivate() {
AbstractProjectableModel.setDriverService(this, null);
log.info("Stopped");
}
示例11: setUpClass
import org.onosproject.net.AbstractProjectableModel; //导入方法依赖的package包/类
@BeforeClass
public static void setUpClass() {
AbstractProjectableModel.setDriverService("key", new DriverServiceAdapter());
}
示例12: setup
import org.onosproject.net.AbstractProjectableModel; //导入方法依赖的package包/类
@Before
public void setup() throws CfmConfigException {
mepManager = new CfmMepManager();
mepStore = new DistributedMepStore();
storageService = new MockStorageService();
ma1 = DefaultMaintenanceAssociation.builder(MANAME1, MDNAME1.getNameLength()).build();
ma2 = DefaultMaintenanceAssociation.builder(MANAME2, MDNAME2.getNameLength()).build();
TestUtils.setField(mepStore, "storageService", storageService);
((DistributedMepStore) mepStore).activate();
TestUtils.setField(mepManager, "coreService", new TestCoreService());
TestUtils.setField(mepManager, "deviceService", deviceService);
TestUtils.setField(mepManager, "cfmMdService", mdService);
TestUtils.setField(mepManager, "mepStore", mepStore);
injectEventDispatcher(mepManager, new TestEventDispatcher());
mepService = mepManager;
mepManager.activate();
mep1 = DefaultMep.builder(MEPID1, DEVICE_ID1, PortNumber.P0,
Mep.MepDirection.UP_MEP, MDNAME1, MANAME1).build();
mepStore.createUpdateMep(new MepKeyId(MDNAME1, MANAME1, MEPID1), mep1);
mep11 = DefaultMep.builder(MEPID11, DEVICE_ID1, PortNumber.P0,
Mep.MepDirection.UP_MEP, MDNAME1, MANAME1).build();
mepStore.createUpdateMep(new MepKeyId(MDNAME1, MANAME1, MEPID11), mep11);
mep12 = DefaultMep.builder(MEPID12, DEVICE_ID1, PortNumber.P0,
Mep.MepDirection.UP_MEP, MDNAME2, MANAME2).build();
mepStore.createUpdateMep(new MepKeyId(MDNAME2, MANAME2, MEPID12), mep12);
mep2 = DefaultMep.builder(MEPID2, DEVICE_ID2, PortNumber.portNumber(2),
Mep.MepDirection.UP_MEP, MDNAME1, MANAME1).build();
mepStore.createUpdateMep(new MepKeyId(MDNAME1, MANAME1, MEPID2), mep2);
mep21 = DefaultMep.builder(MEPID21, DEVICE_ID2, PortNumber.portNumber(2),
Mep.MepDirection.UP_MEP, MDNAME1, MANAME1).build();
mepStore.createUpdateMep(new MepKeyId(MDNAME1, MANAME1, MEPID21), mep21);
mep22 = DefaultMep.builder(MEPID22, DEVICE_ID2, PortNumber.portNumber(2),
Mep.MepDirection.UP_MEP, MDNAME2, MANAME2).build();
mepStore.createUpdateMep(new MepKeyId(MDNAME2, MANAME2, MEPID22), mep22);
device1 = new DefaultDevice(
ProviderId.NONE, DEVICE_ID1, Device.Type.SWITCH,
TEST_MFR, TEST_HW_VERSION, TEST_SW_VERSION, TEST_SN,
new ChassisId(1),
DefaultAnnotations.builder().set(AnnotationKeys.DRIVER, TEST_DRIVER).build());
device2 = new DefaultDevice(
ProviderId.NONE, DEVICE_ID2, Device.Type.SWITCH,
TEST_MFR, TEST_HW_VERSION, TEST_SW_VERSION, TEST_SN,
new ChassisId(2),
DefaultAnnotations.builder().set(AnnotationKeys.DRIVER, TEST_DRIVER).build());
AbstractProjectableModel.setDriverService(null, driverService);
Map<Class<? extends Behaviour>, Class<? extends Behaviour>> behaviours = new HashMap<>();
behaviours.put(DeviceDescriptionDiscovery.class, TestDeviceDiscoveryBehavior.class);
behaviours.put(CfmMepProgrammable.class, TestCfmMepProgrammable.class);
behaviours.put(SoamDmProgrammable.class, TestSoamDmProgrammable.class);
testDriver = new DefaultDriver(
TEST_DRIVER, new ArrayList<Driver>(),
TEST_MFR, TEST_HW_VERSION, TEST_SW_VERSION,
behaviours, new HashMap<>());
}
示例13: setup
import org.onosproject.net.AbstractProjectableModel; //导入方法依赖的package包/类
@Before
public void setup() throws CfmConfigException, SoamConfigException {
soamManager = new SoamManager();
TestUtils.setField(soamManager, "coreService", new TestCoreService());
TestUtils.setField(soamManager, "cfmMepService", mepService);
TestUtils.setField(soamManager, "deviceService", deviceService);
injectEventDispatcher(soamManager, new TestEventDispatcher());
soamService = soamManager;
soamManager.activate();
DelayMeasurementEntry dmEntry1 = DefaultDelayMeasurementEntry
.builder(DMID101, DelayMeasurementCreate.DmType.DM1DMTX,
DelayMeasurementCreate.Version.Y17312011,
MepId.valueOf((short) 11), Mep.Priority.PRIO5).build();
DelayMeasurementEntry dmEntry2 = DefaultDelayMeasurementEntry
.builder(DMID102, DelayMeasurementCreate.DmType.DM1DMTX,
DelayMeasurementCreate.Version.Y17312011,
MepId.valueOf((short) 11), Mep.Priority.PRIO6).build();
mep1 = DefaultMepEntry.builder(MEPID1, DEVICE_ID1, PortNumber.P0,
Mep.MepDirection.UP_MEP, MDNAME1, MANAME1)
.addToDelayMeasurementList(dmEntry1)
.addToDelayMeasurementList(dmEntry2)
.buildEntry();
device1 = new DefaultDevice(
ProviderId.NONE, DEVICE_ID1, Device.Type.SWITCH,
TEST_MFR, TEST_HW_VERSION, TEST_SW_VERSION, TEST_SN,
new ChassisId(1),
DefaultAnnotations.builder().set(AnnotationKeys.DRIVER, TEST_DRIVER).build());
AbstractProjectableModel.setDriverService(null, driverService);
Map<Class<? extends Behaviour>, Class<? extends Behaviour>> behaviours = new HashMap<>();
behaviours.put(DeviceDescriptionDiscovery.class, TestDeviceDiscoveryBehavior.class);
behaviours.put(CfmMepProgrammable.class, TestCfmMepProgrammable.class);
behaviours.put(SoamDmProgrammable.class, TestSoamDmProgrammable.class);
testDriver = new DefaultDriver(
TEST_DRIVER, new ArrayList<Driver>(),
TEST_MFR, TEST_HW_VERSION, TEST_SW_VERSION,
behaviours, new HashMap<>());
}