use of org.onosproject.p4runtime.model.P4InfoParserException in project onos by opennetworkinglab.
the class PiGroupTranslatorImplTest method loadP4InfoPipeconf.
private static PiPipeconf loadP4InfoPipeconf(PiPipeconfId pipeconfId, String p4infoPath) {
final URL p4InfoUrl = PiGroupTranslatorImpl.class.getResource(p4infoPath);
final PiPipelineModel pipelineModel;
try {
pipelineModel = P4InfoParser.parse(p4InfoUrl);
} catch (P4InfoParserException e) {
throw new IllegalStateException(e);
}
return DefaultPiPipeconf.builder().withId(pipeconfId).withPipelineModel(pipelineModel).addExtension(P4_INFO_TEXT, p4InfoUrl).build();
}
Aggregations