Search in sources :

Example 6 with OFErrorMsg

use of org.projectfloodlight.openflow.protocol.OFErrorMsg in project open-kilda by telstra.

the class MeterInstallCommandTest method notConflictError.

@Test
public void notConflictError() throws Throwable {
    switchFeaturesSetup(sw, true);
    replayAll();
    CompletableFuture<MeterInstallReport> result = command.execute(commandProcessor);
    SessionWriteRecord write0 = getWriteRecord(0);
    OFErrorMsg error = sw.getOFFactory().errorMsgs().buildBadRequestErrorMsg().setCode(OFBadRequestCode.BAD_LEN).build();
    write0.getFuture().completeExceptionally(new SessionErrorResponseException(sw.getId(), error));
    verifyErrorCompletion(result, SwitchErrorResponseException.class);
}
Also used : OFErrorMsg(org.projectfloodlight.openflow.protocol.OFErrorMsg) SessionErrorResponseException(org.openkilda.floodlight.error.SessionErrorResponseException) Test(org.junit.Test) AbstractSpeakerCommandTest(org.openkilda.floodlight.command.AbstractSpeakerCommandTest)

Example 7 with OFErrorMsg

use of org.projectfloodlight.openflow.protocol.OFErrorMsg in project open-kilda by telstra.

the class MeterInstallCommandTest method processConflictError.

private CompletableFuture<MeterInstallReport> processConflictError() {
    CompletableFuture<MeterInstallReport> result = command.execute(commandProcessor);
    SessionWriteRecord write0 = getWriteRecord(0);
    OFErrorMsg error = sw.getOFFactory().errorMsgs().buildMeterModFailedErrorMsg().setCode(OFMeterModFailedCode.METER_EXISTS).build();
    write0.getFuture().completeExceptionally(new SessionErrorResponseException(sw.getId(), error));
    return result;
}
Also used : OFErrorMsg(org.projectfloodlight.openflow.protocol.OFErrorMsg) SessionErrorResponseException(org.openkilda.floodlight.error.SessionErrorResponseException)

Aggregations

OFErrorMsg (org.projectfloodlight.openflow.protocol.OFErrorMsg)7 Optional (java.util.Optional)5 CompletableFuture (java.util.concurrent.CompletableFuture)4 SessionErrorResponseException (org.openkilda.floodlight.error.SessionErrorResponseException)4 Session (org.openkilda.floodlight.service.session.Session)3 MessageContext (org.openkilda.messaging.MessageContext)3 SwitchId (org.openkilda.model.SwitchId)3 OFMessage (org.projectfloodlight.openflow.protocol.OFMessage)3 Getter (lombok.Getter)2 IOfErrorResponseHandler (org.openkilda.floodlight.command.IOfErrorResponseHandler)2 SpeakerCommandProcessor (org.openkilda.floodlight.command.SpeakerCommandProcessor)2 SwitchErrorResponseException (org.openkilda.floodlight.error.SwitchErrorResponseException)2 UnsupportedSwitchOperationException (org.openkilda.floodlight.error.UnsupportedSwitchOperationException)2 Joiner (com.google.common.base.Joiner)1 String.format (java.lang.String.format)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Map (java.util.Map)1 Set (java.util.Set)1 UUID (java.util.UUID)1