use of org.onosproject.net.device.DeviceDescription in project onos by opennetworkinglab.
the class InternalDeviceEventSerializer method read.
@Override
public InternalDeviceEvent read(Kryo kryo, Input input, Class<InternalDeviceEvent> type) {
ProviderId providerId = (ProviderId) kryo.readClassAndObject(input);
DeviceId deviceId = kryo.readObject(input, DeviceId.class, deviceIdSerializer());
@SuppressWarnings("unchecked") Timestamped<DeviceDescription> deviceDescription = (Timestamped<DeviceDescription>) kryo.readClassAndObject(input);
return new InternalDeviceEvent(providerId, deviceId, deviceDescription);
}
use of org.onosproject.net.device.DeviceDescription in project onos by opennetworkinglab.
the class JuniperUtilsTest method testDeviceDescriptionParsedFromJunos15.
@Test
public void testDeviceDescriptionParsedFromJunos15() throws IOException {
HierarchicalConfiguration getSystemInfoResp = XmlConfigParser.loadXml(getClass().getResourceAsStream("/Junos_get-system-information_response_15.1.xml"));
String chassisText = CharStreams.toString(new InputStreamReader(getClass().getResourceAsStream("/Junos_get-chassis-mac-addresses_response_15.1.xml")));
DeviceDescription expected = new DefaultDeviceDescription(URI.create(DEVICE_ID), ROUTER, "JUNIPER", "mx240", "junos 15.1R5.5", "JN11AC665AFC", new ChassisId("8418889983c0"));
assertEquals(expected, JuniperUtils.parseJuniperDescription(deviceId, getSystemInfoResp, chassisText));
}
use of org.onosproject.net.device.DeviceDescription in project onos by opennetworkinglab.
the class JuniperUtilsTest method testDeviceDescriptionParsedFromJunos19.
@Test
public void testDeviceDescriptionParsedFromJunos19() throws IOException {
HierarchicalConfiguration getSystemInfoResp = XmlConfigParser.loadXml(getClass().getResourceAsStream("/Junos_get-system-information_response_19.2.xml"));
String chassisText = CharStreams.toString(new InputStreamReader(getClass().getResourceAsStream("/Junos_get-chassis-mac-addresses_response_19.2.xml")));
DeviceDescription expected = new DefaultDeviceDescription(URI.create(DEVICE_ID), ROUTER, "JUNIPER", "acx6360-or", "junos 19.2I-20190228_dev_common.0.2316", "DX004", new ChassisId("f4b52f1f81c0"));
assertEquals(expected, JuniperUtils.parseJuniperDescription(deviceId, getSystemInfoResp, chassisText));
}
use of org.onosproject.net.device.DeviceDescription in project onos by opennetworkinglab.
the class GossipDeviceStoreTest method putDevice.
private void putDevice(DeviceId deviceId, String swVersion, SparseAnnotations... annotations) {
DeviceDescription description = new DefaultDeviceDescription(deviceId.uri(), SWITCH, MFR, HW, swVersion, SN, CID, annotations);
reset(clusterCommunicator);
clusterCommunicator.<InternalDeviceEvent>broadcast(anyObject(InternalDeviceEvent.class), anyObject(MessageSubject.class), anyObject(Function.class));
expectLastCall().anyTimes();
replay(clusterCommunicator);
deviceStore.createOrUpdateDevice(PID, deviceId, description);
verify(clusterCommunicator);
}
Aggregations