use of org.onosproject.incubator.net.l2monitoring.soam.delay.DelayMeasurementStatCurrent in project onos by opennetworkinglab.
the class SoamManagerTest method testGetDmCurrentStat.
@Test
public void testGetDmCurrentStat() throws CfmConfigException, SoamConfigException {
expect(deviceService.getDevice(DEVICE_ID1)).andReturn(device1).anyTimes();
replay(deviceService);
expect(mepService.getMep(MDNAME1, MANAME1, MEPID1)).andReturn(mep1).anyTimes();
replay(mepService);
expect(driverService.getDriver(DEVICE_ID1)).andReturn(testDriver).anyTimes();
replay(driverService);
DelayMeasurementStatCurrent dmCurrentStat = soamManager.getDmCurrentStat(MDNAME1, MANAME1, MEPID1, DMID101);
assertNotNull(dmCurrentStat);
assertTrue(dmCurrentStat.startTime().isBefore(Instant.now()));
}
use of org.onosproject.incubator.net.l2monitoring.soam.delay.DelayMeasurementStatCurrent 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();
}
Aggregations