Search in sources :

Example 1 with DelayMeasurementStatCurrent

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()));
}
Also used : DelayMeasurementStatCurrent(org.onosproject.incubator.net.l2monitoring.soam.delay.DelayMeasurementStatCurrent) Test(org.junit.Test)

Example 2 with DelayMeasurementStatCurrent

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();
}
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)

Aggregations

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