use of org.onlab.osgi.ServiceDirectory in project onos by opennetworkinglab.
the class DmWebResourceTest method setUpTest.
@Before
public void setUpTest() throws CfmConfigException, SoamConfigException {
CfmCodecContext context = new CfmCodecContext();
ServiceDirectory testDirectory = new TestServiceDirectory().add(CfmMepService.class, mepService).add(SoamService.class, soamService).add(CodecService.class, context.codecManager());
setServiceDirectory(testDirectory);
DelayMeasurementStatCurrent.DmStatCurrentBuilder dmCurrBuilder1 = (DelayMeasurementStatCurrent.DmStatCurrentBuilder) DefaultDelayMeasurementStatCurrent.builder(Duration.ofMinutes(1), false).startTime(now).frameDelayBackwardAvg(Duration.ofMillis(10)).frameDelayForwardAvg(Duration.ofMillis(11)).frameDelayRangeBackwardAvg(Duration.ofMillis(12));
dm1 = DefaultDelayMeasurementEntry.builder(DM1, DelayMeasurementCreate.DmType.DMDMM, DelayMeasurementCreate.Version.Y17312008, MepId.valueOf((short) 2), Mep.Priority.PRIO1).sessionStatus(DelayMeasurementEntry.SessionStatus.ACTIVE).frameDelayTwoWay(Duration.ofMillis(40)).frameDelayBackward(Duration.ofMillis(30)).frameDelayForward(Duration.ofMillis(10)).interFrameDelayVariationTwoWay(Duration.ofMillis(8)).interFrameDelayVariationBackward(Duration.ofMillis(3)).interFrameDelayVariationForward(Duration.ofMillis(5)).currentResult((DelayMeasurementStatCurrent) dmCurrBuilder1.build()).build();
dm2 = DefaultDelayMeasurementEntry.builder(DM2, DelayMeasurementCreate.DmType.DMDMM, DelayMeasurementCreate.Version.Y17312011, MepId.valueOf((short) 2), Mep.Priority.PRIO2).build();
}
use of org.onlab.osgi.ServiceDirectory 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.ServiceDirectory in project onos by opennetworkinglab.
the class LmWebResourceTest method setUpTest.
@Before
public void setUpTest() throws CfmConfigException, SoamConfigException {
CfmCodecContext context = new CfmCodecContext();
ServiceDirectory testDirectory = new TestServiceDirectory().add(CfmMepService.class, mepService).add(SoamService.class, soamService).add(CodecService.class, context.codecManager());
setServiceDirectory(testDirectory);
lm1 = DefaultLmEntry.builder(DelayMeasurementCreate.Version.Y17312008, MepId.valueOf((short) 10), Mep.Priority.PRIO1, LossMeasurementCreate.LmType.LMLMM, LMID1).build();
lm2 = DefaultLmEntry.builder(DelayMeasurementCreate.Version.Y17312011, MepId.valueOf((short) 10), Mep.Priority.PRIO2, LossMeasurementCreate.LmType.LMLMM, LMID2).measuredAvailabilityBackwardStatus(LossMeasurementEntry.AvailabilityType.AVAILABLE).measuredAvailabilityForwardStatus(LossMeasurementEntry.AvailabilityType.UNKNOWN).measuredBackwardFlr(MilliPct.ofPercent(49.9f)).measuredForwardFlr(MilliPct.ofRatio(0.51f)).measuredBackwardLastTransitionTime(now).measuredForwardLastTransitionTime(now).build();
}
use of org.onlab.osgi.ServiceDirectory 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.ServiceDirectory in project onos by opennetworkinglab.
the class K8sNodeWebResourceTest method setUpTest.
/**
* Sets up the global values for all the tests.
*/
@Before
public void setUpTest() {
final CodecManager codecService = new CodecManager();
codecService.activate();
codecService.registerCodec(K8sNode.class, new K8sNodeCodec());
codecService.registerCodec(K8sApiConfig.class, new K8sApiConfigCodec());
codecService.registerCodec(HostNodesInfo.class, new HostNodesInfoCodec());
ServiceDirectory testDirectory = new TestServiceDirectory().add(K8sNodeAdminService.class, mockK8sNodeAdminService).add(K8sApiConfigAdminService.class, mockK8sApiConfigAdminService).add(CodecService.class, codecService);
setServiceDirectory(testDirectory);
k8sNode = DefaultK8sNode.builder().clusterName("kubernetes").hostname("minion-node").type(K8sNode.Type.MINION).dataIp(IpAddress.valueOf("10.134.34.222")).managementIp(IpAddress.valueOf("10.134.231.30")).nodeInfo(new K8sNodeInfo(IpAddress.valueOf("30.30.30.3"), null)).intgBridge(DeviceId.deviceId("of:00000000000000a1")).extBridge(DeviceId.deviceId("of:00000000000000b1")).state(K8sNodeState.INIT).build();
k8sApiConfig = DefaultK8sApiConfig.builder().clusterName("kubernetes").segmentId(1).mode(K8sApiConfig.Mode.NORMAL).scheme(K8sApiConfig.Scheme.HTTPS).ipAddress(IpAddress.valueOf("10.134.34.223")).port(6443).state(DISCONNECTED).token("tokenMod").caCertData("caCertData").clientCertData("clientCertData").clientKeyData("clientKeyData").build();
}
Aggregations