use of org.onlab.osgi.TestServiceDirectory in project onos by opennetworkinglab.
the class MappingsWebResourceTest method setUpTest.
/**
* Sets up the global values for all the tests.
*/
@Before
public void setUpTest() {
// Register the services needed for the test
final CodecManager codecService = new CodecManager();
codecService.activate();
codecService.registerCodec(MappingEntry.class, new MappingEntryCodec());
codecService.registerCodec(MappingAddress.class, new MappingAddressCodec());
codecService.registerCodec(MappingInstruction.class, new MappingInstructionCodec());
codecService.registerCodec(MappingAction.class, new MappingActionCodec());
codecService.registerCodec(MappingTreatment.class, new MappingTreatmentCodec());
codecService.registerCodec(MappingKey.class, new MappingKeyCodec());
codecService.registerCodec(MappingValue.class, new MappingValueCodec());
ServiceDirectory testDirectory = new TestServiceDirectory().add(MappingService.class, mockMappingService).add(DeviceService.class, mockDeviceService).add(CodecService.class, codecService);
setServiceDirectory(testDirectory);
}
use of org.onlab.osgi.TestServiceDirectory in project onos by opennetworkinglab.
the class OpenstackManagementWebResourceTest method setUpTest.
/**
* Sets up the global values for all tests.
*/
@Before
public void setUpTest() {
ServiceDirectory testDirectory = new TestServiceDirectory().add(OpenstackRouterAdminService.class, mockOpenstackRouterAdminService).add(OpenstackSecurityGroupAdminService.class, mockOpenstackSecurityGroupAdminService).add(OpenstackNetworkAdminService.class, mockOpenstackNetworkAdminService).add(OpenstackNodeAdminService.class, mockOpenstackNodeAdminService);
setServiceDirectory(testDirectory);
}
use of org.onlab.osgi.TestServiceDirectory in project onos by opennetworkinglab.
the class OpenstackRouterWebResourceTest method setUpTest.
/**
* Sets up the global values for all tests.
*/
@Before
public void setUpTest() {
ServiceDirectory testDirectory = new TestServiceDirectory().add(OpenstackRouterAdminService.class, mockOpenstackRouterAdminService).add(OpenstackHaService.class, mockOpenstackHaService);
setServiceDirectory(testDirectory);
}
use of org.onlab.osgi.TestServiceDirectory 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.onlab.osgi.TestServiceDirectory 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();
}
Aggregations