use of org.onosproject.codec.CodecService in project onos by opennetworkinglab.
the class K8sNodeCodecRegisterTest method testActivateDeactivate.
/**
* Tests codec register activation and deactivation.
*/
@Test
public void testActivateDeactivate() {
register = new K8sNodeCodecRegister();
CodecService codecService = new TestCodecService();
TestUtils.setField(register, "codecService", codecService);
register.activate();
assertEquals(K8sNodeCodec.class.getName(), codecService.getCodec(K8sNode.class).getClass().getName());
register.deactivate();
assertNull(codecService.getCodec(K8sNode.class));
}
use of org.onosproject.codec.CodecService in project onos by opennetworkinglab.
the class KubevirtNetworkingCodecRegisterTest method testActivateDeactivate.
/**
* Tests codec register activation and deactivation.
*/
@Test
public void testActivateDeactivate() {
KubevirtNetworkingCodecRegister register = new KubevirtNetworkingCodecRegister();
CodecService codecService = new TestCodecService();
TestUtils.setField(register, "codecService", codecService);
register.activate();
assertEquals(KubevirtNetworkCodec.class.getName(), codecService.getCodec(KubevirtNetwork.class).getClass().getName());
assertEquals(KubevirtHostRouteCodec.class.getName(), codecService.getCodec(KubevirtHostRoute.class).getClass().getName());
assertEquals(KubevirtIpPoolCodec.class.getName(), codecService.getCodec(KubevirtIpPool.class).getClass().getName());
register.deactivate();
}
use of org.onosproject.codec.CodecService in project onos by opennetworkinglab.
the class KubevirtNodeCodecRegisterTest method testActivateDeactivate.
/**
* Tests codec register activation and deactivation.
*/
@Test
public void testActivateDeactivate() {
register = new KubevirtNodeCodecRegister();
CodecService codecService = new TestCodecService();
TestUtils.setField(register, "codecService", codecService);
register.activate();
assertEquals(KubevirtNodeCodec.class.getName(), codecService.getCodec(KubevirtNode.class).getClass().getName());
assertEquals(KubevirtPhyInterfaceCodec.class.getName(), codecService.getCodec(KubevirtPhyInterface.class).getClass().getName());
register.deactivate();
assertNull(codecService.getCodec(KubevirtNode.class));
assertNull(codecService.getCodec(KubevirtPhyInterface.class));
}
use of org.onosproject.codec.CodecService in project onos by opennetworkinglab.
the class OpenstackNetworkingCodecRegisterTest method testActivateDeactivate.
/**
* Tests codec register activation and deactivation.
*/
@Test
public void testActivateDeactivate() {
register = new OpenstackNetworkingCodecRegister();
CodecService codecService = new TestCodecService();
TestUtils.setField(register, "codecService", codecService);
register.activate();
assertEquals(InstancePortCodec.class.getName(), codecService.getCodec(InstancePort.class).getClass().getName());
register.deactivate();
assertNull(codecService.getCodec(InstancePort.class));
}
use of org.onosproject.codec.CodecService in project onos by opennetworkinglab.
the class OpenstackRestCodecRegisterTest method testActivateDeactivate.
/**
* Tests codec register activation and deactivation.
*/
@Test
public void testActivateDeactivate() {
register = new OpenstackRestCodecRegister();
CodecService codecService = new TestCodecService();
TestUtils.setField(register, "codecService", codecService);
register.activate();
assertEquals(StatsInfoJsonCodec.class.getName(), codecService.getCodec(StatsInfo.class).getClass().getName());
assertEquals(FlowInfoJsonCodec.class.getName(), codecService.getCodec(FlowInfo.class).getClass().getName());
assertEquals(StatsFlowRuleJsonCodec.class.getName(), codecService.getCodec(StatsFlowRule.class).getClass().getName());
assertEquals(TelemetryConfigJsonCodec.class.getName(), codecService.getCodec(TelemetryConfig.class).getClass().getName());
register.deactivate();
assertNull(codecService.getCodec(StatsInfo.class));
assertNull(codecService.getCodec(FlowInfo.class));
assertNull(codecService.getCodec(StatsFlowRule.class));
assertNull(codecService.getCodec(TelemetryConfig.class));
}
Aggregations