2 * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.netconf.topology.pipeline;
11 import static org.junit.Assert.assertTrue;
12 import static org.mockito.Mockito.mock;
14 import akka.actor.ActorSystem;
15 import java.net.InetSocketAddress;
16 import org.junit.Before;
17 import org.junit.Test;
18 import org.mockito.Mock;
19 import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker;
20 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
21 import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener;
22 import org.opendaylight.controller.md.sal.dom.api.DOMDataChangeListener;
23 import org.opendaylight.netconf.sal.connect.util.RemoteDeviceId;
24 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
26 public class NetconfDeviceSlaveDataBrokerTest {
28 private static final RemoteDeviceId REMOTE_DEVICE_ID = new RemoteDeviceId("testing-device", new InetSocketAddress(9999));
31 private ProxyNetconfDeviceDataBroker mockedDataBroker;
34 private ActorSystem mockedActorSystem;
36 private NetconfDeviceSlaveDataBroker slaveDataBroker;
40 slaveDataBroker = new NetconfDeviceSlaveDataBroker(mockedActorSystem, REMOTE_DEVICE_ID, mockedDataBroker);
43 @Test(expected = UnsupportedOperationException.class)
44 public void testRegisterDataChangeListener() {
45 slaveDataBroker.registerDataChangeListener(LogicalDatastoreType.CONFIGURATION, YangInstanceIdentifier.EMPTY,
46 mock(DOMDataChangeListener.class), AsyncDataBroker.DataChangeScope.SUBTREE);
49 @Test(expected = UnsupportedOperationException.class)
50 public void testCreateTransactionChain() {
51 slaveDataBroker.createTransactionChain(mock(TransactionChainListener.class));
55 public void testGetSupportedExtensions() {
56 assertTrue(slaveDataBroker.getSupportedExtensions().isEmpty());