use of org.onosproject.cfm.CfmCodecContext in project onos by opennetworkinglab.
the class MepLtCreateCodecTest method setUp.
@Before
public void setUp() throws Exception {
mapper = new ObjectMapper();
context = new CfmCodecContext();
}
use of org.onosproject.cfm.CfmCodecContext 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.onosproject.cfm.CfmCodecContext in project onos by opennetworkinglab.
the class DmWebResourceTest method testCreateDm.
@Test
public void testCreateDm() throws CfmConfigException, SoamConfigException {
MepEntry mep1 = DefaultMepEntry.builder(MEPID1, DeviceId.deviceId("netconf:1.2.3.4:830"), PortNumber.portNumber(1), Mep.MepDirection.UP_MEP, MDNAME1, MANAME1).buildEntry();
expect(mepService.getMep(MDNAME1, MANAME1, MEPID1)).andReturn(mep1).anyTimes();
replay(mepService);
ObjectMapper mapper = new ObjectMapper();
CfmCodecContext context = new CfmCodecContext();
ObjectNode node = mapper.createObjectNode();
node.set("dm", context.codec(DelayMeasurementCreate.class).encode(dm1, context));
final WebTarget wt = target();
final Response response = wt.path("md/" + MDNAME1.mdName() + "/ma/" + MANAME1.maName() + "/mep/" + MEPID1.value() + "/dm").request().post(Entity.json(node.toString()));
assertEquals(201, response.getStatus());
}
use of org.onosproject.cfm.CfmCodecContext in project onos by opennetworkinglab.
the class DmCreateCodecTest method setUp.
@Before
public void setUp() throws Exception {
mapper = new ObjectMapper();
context = new CfmCodecContext();
}
use of org.onosproject.cfm.CfmCodecContext in project onos by opennetworkinglab.
the class DmMeasurementOptionCodecTest method setUp.
@Before
public void setUp() throws Exception {
mapper = new ObjectMapper();
context = new CfmCodecContext();
}
Aggregations