use of org.onlab.osgi.TestServiceDirectory in project onos by opennetworkinglab.
the class MaWebResourceTest method setUpTest.
@Before
public void setUpTest() throws CfmConfigException {
CfmCodecContext context = new CfmCodecContext();
ServiceDirectory testDirectory = new TestServiceDirectory().add(CfmMdService.class, mdService).add(CodecService.class, context.codecManager());
setServiceDirectory(testDirectory);
ma1 = DefaultMaintenanceAssociation.builder(MANAME1, MDNAME1.getNameLength()).addToRemoteMepIdList(MepId.valueOf((short) 101)).addToRemoteMepIdList(MepId.valueOf((short) 102)).ccmInterval(MaintenanceAssociation.CcmInterval.INTERVAL_3MS).maNumericId((short) 1).addToComponentList(DefaultComponent.builder(1).tagType(Component.TagType.VLAN_STAG).mhfCreationType(Component.MhfCreationType.NONE).idPermission(Component.IdPermissionType.MANAGE).addToVidList(VlanId.vlanId((short) 1010)).build()).build();
}
use of org.onlab.osgi.TestServiceDirectory in project onos by opennetworkinglab.
the class MdWebResourceTest method setUpTest.
@Before
public void setUpTest() throws CfmConfigException {
CfmCodecContext context = new CfmCodecContext();
ServiceDirectory testDirectory = new TestServiceDirectory().add(CfmMdService.class, mdService).add(CodecService.class, context.codecManager());
setServiceDirectory(testDirectory);
mdList = new ArrayList<>();
mdList.add(DefaultMaintenanceDomain.builder(MDNAME1).mdLevel(MaintenanceDomain.MdLevel.LEVEL1).build());
mdList.add(DefaultMaintenanceDomain.builder(MDNAME2).mdLevel(MaintenanceDomain.MdLevel.LEVEL2).build());
}
use of org.onlab.osgi.TestServiceDirectory in project onos by opennetworkinglab.
the class MepWebResourceTest method setUpTest.
@Before
public void setUpTest() throws CfmConfigException {
CfmCodecContext context = new CfmCodecContext();
ServiceDirectory testDirectory = new TestServiceDirectory().add(CfmMepService.class, mepService).add(CfmMdService.class, mdService).add(CodecService.class, context.codecManager());
setServiceDirectory(testDirectory);
mepEntry1 = DefaultMepEntry.builder(MEPID1, DeviceId.deviceId("netconf:1.2.3.4:830"), PortNumber.portNumber(1), Mep.MepDirection.UP_MEP, MDNAME1, MANAME1).buildEntry();
}
use of org.onlab.osgi.TestServiceDirectory in project onos by opennetworkinglab.
the class ControlMetricsCollectorResourceTest method setUpTest.
/**
* Sets up the global values for all the tests.
*/
@Before
public void setUpTest() {
ServiceDirectory testDirectory = new TestServiceDirectory().add(ControlPlaneMonitorService.class, mockControlPlaneMonitorService).add(MetricsService.class, mockMetricsService);
setServiceDirectory(testDirectory);
}
use of org.onlab.osgi.TestServiceDirectory in project onos by opennetworkinglab.
the class K8sNetworkWebResourceTest method setUpTest.
/**
* Sets up the global values for all the tests.
*/
@Before
public void setUpTest() {
final CodecManager codecService = new CodecManager();
codecService.activate();
codecService.registerCodec(K8sNetwork.class, new K8sNetworkCodec());
ServiceDirectory testDirectory = new TestServiceDirectory().add(K8sNetworkAdminService.class, mockAdminService).add(CodecService.class, codecService);
setServiceDirectory(testDirectory);
k8sNetwork = DefaultK8sNetwork.builder().networkId("sona-network").name("sona-network").type(K8sNetwork.Type.VXLAN).segmentId("1").cidr("10.10.0.0/24").mtu(1500).build();
}
Aggregations