X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-binding-broker%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fbinding%2Fimpl%2Ftest%2FDataTreeChangeListenerTest.java;h=4e9a79f8690bd63c0f6839930c3df68ca5252b61;hp=888a62813366bbd772ba879d9452f2ad01f55ffc;hb=8a8de0bffed5b6c9b4ac821dfafa7e944c70ef9d;hpb=1d643894797401ebec8e2242c234779675ca37c3 diff --git a/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/md/sal/binding/impl/test/DataTreeChangeListenerTest.java b/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/md/sal/binding/impl/test/DataTreeChangeListenerTest.java index 888a628133..4e9a79f869 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/md/sal/binding/impl/test/DataTreeChangeListenerTest.java +++ b/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/md/sal/binding/impl/test/DataTreeChangeListenerTest.java @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2014, 2015 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.md.sal.binding.impl.test; import static org.junit.Assert.assertEquals; @@ -16,8 +24,8 @@ import com.google.common.collect.Iterables; import com.google.common.util.concurrent.SettableFuture; import java.util.Collection; import java.util.concurrent.TimeUnit; +import org.junit.Before; import org.junit.Test; -import org.opendaylight.controller.md.sal.binding.api.DataBroker; import org.opendaylight.controller.md.sal.binding.api.DataObjectModification; import org.opendaylight.controller.md.sal.binding.api.DataObjectModification.ModificationType; import org.opendaylight.controller.md.sal.binding.api.DataTreeChangeListener; @@ -25,7 +33,7 @@ import org.opendaylight.controller.md.sal.binding.api.DataTreeIdentifier; import org.opendaylight.controller.md.sal.binding.api.DataTreeModification; import org.opendaylight.controller.md.sal.binding.api.WriteTransaction; import org.opendaylight.controller.md.sal.binding.impl.BindingDOMDataBrokerAdapter; -import org.opendaylight.controller.md.sal.binding.test.AbstractDataBrokerTest; +import org.opendaylight.controller.md.sal.binding.test.AbstractConcurrentDataBrokerTest; import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.augment.rev140709.TreeComplexUsesAugment; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.Top; @@ -37,18 +45,18 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.binding.YangModuleInfo; import org.opendaylight.yangtools.yang.binding.util.BindingReflections; -public class DataTreeChangeListenerTest extends AbstractDataBrokerTest { +public class DataTreeChangeListenerTest extends AbstractConcurrentDataBrokerTest { private static final InstanceIdentifier TOP_PATH = InstanceIdentifier.create(Top.class); - private static final PathArgument TOP_ARGUMENT= TOP_PATH.getPathArguments().iterator().next(); + private static final PathArgument TOP_ARGUMENT = TOP_PATH.getPathArguments().iterator().next(); private static final InstanceIdentifier FOO_PATH = path(TOP_FOO_KEY); private static final PathArgument FOO_ARGUMENT = Iterables.getLast(FOO_PATH.getPathArguments()); private static final TopLevelList FOO_DATA = topLevelList(TOP_FOO_KEY, complexUsesAugment(USES_ONE_KEY)); private static final InstanceIdentifier BAR_PATH = path(TOP_BAR_KEY); private static final PathArgument BAR_ARGUMENT = Iterables.getLast(BAR_PATH.getPathArguments()); private static final TopLevelList BAR_DATA = topLevelList(TOP_BAR_KEY); -private static final DataTreeIdentifier TOP_IDENTIFIER = new DataTreeIdentifier(LogicalDatastoreType.OPERATIONAL, - TOP_PATH); + private static final DataTreeIdentifier TOP_IDENTIFIER = + new DataTreeIdentifier<>(LogicalDatastoreType.OPERATIONAL, TOP_PATH); private static final Top TOP_INITIAL_DATA = top(FOO_DATA); @@ -80,9 +88,9 @@ private static final DataTreeIdentifier TOP_IDENTIFIER = new DataTreeIdenti ); } - @Override - protected void setupWithDataBroker(final DataBroker dataBroker) { - dataBrokerImpl = (BindingDOMDataBrokerAdapter) dataBroker; + @Before + public void setupWithDataBroker() { + dataBrokerImpl = (BindingDOMDataBrokerAdapter) getDataBroker(); } @Test