Search in sources :

Example 1 with SoamService

use of org.onosproject.incubator.net.l2monitoring.soam.SoamService 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();
}
Also used : CfmCodecContext(org.onosproject.cfm.CfmCodecContext) SoamService(org.onosproject.incubator.net.l2monitoring.soam.SoamService) ServiceDirectory(org.onlab.osgi.ServiceDirectory) TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) DefaultDelayMeasurementStatCurrent(org.onosproject.incubator.net.l2monitoring.soam.delay.DefaultDelayMeasurementStatCurrent) DelayMeasurementStatCurrent(org.onosproject.incubator.net.l2monitoring.soam.delay.DelayMeasurementStatCurrent) TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) Before(org.junit.Before)

Example 2 with SoamService

use of org.onosproject.incubator.net.l2monitoring.soam.SoamService 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();
}
Also used : CfmCodecContext(org.onosproject.cfm.CfmCodecContext) SoamService(org.onosproject.incubator.net.l2monitoring.soam.SoamService) ServiceDirectory(org.onlab.osgi.ServiceDirectory) TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)2 ServiceDirectory (org.onlab.osgi.ServiceDirectory)2 TestServiceDirectory (org.onlab.osgi.TestServiceDirectory)2 CfmCodecContext (org.onosproject.cfm.CfmCodecContext)2 SoamService (org.onosproject.incubator.net.l2monitoring.soam.SoamService)2 DefaultDelayMeasurementStatCurrent (org.onosproject.incubator.net.l2monitoring.soam.delay.DefaultDelayMeasurementStatCurrent)1 DelayMeasurementStatCurrent (org.onosproject.incubator.net.l2monitoring.soam.delay.DelayMeasurementStatCurrent)1