Search in sources :

Example 6 with DeviceServiceAdapter

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);
}
Also used : Device(org.onosproject.net.Device) DefaultDevice(org.onosproject.net.DefaultDevice) DeviceServiceAdapter(org.onosproject.net.device.DeviceServiceAdapter) Test(org.junit.Test)

Example 7 with DeviceServiceAdapter

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);
}
Also used : DeviceServiceAdapter(org.onosproject.net.device.DeviceServiceAdapter) DefaultLink(org.onosproject.net.DefaultLink) Link(org.onosproject.net.Link) Test(org.junit.Test)

Example 8 with DeviceServiceAdapter

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();
}
Also used : PacketServiceAdapter(org.onosproject.net.packet.PacketServiceAdapter) TestStorageService(org.onosproject.store.service.TestStorageService) ClusterServiceAdapter(org.onosproject.cluster.ClusterServiceAdapter) DeviceServiceAdapter(org.onosproject.net.device.DeviceServiceAdapter) Before(org.junit.Before)

Aggregations

DeviceServiceAdapter (org.onosproject.net.device.DeviceServiceAdapter)8 Before (org.junit.Before)5 ComponentConfigAdapter (org.onosproject.cfg.ComponentConfigAdapter)4 Test (org.junit.Test)3 TestEventDispatcher (org.onosproject.common.event.impl.TestEventDispatcher)2 CoreServiceAdapter (org.onosproject.core.CoreServiceAdapter)2 TestStorageService (org.onosproject.store.service.TestStorageService)2 ClusterService (org.onosproject.cluster.ClusterService)1 ClusterServiceAdapter (org.onosproject.cluster.ClusterServiceAdapter)1 NodeId (org.onosproject.cluster.NodeId)1 DefaultDevice (org.onosproject.net.DefaultDevice)1 DefaultLink (org.onosproject.net.DefaultLink)1 DefaultPort (org.onosproject.net.DefaultPort)1 Device (org.onosproject.net.Device)1 Link (org.onosproject.net.Link)1 Port (org.onosproject.net.Port)1 NetworkConfigRegistryAdapter (org.onosproject.net.config.NetworkConfigRegistryAdapter)1 DriverServiceAdapter (org.onosproject.net.driver.DriverServiceAdapter)1 FlowRuleServiceAdapter (org.onosproject.net.flow.FlowRuleServiceAdapter)1 MeterServiceAdapter (org.onosproject.net.meter.MeterServiceAdapter)1