Search in sources :

Example 21 with CodecManager

use of org.onosproject.codec.impl.CodecManager in project onos by opennetworkinglab.

the class K8sPortWebResourceTest method setUpTest.

/**
 * Sets up the global values for all the tests.
 */
@Before
public void setUpTest() {
    final CodecManager codecService = new CodecManager();
    codecService.activate();
    codecService.registerCodec(K8sPort.class, new K8sPortCodec());
    ServiceDirectory testDirectory = new TestServiceDirectory().add(K8sNetworkAdminService.class, mockAdminService).add(CodecService.class, codecService);
    setServiceDirectory(testDirectory);
}
Also used : ServiceDirectory(org.onlab.osgi.ServiceDirectory) TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) CodecManager(org.onosproject.codec.impl.CodecManager) K8sNetworkAdminService(org.onosproject.k8snetworking.api.K8sNetworkAdminService) K8sPortCodec(org.onosproject.k8snetworking.codec.K8sPortCodec) Before(org.junit.Before)

Example 22 with CodecManager

use of org.onosproject.codec.impl.CodecManager in project onos by opennetworkinglab.

the class K8sIpamWebResourceTest method setUpTest.

/**
 * Sets up the global values for all the tests.
 */
@Before
public void setUpTest() {
    final CodecManager codecService = new CodecManager();
    codecService.activate();
    codecService.registerCodec(K8sIpam.class, new K8sIpamCodec());
    ServiceDirectory testDirectory = new TestServiceDirectory().add(K8sNetworkService.class, mockNetworkService).add(K8sIpamAdminService.class, mockIpamService).add(CodecService.class, codecService);
    setServiceDirectory(testDirectory);
    k8sNetwork = DefaultK8sNetwork.builder().networkId("sona-network").name("sona-network").segmentId("1").cidr("10.10.10.0/24").gatewayIp(IpAddress.valueOf("10.10.10.1")).type(K8sNetwork.Type.VXLAN).mtu(1500).build();
}
Also used : K8sIpamCodec(org.onosproject.k8snetworking.codec.K8sIpamCodec) ServiceDirectory(org.onlab.osgi.ServiceDirectory) TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) CodecManager(org.onosproject.codec.impl.CodecManager) K8sIpamAdminService(org.onosproject.k8snetworking.api.K8sIpamAdminService) Before(org.junit.Before)

Example 23 with CodecManager

use of org.onosproject.codec.impl.CodecManager in project onos by opennetworkinglab.

the class KubevirtApiConfigWebResourceTest method setUpTest.

/**
 * Sets up the global values for all the tests.
 */
@Before
public void setUpTest() {
    final CodecManager codecService = new CodecManager();
    codecService.activate();
    codecService.registerCodec(KubevirtApiConfig.class, new KubevirtApiConfigCodec());
    ServiceDirectory testDirectory = new TestServiceDirectory().add(KubevirtApiConfigAdminService.class, mockConfigAdminService).add(CodecService.class, codecService);
    setServiceDirectory(testDirectory);
    kubevirtApiConfig = DefaultKubevirtApiConfig.builder().scheme(HTTPS).ipAddress(IpAddress.valueOf("10.134.34.223")).port(6443).state(DISCONNECTED).token("tokenMod").caCertData("caCertData").clientCertData("clientCertData").clientKeyData("clientKeyData").build();
}
Also used : ServiceDirectory(org.onlab.osgi.ServiceDirectory) TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) KubevirtApiConfigAdminService(org.onosproject.kubevirtnode.api.KubevirtApiConfigAdminService) TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) KubevirtApiConfigCodec(org.onosproject.kubevirtnode.codec.KubevirtApiConfigCodec) CodecManager(org.onosproject.codec.impl.CodecManager) Before(org.junit.Before)

Example 24 with CodecManager

use of org.onosproject.codec.impl.CodecManager in project onos by opennetworkinglab.

the class MappingActionCodecTest method setUp.

/**
 * Sets up for each test.
 * Creates a context and fetches the mapping action codec.
 */
@Before
public void setUp() {
    CodecManager manager = new CodecManager();
    registrator = new MappingCodecRegistrator();
    registrator.codecService = manager;
    registrator.activate();
    context = new MappingCodecContextAdapter(registrator.codecService);
    actionCodec = context.codec(MappingAction.class);
    assertThat(actionCodec, notNullValue());
}
Also used : MappingAction(org.onosproject.mapping.actions.MappingAction) NativeForwardMappingAction(org.onosproject.mapping.actions.NativeForwardMappingAction) DropMappingAction(org.onosproject.mapping.actions.DropMappingAction) ForwardMappingAction(org.onosproject.mapping.actions.ForwardMappingAction) NoMappingAction(org.onosproject.mapping.actions.NoMappingAction) MappingCodecRegistrator(org.onosproject.mapping.MappingCodecRegistrator) CodecManager(org.onosproject.codec.impl.CodecManager) Before(org.junit.Before)

Example 25 with CodecManager

use of org.onosproject.codec.impl.CodecManager in project onos by opennetworkinglab.

the class MappingAddressCodecTest method setUp.

/**
 * Sets up for each test.
 * Creates a context and fetches the mapping address codec.
 */
@Before
public void setUp() {
    CodecManager manager = new CodecManager();
    registrator = new MappingCodecRegistrator();
    registrator.codecService = manager;
    registrator.activate();
    context = new MappingCodecContextAdapter(registrator.codecService);
    addressCodec = context.codec(MappingAddress.class);
    assertThat(addressCodec, notNullValue());
}
Also used : MappingAddressJsonMatcher.matchesMappingAddress(org.onosproject.mapping.codec.MappingAddressJsonMatcher.matchesMappingAddress) MappingAddress(org.onosproject.mapping.addresses.MappingAddress) MappingCodecRegistrator(org.onosproject.mapping.MappingCodecRegistrator) CodecManager(org.onosproject.codec.impl.CodecManager) Before(org.junit.Before)

Aggregations

CodecManager (org.onosproject.codec.impl.CodecManager)53 Before (org.junit.Before)48 TestServiceDirectory (org.onlab.osgi.TestServiceDirectory)35 ServiceDirectory (org.onlab.osgi.ServiceDirectory)30 LispMappingExtensionCodecRegistrator (org.onosproject.drivers.lisp.extensions.LispMappingExtensionCodecRegistrator)10 MappingCodecRegistrator (org.onosproject.mapping.MappingCodecRegistrator)7 BeforeClass (org.junit.BeforeClass)5 CodecService (org.onosproject.codec.CodecService)5 BaseConfig (org.onosproject.net.config.BaseConfig)5 DeviceService (org.onosproject.net.device.DeviceService)5 CoreService (org.onosproject.core.CoreService)2 K8sNetworkAdminService (org.onosproject.k8snetworking.api.K8sNetworkAdminService)2 MetricsService (org.onlab.metrics.MetricsService)1 ApplicationAdminService (org.onosproject.app.ApplicationAdminService)1 ClusterService (org.onosproject.cluster.ClusterService)1 ControllerNode (org.onosproject.cluster.ControllerNode)1 NodeId (org.onosproject.cluster.NodeId)1 ControlLoadSnapshotCodec (org.onosproject.cpman.codec.ControlLoadSnapshotCodec)1 LispAppDataAddress (org.onosproject.drivers.lisp.extensions.LispAppDataAddress)1 LispAsAddress (org.onosproject.drivers.lisp.extensions.LispAsAddress)1