Search in sources :

Example 1 with P4InfoParserException

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();
}
Also used : URL(java.net.URL) P4InfoParserException(org.onosproject.p4runtime.model.P4InfoParserException) PiPipelineModel(org.onosproject.net.pi.model.PiPipelineModel)

Aggregations

URL (java.net.URL)1 PiPipelineModel (org.onosproject.net.pi.model.PiPipelineModel)1 P4InfoParserException (org.onosproject.p4runtime.model.P4InfoParserException)1