Search in sources :

Example 1 with DefaultDmCreateBuilder

use of org.onosproject.incubator.net.l2monitoring.soam.delay.DefaultDelayMeasurementCreate.DefaultDmCreateBuilder in project onos by opennetworkinglab.

the class DelayMeasurementCreateTest method setUp.

@Before
public void setUp() throws Exception, CfmConfigException, SoamConfigException {
    DelayMeasurementThreshold dmT1 = DefaultDelayMeasurementThreshold.builder(SoamId.valueOf(1)).averageFrameDelayBackward(Duration.ofMillis(123)).averageInterFrameDelayVariationForward(Duration.ofMillis(321)).build();
    DelayMeasurementThreshold dmT2 = DefaultDelayMeasurementThreshold.builder(SoamId.valueOf(2)).averageFrameDelayBackward(Duration.ofMillis(456)).averageInterFrameDelayVariationForward(Duration.ofMillis(654)).build();
    try {
        DefaultDmCreateBuilder builder = (DefaultDmCreateBuilder) DefaultDelayMeasurementCreate.builder(DmType.DMDMM, Version.Y17312011, MepId.valueOf((short) 12), Priority.PRIO6).addToMeasurementsEnabled(MeasurementOption.FRAME_DELAY_FORWARD_MIN).addToMeasurementsEnabled(MeasurementOption.FRAME_DELAY_FORWARD_AVERAGE).addToMeasurementsEnabled(MeasurementOption.FRAME_DELAY_FORWARD_MAX).addToMeasurementsEnabled(MeasurementOption.FRAME_DELAY_FORWARD_BINS).binsPerFdInterval((short) 8).binsPerIfdvInterval((short) 9).ifdvSelectionOffset((short) 10).binsPerFdrInterval((short) 12).addToThresholds(dmT1).addToThresholds(dmT2).messagePeriod(Duration.ofMillis(100L)).frameSize((short) 64).dataPattern(DataPattern.ONES).testTlvIncluded(true).testTlvPattern(TestTlvPattern.NULL_SIGNAL_WITHOUT_CRC_32).measurementInterval(Duration.ofMinutes(15)).numberIntervalsStored((short) 32).alignMeasurementIntervals(true).alignMeasurementOffset(Duration.ofMinutes(4)).sessionType(SessionType.ONDEMAND).startTime(StartTime.relative(Duration.ofMinutes(7))).stopTime(StopTime.relative(Duration.ofMinutes(8)));
        dm1 = builder.build();
    } catch (SoamConfigException e) {
        throw new Exception(e);
    }
}
Also used : SoamConfigException(org.onosproject.incubator.net.l2monitoring.soam.SoamConfigException) DefaultDmCreateBuilder(org.onosproject.incubator.net.l2monitoring.soam.delay.DefaultDelayMeasurementCreate.DefaultDmCreateBuilder) SoamConfigException(org.onosproject.incubator.net.l2monitoring.soam.SoamConfigException) CfmConfigException(org.onosproject.incubator.net.l2monitoring.cfm.service.CfmConfigException) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)1 CfmConfigException (org.onosproject.incubator.net.l2monitoring.cfm.service.CfmConfigException)1 SoamConfigException (org.onosproject.incubator.net.l2monitoring.soam.SoamConfigException)1 DefaultDmCreateBuilder (org.onosproject.incubator.net.l2monitoring.soam.delay.DefaultDelayMeasurementCreate.DefaultDmCreateBuilder)1