Search in sources :

Example 1 with CodecService

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));
}
Also used : K8sNetworkCodec(org.onosproject.k8snetworking.codec.K8sNetworkCodec) K8sNode(org.onosproject.k8snode.api.K8sNode) K8sNetwork(org.onosproject.k8snetworking.api.K8sNetwork) CodecService(org.onosproject.codec.CodecService) K8sPort(org.onosproject.k8snetworking.api.K8sPort) K8sPortCodec(org.onosproject.k8snetworking.codec.K8sPortCodec) Test(org.junit.Test)

Example 2 with CodecService

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));
}
Also used : K8sNode(org.onosproject.k8snode.api.K8sNode) CodecService(org.onosproject.codec.CodecService) K8sNodeCodec(org.onosproject.k8snode.codec.K8sNodeCodec) Test(org.junit.Test)

Example 3 with CodecService

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();
}
Also used : KubevirtNetworkCodec(org.onosproject.kubevirtnetworking.codec.KubevirtNetworkCodec) KubevirtNetwork(org.onosproject.kubevirtnetworking.api.KubevirtNetwork) CodecService(org.onosproject.codec.CodecService) KubevirtHostRoute(org.onosproject.kubevirtnetworking.api.KubevirtHostRoute) KubevirtIpPool(org.onosproject.kubevirtnetworking.api.KubevirtIpPool) KubevirtIpPoolCodec(org.onosproject.kubevirtnetworking.codec.KubevirtIpPoolCodec) KubevirtHostRouteCodec(org.onosproject.kubevirtnetworking.codec.KubevirtHostRouteCodec) Test(org.junit.Test)

Example 4 with CodecService

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));
}
Also used : KubevirtNode(org.onosproject.kubevirtnode.api.KubevirtNode) KubevirtNodeCodec(org.onosproject.kubevirtnode.codec.KubevirtNodeCodec) KubevirtPhyInterfaceCodec(org.onosproject.kubevirtnode.codec.KubevirtPhyInterfaceCodec) CodecService(org.onosproject.codec.CodecService) KubevirtPhyInterface(org.onosproject.kubevirtnode.api.KubevirtPhyInterface) Test(org.junit.Test)

Example 5 with CodecService

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));
}
Also used : OpenstackAuth(org.onosproject.openstacknode.api.OpenstackAuth) OpenstackSshAuthCodec(org.onosproject.openstacknode.codec.OpenstackSshAuthCodec) OpenstackAuthCodec(org.onosproject.openstacknode.codec.OpenstackAuthCodec) DpdkConfigCodec(org.onosproject.openstacknode.codec.DpdkConfigCodec) DpdkInterfaceCodec(org.onosproject.openstacknode.codec.DpdkInterfaceCodec) OpenstackNode(org.onosproject.openstacknode.api.OpenstackNode) OpenstackControllerCodec(org.onosproject.openstacknode.codec.OpenstackControllerCodec) OpenstackNodeCodec(org.onosproject.openstacknode.codec.OpenstackNodeCodec) OpenstackPhyInterface(org.onosproject.openstacknode.api.OpenstackPhyInterface) DpdkConfig(org.onosproject.openstacknode.api.DpdkConfig) OpenstackPhyInterfaceCodec(org.onosproject.openstacknode.codec.OpenstackPhyInterfaceCodec) OpenstackSshAuth(org.onosproject.openstacknode.api.OpenstackSshAuth) DpdkInterface(org.onosproject.openstacknode.api.DpdkInterface) CodecService(org.onosproject.codec.CodecService) ControllerInfo(org.onosproject.net.behaviour.ControllerInfo) Test(org.junit.Test)

Aggregations

CodecService (org.onosproject.codec.CodecService)13 Test (org.junit.Test)8 Before (org.junit.Before)5 ServiceDirectory (org.onlab.osgi.ServiceDirectory)5 TestServiceDirectory (org.onlab.osgi.TestServiceDirectory)5 CodecManager (org.onosproject.codec.impl.CodecManager)5 K8sNode (org.onosproject.k8snode.api.K8sNode)2 K8sNetwork (org.onosproject.k8snetworking.api.K8sNetwork)1 K8sPort (org.onosproject.k8snetworking.api.K8sPort)1 K8sNetworkCodec (org.onosproject.k8snetworking.codec.K8sNetworkCodec)1 K8sPortCodec (org.onosproject.k8snetworking.codec.K8sPortCodec)1 K8sNodeCodec (org.onosproject.k8snode.codec.K8sNodeCodec)1 KubevirtHostRoute (org.onosproject.kubevirtnetworking.api.KubevirtHostRoute)1 KubevirtIpPool (org.onosproject.kubevirtnetworking.api.KubevirtIpPool)1 KubevirtNetwork (org.onosproject.kubevirtnetworking.api.KubevirtNetwork)1 KubevirtHostRouteCodec (org.onosproject.kubevirtnetworking.codec.KubevirtHostRouteCodec)1 KubevirtIpPoolCodec (org.onosproject.kubevirtnetworking.codec.KubevirtIpPoolCodec)1 KubevirtNetworkCodec (org.onosproject.kubevirtnetworking.codec.KubevirtNetworkCodec)1 KubevirtNode (org.onosproject.kubevirtnode.api.KubevirtNode)1 KubevirtPhyInterface (org.onosproject.kubevirtnode.api.KubevirtPhyInterface)1