From: Ed Warnicke Date: Sun, 17 Nov 2013 01:44:47 +0000 (-0600) Subject: Fixed breakage from changes in openflowjava (which were my fault :( ). X-Git-Tag: jenkins-openflowplugin-bulk-release-prepare-only-4~170 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F96%2F2796%2F1;p=openflowplugin.git Fixed breakage from changes in openflowjava (which were my fault :( ). Change-Id: Idc8a3c5acd9ba2bd40115db5308eaf28428d12f6 Signed-off-by: Ed Warnicke --- diff --git a/openflowplugin/src/test/java/org/opendaylight/openflowplugin/openflow/md/core/plan/ConnectionAdapterStackImpl.java b/openflowplugin/src/test/java/org/opendaylight/openflowplugin/openflow/md/core/plan/ConnectionAdapterStackImpl.java index 476eab7417..082d2b9d0f 100644 --- a/openflowplugin/src/test/java/org/opendaylight/openflowplugin/openflow/md/core/plan/ConnectionAdapterStackImpl.java +++ b/openflowplugin/src/test/java/org/opendaylight/openflowplugin/openflow/md/core/plan/ConnectionAdapterStackImpl.java @@ -55,6 +55,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortStatusMessage; import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.RoleRequestInput; import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.RoleRequestOutput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SendMultipartRequestMessageInput; import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SetAsyncInput; import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SetConfigInput; import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.TableModInput; @@ -96,7 +97,7 @@ public class ConnectionAdapterStackImpl implements ConnectionAdapter, Runnable { protected List occuredExceptions = new ArrayList<>(); private ConnectionReadyListener connectionReadyListener; - + private int planItemCounter; /** @@ -277,13 +278,13 @@ public class ConnectionAdapterStackImpl implements ConnectionAdapter, Runnable { private boolean checkRpc(OfHeader rpcInput, String rpcName) { String msg = null; boolean finished = true; - + if (eventPlan.isEmpty()) { throw new IllegalStateException("eventPlan already depleted"); } - + LOG.debug("checking rpc: name={}, ver={}, xid={}", rpcName, rpcInput.getVersion(), rpcInput.getXid()); - if (!(eventPlan.peek() instanceof SwitchTestWaitForRpcEvent) + if (!(eventPlan.peek() instanceof SwitchTestWaitForRpcEvent) && !(eventPlan.peek() instanceof SwitchTestWaitForAllEvent)) { if (eventPlan.peek() instanceof SwitchTestNotificationEvent) { SwitchTestNotificationEvent notifEvent = (SwitchTestNotificationEvent) (eventPlan.peek()); @@ -300,14 +301,14 @@ public class ConnectionAdapterStackImpl implements ConnectionAdapter, Runnable { .peek(); Set eventBag = switchTestWaitForAll.getWaitEventBag(); List msgLot = new ArrayList<>(); - + if (eventBag == null || eventBag.isEmpty()) { msg = "no wait events in bag"; } else { finished = false; for (SwitchTestWaitForRpcEvent switchTestWaitForRpc : eventBag) { - String msgPart = checkSingleRpcContent(rpcInput, rpcName, switchTestWaitForRpc); - + String msgPart = checkSingleRpcContent(rpcInput, rpcName, switchTestWaitForRpc); + if (msgPart != null) { msgLot.add(msgPart); } else { @@ -321,14 +322,14 @@ public class ConnectionAdapterStackImpl implements ConnectionAdapter, Runnable { } } } - + if (!msgLot.isEmpty()) { msg = Joiner.on(" | ").join(msgLot); } } else if (eventPlan.peek() instanceof SwitchTestWaitForRpcEvent) { SwitchTestWaitForRpcEvent switchTestRpcEvent = (SwitchTestWaitForRpcEvent) eventPlan .peek(); - msg = checkSingleRpcContent(rpcInput, rpcName, switchTestRpcEvent); + msg = checkSingleRpcContent(rpcInput, rpcName, switchTestRpcEvent); } } @@ -346,7 +347,7 @@ public class ConnectionAdapterStackImpl implements ConnectionAdapter, Runnable { * @param rpcName * @param msgTmp * @param switchTestWaitForRpc - * @return + * @return */ private static String checkSingleRpcContent(OfHeader rpcInput, String rpcName, SwitchTestWaitForRpcEvent switchTestWaitForRpc) { @@ -357,11 +358,11 @@ public class ConnectionAdapterStackImpl implements ConnectionAdapter, Runnable { } else if (!rpcInput.getXid().equals(switchTestWaitForRpc.getXid())) { failureMsg = "expected "+rpcName+".xid [" + switchTestWaitForRpc.getXid() + "], got [" + rpcInput.getXid() + "]"; - } - + } + return failureMsg; } - + /** * @param rpcInput * rpc call parameter @@ -607,4 +608,12 @@ public class ConnectionAdapterStackImpl implements ConnectionAdapter, Runnable { ConnectionReadyListener connectionReadyListener) { this.connectionReadyListener = connectionReadyListener; } + + @Override + public Future> sendMultipartRequestMessage( + SendMultipartRequestMessageInput arg0) { + checkRpcAndNext(arg0, "sendMultipartRequestMessage"); + SettableFuture> result = createOneWayRpcResult(); + return result; + } } diff --git a/openflowplugin/src/test/java/org/opendaylight/openflowplugin/openflow/md/core/session/MessageDispatchServiceImplTest.java b/openflowplugin/src/test/java/org/opendaylight/openflowplugin/openflow/md/core/session/MessageDispatchServiceImplTest.java index 25e4c2f6cc..80aaf253e8 100644 --- a/openflowplugin/src/test/java/org/opendaylight/openflowplugin/openflow/md/core/session/MessageDispatchServiceImplTest.java +++ b/openflowplugin/src/test/java/org/opendaylight/openflowplugin/openflow/md/core/session/MessageDispatchServiceImplTest.java @@ -46,6 +46,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortStatus; import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.RoleRequestInput; import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.RoleRequestOutput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SendMultipartRequestMessageInput; import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SetAsyncInput; import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SetConfigInput; import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.TableModInput; @@ -555,4 +556,11 @@ class MockConnectionAdapter implements ConnectionAdapter { this.connectionReadyListener = connectionReadyListener; } + @Override + public Future> sendMultipartRequestMessage( + SendMultipartRequestMessageInput input) { + // TODO Auto-generated method stub + return null; + } + }