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);
}
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();
}
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();
}
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());
}
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());
}
Aggregations