Search in sources :

Example 1 with ConcurrentDataBrokerTestCustomizer

use of org.opendaylight.mdsal.binding.dom.adapter.test.ConcurrentDataBrokerTestCustomizer in project bgpcep by opendaylight.

the class StateProviderImplTest method createDataBrokerTestCustomizer.

@Override
protected AbstractDataBrokerTestCustomizer createDataBrokerTestCustomizer() {
    return new ConcurrentDataBrokerTestCustomizer(true) {

        @Override
        public DOMStore createOperationalDatastore() {
            realOperStore = new InMemoryDOMDataStore("OPER", getDataTreeChangeListenerExecutor());
            spiedOperStore = spy(realOperStore);
            getSchemaService().registerSchemaContextListener(spiedOperStore);
            return spiedOperStore;
        }

        @Override
        public ListeningExecutorService getCommitCoordinatorExecutor() {
            return MoreExecutors.newDirectExecutorService();
        }
    };
}
Also used : ConcurrentDataBrokerTestCustomizer(org.opendaylight.mdsal.binding.dom.adapter.test.ConcurrentDataBrokerTestCustomizer) InMemoryDOMDataStore(org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStore)

Example 2 with ConcurrentDataBrokerTestCustomizer

use of org.opendaylight.mdsal.binding.dom.adapter.test.ConcurrentDataBrokerTestCustomizer in project netconf by opendaylight.

the class NetconfCommandsImplTest method setUp.

@Before
public void setUp() throws Exception {
    ConcurrentDataBrokerTestCustomizer customizer = new ConcurrentDataBrokerTestCustomizer(true);
    dataBroker = customizer.createDataBroker();
    customizer.updateSchema(RUNTIME_CONTEXT);
    netconfCommands = new NetconfCommandsImpl(dataBroker);
}
Also used : ConcurrentDataBrokerTestCustomizer(org.opendaylight.mdsal.binding.dom.adapter.test.ConcurrentDataBrokerTestCustomizer) Before(org.junit.Before)

Example 3 with ConcurrentDataBrokerTestCustomizer

use of org.opendaylight.mdsal.binding.dom.adapter.test.ConcurrentDataBrokerTestCustomizer in project netconf by opendaylight.

the class NetconfDeviceTopologyAdapterTest method setUp.

@Before
public void setUp() throws Exception {
    doReturn(writeTx).when(txChain).newWriteOnlyTransaction();
    doNothing().when(writeTx).put(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(Node.class));
    doNothing().when(writeTx).merge(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(NetworkTopology.class));
    doReturn(txIdent).when(writeTx).getIdentifier();
    ConcurrentDataBrokerTestCustomizer customizer = new ConcurrentDataBrokerTestCustomizer(true);
    domDataBroker = customizer.getDOMDataBroker();
    dataBroker = customizer.createDataBroker();
    customizer.updateSchema(RUNTIME_CONTEXT);
    transactionChain = dataBroker.createTransactionChain(new TransactionChainListener() {

        @Override
        public void onTransactionChainFailed(final TransactionChain chain, final Transaction transaction, final Throwable cause) {
        }

        @Override
        public void onTransactionChainSuccessful(final TransactionChain chain) {
        }
    });
}
Also used : ConcurrentDataBrokerTestCustomizer(org.opendaylight.mdsal.binding.dom.adapter.test.ConcurrentDataBrokerTestCustomizer) TransactionChainListener(org.opendaylight.mdsal.binding.api.TransactionChainListener) DOMDataTreeWriteTransaction(org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction) WriteTransaction(org.opendaylight.mdsal.binding.api.WriteTransaction) Transaction(org.opendaylight.mdsal.binding.api.Transaction) NetconfNode(org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode) Node(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node) NormalizedNode(org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode) NetworkTopology(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology) TransactionChain(org.opendaylight.mdsal.binding.api.TransactionChain) YangInstanceIdentifier(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier) InstanceIdentifier(org.opendaylight.yangtools.yang.binding.InstanceIdentifier) LogicalDatastoreType(org.opendaylight.mdsal.common.api.LogicalDatastoreType) Before(org.junit.Before)

Aggregations

ConcurrentDataBrokerTestCustomizer (org.opendaylight.mdsal.binding.dom.adapter.test.ConcurrentDataBrokerTestCustomizer)3 Before (org.junit.Before)2 Transaction (org.opendaylight.mdsal.binding.api.Transaction)1 TransactionChain (org.opendaylight.mdsal.binding.api.TransactionChain)1 TransactionChainListener (org.opendaylight.mdsal.binding.api.TransactionChainListener)1 WriteTransaction (org.opendaylight.mdsal.binding.api.WriteTransaction)1 LogicalDatastoreType (org.opendaylight.mdsal.common.api.LogicalDatastoreType)1 DOMDataTreeWriteTransaction (org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction)1 InMemoryDOMDataStore (org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStore)1 NetconfNode (org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode)1 NetworkTopology (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology)1 Node (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node)1 InstanceIdentifier (org.opendaylight.yangtools.yang.binding.InstanceIdentifier)1 YangInstanceIdentifier (org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier)1 NormalizedNode (org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode)1