X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-binding-dom-it%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fbinding%2Ftest%2Fconnect%2Fdom%2FMessageCapturingFlowService.java;fp=opendaylight%2Fmd-sal%2Fsal-binding-dom-it%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fbinding%2Ftest%2Fconnect%2Fdom%2FMessageCapturingFlowService.java;h=0000000000000000000000000000000000000000;hb=2611e6a728e586ea34dd891f30a473bf54d6cbd8;hp=bc521d1254fd4020b75986d336a2bc8346c084ec;hpb=aaea3e9a92ae9d6fac04c4a065db4b35cbca9ed0;p=controller.git 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 deleted file mode 100644 index bc521d1254..0000000000 --- a/opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/connect/dom/MessageCapturingFlowService.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ -package org.opendaylight.controller.sal.binding.test.connect.dom; - -import static org.junit.Assert.assertNotNull; - -import com.google.common.collect.HashMultimap; -import com.google.common.collect.Multimap; -import com.google.common.util.concurrent.ListenableFuture; -import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration; -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; - -public class MessageCapturingFlowService implements OpendaylightOfMigrationTestModelService, AutoCloseable { - - private ListenableFuture> knockKnockResult; - - private final Multimap, KnockKnockInput> receivedKnocks = HashMultimap.create(); - private RoutedRpcRegistration registration; - - public ListenableFuture> getKnockKnockResult() { - return knockKnockResult; - } - - public MessageCapturingFlowService setKnockKnockResult( - final ListenableFuture> kkOutput) { - this.knockKnockResult = kkOutput; - return this; - } - - public Multimap, KnockKnockInput> getReceivedKnocks() { - return receivedKnocks; - } - - public MessageCapturingFlowService registerTo(final RpcProviderRegistry registry) { - registration = registry.addRoutedRpcImplementation(OpendaylightOfMigrationTestModelService.class, this); - assertNotNull(registration); - return this; - } - - @Override - public void close() { - registration.close(); - } - - public MessageCapturingFlowService registerPath(final Class context, - final InstanceIdentifier path) { - registration.registerPath(context, path); - return this; - } - - public MessageCapturingFlowService unregisterPath(final Class context, - final InstanceIdentifier path) { - registration.unregisterPath(context, path); - return this; - } - - public static MessageCapturingFlowService create() { - return new MessageCapturingFlowService(); - } - - public static MessageCapturingFlowService create(final RpcProviderRegistry registry) { - MessageCapturingFlowService ret = new MessageCapturingFlowService(); - ret.registerTo(registry); - return ret; - } - - @Override - public ListenableFuture> knockKnock(final KnockKnockInput input) { - receivedKnocks.put(input.getKnockerId(), input); - return knockKnockResult; - } -}