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);
}
use of org.onosproject.net.device.DeviceServiceAdapter in project onos by opennetworkinglab.
the class LinkCodecTest method linkCodecTest.
@Test
public void linkCodecTest() {
final MockCodecContext context = new MockCodecContext();
context.registerService(DeviceService.class, new DeviceServiceAdapter());
final JsonCodec<Link> codec = context.codec(Link.class);
assertThat(codec, is(notNullValue()));
final Link pojoIn = link;
assertJsonEncodable(context, codec, pojoIn);
}
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();
}
Aggregations