X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-binding-dom-it%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fbinding%2Ftest%2Fconnect%2Fdom%2FMessageCapturingFlowService.java;h=0f9389703ff5b587a1068a2428ca5d1732907f2c;hp=df287791ef01fa53e14c79320c75662e3fb60349;hb=4f82c49691f091f0ba6b09a07525edb246f17321;hpb=83e1c610eeefba667a19c243fbc1098072a8079d diff --git a/opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/connect/dom/MessageCapturingFlowService.java b/opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/connect/dom/MessageCapturingFlowService.java index df287791ef..0f9389703f 100644 --- a/opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/connect/dom/MessageCapturingFlowService.java +++ b/opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/connect/dom/MessageCapturingFlowService.java @@ -7,19 +7,15 @@ */ package org.opendaylight.controller.sal.binding.test.connect.dom; -import static junit.framework.Assert.assertNotNull; +import static org.junit.Assert.assertNotNull; import java.util.concurrent.Future; -import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration; -import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowOutput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowOutput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService; -import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowInput; -import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowOutput; +import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.KnockKnockInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.KnockKnockOutput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.OpendaylightOfMigrationTestModelService; import org.opendaylight.yangtools.yang.binding.BaseIdentity; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.opendaylight.yangtools.yang.common.RpcResult; @@ -27,76 +23,28 @@ import org.opendaylight.yangtools.yang.common.RpcResult; import com.google.common.collect.HashMultimap; import com.google.common.collect.Multimap; -public class MessageCapturingFlowService implements SalFlowService, AutoCloseable { - - private Future> addFlowResult; - private Future> removeFlowResult; - private Future> updateFlowResult; - - private final Multimap, AddFlowInput> receivedAddFlows = HashMultimap.create(); - private final Multimap, RemoveFlowInput> receivedRemoveFlows = HashMultimap.create(); - private final Multimap, UpdateFlowInput> receivedUpdateFlows = HashMultimap.create(); - private RoutedRpcRegistration registration; - - @Override - public Future> addFlow(AddFlowInput arg0) { - receivedAddFlows.put(arg0.getNode().getValue(), arg0); - return addFlowResult; - } - - @Override - public Future> removeFlow(RemoveFlowInput arg0) { - receivedRemoveFlows.put(arg0.getNode().getValue(), arg0); - return removeFlowResult; - } - - @Override - public Future> updateFlow(UpdateFlowInput arg0) { - receivedUpdateFlows.put(arg0.getNode().getValue(), arg0); - return updateFlowResult; - } - - public Future> getAddFlowResult() { - return addFlowResult; - } +public class MessageCapturingFlowService implements OpendaylightOfMigrationTestModelService, AutoCloseable { - public MessageCapturingFlowService setAddFlowResult(Future> addFlowResult) { - this.addFlowResult = addFlowResult; - return this; - } + private Future> knockKnockResult; - public Future> getRemoveFlowResult() { - return removeFlowResult; - } - - public MessageCapturingFlowService setRemoveFlowResult(Future> removeFlowResult) { - this.removeFlowResult = removeFlowResult; - return this; - } + private final Multimap, KnockKnockInput> receivedKnocks = HashMultimap.create(); + private RoutedRpcRegistration registration; - public Future> getUpdateFlowResult() { - return updateFlowResult; + public Future> getKnockKnockResult() { + return knockKnockResult; } - public MessageCapturingFlowService setUpdateFlowResult(Future> updateFlowResult) { - this.updateFlowResult = updateFlowResult; + public MessageCapturingFlowService setKnockKnockResult(Future> kkOutput) { + this.knockKnockResult = kkOutput; return this; } - public Multimap, AddFlowInput> getReceivedAddFlows() { - return receivedAddFlows; - } - - public Multimap, RemoveFlowInput> getReceivedRemoveFlows() { - return receivedRemoveFlows; - } - - public Multimap, UpdateFlowInput> getReceivedUpdateFlows() { - return receivedUpdateFlows; + public Multimap, KnockKnockInput> getReceivedKnocks() { + return receivedKnocks; } public MessageCapturingFlowService registerTo(RpcProviderRegistry registry) { - registration = registry.addRoutedRpcImplementation(SalFlowService.class, this); + registration = registry.addRoutedRpcImplementation(OpendaylightOfMigrationTestModelService.class, this); assertNotNull(registration); return this; } @@ -125,5 +73,11 @@ public class MessageCapturingFlowService implements SalFlowService, AutoCloseabl return ret; } + @Override + public Future> knockKnock(KnockKnockInput input) { + receivedKnocks.put(input.getKnockerId(), input); + return knockKnockResult; + } + }