use of org.onosproject.codec.impl.CodecManager in project onos by opennetworkinglab.
the class MappingInstructionCodecTest method setUp.
/**
* Sets up for each test.
* Creates a context and fetches the mapping instruction codec.
*/
@Before
public void setUp() {
CodecManager manager = new CodecManager();
registrator = new MappingCodecRegistrator();
registrator.codecService = manager;
registrator.activate();
context = new MappingCodecContextAdapter(registrator.codecService);
instructionCodec = context.codec(MappingInstruction.class);
assertThat(instructionCodec, notNullValue());
}
use of org.onosproject.codec.impl.CodecManager in project onos by opennetworkinglab.
the class MappingKeyCodecTest method setUp.
/**
* Sets up for each test.
* Creates a context and fetches the mapping key codec.
*/
@Before
public void setUp() {
CodecManager manager = new CodecManager();
registrator = new MappingCodecRegistrator();
registrator.codecService = manager;
registrator.activate();
context = new MappingCodecContextAdapter(registrator.codecService);
keyCodec = context.codec(MappingKey.class);
assertThat(keyCodec, notNullValue());
}
use of org.onosproject.codec.impl.CodecManager in project onos by opennetworkinglab.
the class MappingValueCodecTest method setUp.
/**
* Sets up for each test.
* Creates a context and fetches the mapping value codec.
*/
@Before
public void setUp() {
CodecManager manager = new CodecManager();
registrator = new MappingCodecRegistrator();
registrator.codecService = manager;
registrator.activate();
context = new MappingCodecContextAdapter(registrator.codecService);
valueCodec = context.codec(MappingValue.class);
assertThat(valueCodec, notNullValue());
}
use of org.onosproject.codec.impl.CodecManager in project onos by opennetworkinglab.
the class KubevirtNetworkWebResourceTest method setUpTest.
/**
* Sets up the global values for all the tests.
*/
@Before
public void setUpTest() {
final CodecManager codecService = new CodecManager();
codecService.activate();
codecService.registerCodec(KubevirtHostRoute.class, new KubevirtHostRouteCodec());
codecService.registerCodec(KubevirtIpPool.class, new KubevirtIpPoolCodec());
codecService.registerCodec(KubevirtNetwork.class, new KubevirtNetworkCodec());
ServiceDirectory testDirectory = new TestServiceDirectory().add(KubevirtNetworkAdminService.class, mockAdminService).add(CodecService.class, codecService);
setServiceDirectory(testDirectory);
network = DefaultKubevirtNetwork.builder().networkId("network").name("network").type(KubevirtNetwork.Type.FLAT).cidr("10.10.10.0/24").mtu(1500).gatewayIp(IpAddress.valueOf("10.10.10.1")).defaultRoute(true).ipPool(new KubevirtIpPool(IpAddress.valueOf("10.10.10.100"), IpAddress.valueOf("10.10.10.200"))).build();
}
use of org.onosproject.codec.impl.CodecManager in project onos by opennetworkinglab.
the class DeviceAnnotationConfigTest method setUpClass.
// TODO consolidate code-clone in ProtectionConfigTest, and define constants for field name
@BeforeClass
public static void setUpClass() throws TestUtilsException {
directory = new TestServiceDirectory();
CodecManager codecService = new CodecManager();
codecService.activate();
directory.add(CodecService.class, codecService);
// replace service directory used by BaseConfig
original = TestUtils.getField(BaseConfig.class, "services");
TestUtils.setField(BaseConfig.class, "services", directory);
}
Aggregations