use of org.onosproject.codec.CodecService in project onos by opennetworkinglab.
the class K8sNetworkingCodecRegisterTest method testActivateDeactivate.
/**
* Tests codec register activation and deactivation.
*/
@Test
public void testActivateDeactivate() {
K8sNetworkingCodecRegister register = new K8sNetworkingCodecRegister();
CodecService codecService = new TestCodecService();
TestUtils.setField(register, "codecService", codecService);
register.activate();
assertEquals(K8sNetworkCodec.class.getName(), codecService.getCodec(K8sNetwork.class).getClass().getName());
assertEquals(K8sPortCodec.class.getName(), codecService.getCodec(K8sPort.class).getClass().getName());
register.deactivate();
assertNull(codecService.getCodec(K8sNode.class));
}
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 OpenstackNodeCodecRegisterTest method testActivateDeactivate.
/**
* Tests codec register activation and deactivation.
*/
@Test
public void testActivateDeactivate() {
register = new OpenstackNodeCodecRegister();
CodecService codecService = new TestCodecService();
TestUtils.setField(register, "codecService", codecService);
register.activate();
assertEquals(OpenstackNodeCodec.class.getName(), codecService.getCodec(OpenstackNode.class).getClass().getName());
assertEquals(OpenstackAuthCodec.class.getName(), codecService.getCodec(OpenstackAuth.class).getClass().getName());
assertEquals(OpenstackPhyInterfaceCodec.class.getName(), codecService.getCodec(OpenstackPhyInterface.class).getClass().getName());
assertEquals(OpenstackControllerCodec.class.getName(), codecService.getCodec(ControllerInfo.class).getClass().getName());
assertEquals(OpenstackSshAuthCodec.class.getName(), codecService.getCodec(OpenstackSshAuth.class).getClass().getName());
assertEquals(DpdkConfigCodec.class.getName(), codecService.getCodec(DpdkConfig.class).getClass().getName());
assertEquals(DpdkInterfaceCodec.class.getName(), codecService.getCodec(DpdkInterface.class).getClass().getName());
register.deactivate();
assertNull(codecService.getCodec(OpenstackNode.class));
assertNull(codecService.getCodec(OpenstackAuth.class));
assertNull(codecService.getCodec(OpenstackPhyInterface.class));
assertNull(codecService.getCodec(ControllerInfo.class));
assertNull(codecService.getCodec(OpenstackSshAuth.class));
assertNull(codecService.getCodec(DpdkConfig.class));
assertNull(codecService.getCodec(DpdkInterface.class));
}
Aggregations