use of org.onosproject.net.device.DeviceServiceAdapter in project onos by opennetworkinglab.
the class PortCodecTest method portCodecTest.
@Test
public void portCodecTest() {
final MockCodecContext context = new MockCodecContext();
context.registerService(DeviceService.class, new DeviceServiceAdapter());
final JsonCodec<Port> codec = context.codec(Port.class);
assertThat(codec, is(notNullValue()));
final Port pojoIn = port;
assertJsonEncodable(context, codec, pojoIn);
}
use of org.onosproject.net.device.DeviceServiceAdapter in project onos by opennetworkinglab.
the class DriverRegistryManagerTest method setUp.
@Before
public void setUp() {
mgr = new DriverRegistryManager();
mgr.deviceService = new DeviceServiceAdapter();
mgr.componentConfigService = new ComponentConfigAdapter();
mgr.eventDispatcher = new TestEventDispatcher();
mgr.componentService = componentService;
mgr.activate(null);
}
use of org.onosproject.net.device.DeviceServiceAdapter in project up4 by omec-project.
the class Up4DeviceManagerTest method setUp.
@Before
public void setUp() {
component = new Up4DeviceManager();
component.coreService = new CoreServiceAdapter();
component.flowRuleService = new FlowRuleServiceAdapter();
component.meterService = new MeterServiceAdapter();
component.deviceService = new DeviceServiceAdapter();
component.piPipeconfService = new PiPipeconfServiceAdapter();
component.netCfgService = new NetworkConfigRegistryAdapter();
component.componentConfigService = new ComponentConfigAdapter();
component.up4Store = TestDistributedUp4Store.build();
injectEventDispatcher(component, new TestEventDispatcher());
component.activate();
}
use of org.onosproject.net.device.DeviceServiceAdapter in project onos by opennetworkinglab.
the class OpenstackNetworkManagerTest method setUp.
@Before
public void setUp() throws Exception {
NETWORK.setId(NETWORK_ID);
NETWORK_COPY.setId(NETWORK_ID);
SUBNET.setId(SUBNET_ID);
SUBNET_COPY.setId(SUBNET_ID);
PORT.setId(PORT_ID);
PORT_COPY.setId(PORT_ID);
osNetworkStore = new DistributedOpenstackNetworkStore();
TestUtils.setField(osNetworkStore, "coreService", new TestCoreService());
TestUtils.setField(osNetworkStore, "storageService", new TestStorageService());
TestUtils.setField(osNetworkStore, "preCommitPortService", new TestPreCommitPortService());
TestUtils.setField(osNetworkStore, "eventExecutor", MoreExecutors.newDirectExecutorService());
osNetworkStore.activate();
target = new OpenstackNetworkManager();
TestUtils.setField(target, "coreService", new TestCoreService());
TestUtils.setField(target, "packetService", new PacketServiceAdapter());
TestUtils.setField(target, "deviceService", new DeviceServiceAdapter());
TestUtils.setField(target, "storageService", new TestStorageService());
TestUtils.setField(target, "clusterService", new ClusterServiceAdapter());
TestUtils.setField(target, "openstacknodeService", new TestOpenstackNodeManager());
target.osNetworkStore = osNetworkStore;
target.addListener(testListener);
target.activate();
}
use of org.onosproject.net.device.DeviceServiceAdapter in project onos by opennetworkinglab.
the class DeviceCodecTest method deviceCodecTest.
@Test
public void deviceCodecTest() {
final MockCodecContext context = new MockCodecContext();
expect(mockDriverService.getDriver(JsonCodecUtils.DID1)).andReturn(driver).anyTimes();
replay(mockDriverService);
context.registerService(DeviceService.class, new DeviceServiceAdapter());
context.registerService(DriverService.class, mockDriverService);
final JsonCodec<Device> codec = context.codec(Device.class);
assertThat(codec, is(notNullValue()));
final Device pojoIn = device;
assertJsonEncodable(context, codec, pojoIn);
}
Aggregations