import org.opendaylight.mdsal.binding.api.RpcProviderService;
import org.opendaylight.mdsal.binding.dom.adapter.test.util.BindingBrokerTestFactory;
import org.opendaylight.mdsal.binding.dom.adapter.test.util.BindingTestContext;
-import org.opendaylight.mdsal.binding.spec.reflect.BindingReflections;
+import org.opendaylight.mdsal.binding.runtime.spi.BindingRuntimeHelpers;
import org.opendaylight.mdsal.dom.api.DOMRpcIdentifier;
import org.opendaylight.mdsal.dom.api.DOMRpcProviderService;
import org.opendaylight.mdsal.dom.api.DOMRpcResult;
testContext = testFactory.getTestContext();
testContext.setSchemaModuleInfos(ImmutableSet.of(
- BindingReflections.getModuleInfo(OpendaylightKnockKnockRpcService.class),
- BindingReflections.getModuleInfo(Top.class)));
+ BindingRuntimeHelpers.getYangModuleInfo(OpendaylightKnockKnockRpcService.class),
+ BindingRuntimeHelpers.getYangModuleInfo(Top.class)));
testContext.start();
baRpcProviderService = testContext.getBindingRpcProviderRegistry();
baRpcConsumerService = testContext.getBindingRpcConsumerRegistry();
import java.util.Set;
import org.junit.Test;
import org.opendaylight.mdsal.binding.dom.adapter.test.AbstractDataTreeChangeListenerTest;
-import org.opendaylight.mdsal.binding.spec.reflect.BindingReflections;
+import org.opendaylight.mdsal.binding.runtime.spi.BindingRuntimeHelpers;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.augment.rev140709.TreeComplexUsesAugment;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.augment.rev140709.TreeComplexUsesAugmentBuilder;
@Override
protected Set<YangModuleInfo> getModuleInfos() throws Exception {
- return Set.of(BindingReflections.getModuleInfo(Top.class),
- BindingReflections.getModuleInfo(TreeComplexUsesAugment.class));
+ return Set.of(
+ BindingRuntimeHelpers.getYangModuleInfo(Top.class),
+ BindingRuntimeHelpers.getYangModuleInfo(TreeComplexUsesAugment.class));
}
@Test
import static org.opendaylight.mdsal.binding.test.model.util.ListsBindingUtils.top;
import static org.opendaylight.mdsal.binding.test.model.util.ListsBindingUtils.topLevelList;
-import com.google.common.collect.ImmutableSet;
import java.util.Set;
import org.junit.Test;
import org.opendaylight.mdsal.binding.dom.adapter.test.AbstractDataTreeChangeListenerTest;
-import org.opendaylight.mdsal.binding.spec.reflect.BindingReflections;
+import org.opendaylight.mdsal.binding.runtime.spi.BindingRuntimeHelpers;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.augment.rev140709.TreeComplexUsesAugment;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.Top;
@Override
protected Set<YangModuleInfo> getModuleInfos() throws Exception {
- return ImmutableSet.of(BindingReflections.getModuleInfo(Top.class),
- BindingReflections.getModuleInfo(TreeComplexUsesAugment.class));
+ return Set.of(BindingRuntimeHelpers.getYangModuleInfo(Top.class),
+ BindingRuntimeHelpers.getYangModuleInfo(TreeComplexUsesAugment.class));
}
private static Top topWithListItem() {
import java.util.Set;
import org.junit.Test;
import org.opendaylight.mdsal.binding.dom.adapter.test.AbstractDataTreeChangeListenerTest;
-import org.opendaylight.mdsal.binding.spec.reflect.BindingReflections;
+import org.opendaylight.mdsal.binding.runtime.spi.BindingRuntimeHelpers;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.augment.rev140709.TreeComplexUsesAugment;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.augment.rev140709.TreeLeafOnlyUsesAugment;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.augment.rev140709.complex.from.grouping.ListViaUsesKey;
@Override
protected Set<YangModuleInfo> getModuleInfos() {
- return Set.of(BindingReflections.getModuleInfo(Top.class),
- BindingReflections.getModuleInfo(TreeComplexUsesAugment.class));
+ return Set.of(BindingRuntimeHelpers.getYangModuleInfo(Top.class),
+ BindingRuntimeHelpers.getYangModuleInfo(TreeComplexUsesAugment.class));
}
@Test
package org.opendaylight.mdsal.binding.dom.adapter;
import java.util.List;
-import java.util.Map;
import java.util.Set;
import org.junit.Test;
import org.opendaylight.mdsal.binding.dom.adapter.test.AbstractDataTreeChangeListenerTest;
-import org.opendaylight.mdsal.binding.spec.reflect.BindingReflections;
+import org.opendaylight.mdsal.binding.runtime.spi.BindingRuntimeHelpers;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.yang.gen.v1.opendaylight.test.bug._2562.namespace.rev160101.Root;
import org.opendaylight.yang.gen.v1.opendaylight.test.bug._2562.namespace.rev160101.RootBuilder;
import org.opendaylight.yang.gen.v1.opendaylight.test.bug._2562.namespace.rev160101.root.FoorootBuilder;
import org.opendaylight.yang.gen.v1.opendaylight.test.bug._2562.namespace.rev160101.root.fooroot.BarrootBuilder;
-import org.opendaylight.yang.gen.v1.opendaylight.test.bug._2562.namespace.rev160101.root.fooroot.BarrootKey;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.binding.YangModuleInfo;
+import org.opendaylight.yangtools.yang.binding.util.BindingMap;
public class Bug2562DeserializedUnkeyedListTest extends AbstractDataTreeChangeListenerTest {
private static final InstanceIdentifier<Root> ROOT_PATH = InstanceIdentifier.create(Root.class);
@Override
protected Set<YangModuleInfo> getModuleInfos() throws Exception {
- return Set.of(BindingReflections.getModuleInfo(Root.class));
+ return Set.of(BindingRuntimeHelpers.getYangModuleInfo(Root.class));
}
@Test
public void writeListToList2562Root() {
- final var barRoot = new BarrootBuilder().setType(2).setValue(2).withKey(new BarrootKey(2)).build();
- final var fooRoot = new FoorootBuilder().setBarroot(Map.of(barRoot.key(), barRoot)).build();
- final var root = new RootBuilder().setFooroot(List.of(fooRoot)).build();
+ final var root = new RootBuilder()
+ .setFooroot(List.of(new FoorootBuilder()
+ .setBarroot(BindingMap.of(new BarrootBuilder().setType(2).setValue(2).build()))
+ .build())).build();
try (var collector = createCollector(LogicalDatastoreType.CONFIGURATION, ROOT_PATH)) {
collector.verifyModifications();
import org.junit.Test;
import org.opendaylight.mdsal.binding.api.DataObjectModification.ModificationType;
import org.opendaylight.mdsal.binding.dom.adapter.test.AbstractDataTreeChangeListenerTest;
-import org.opendaylight.mdsal.binding.spec.reflect.BindingReflections;
+import org.opendaylight.mdsal.binding.runtime.spi.BindingRuntimeHelpers;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.opendaylight.test.bug._3090.rev160101.Root;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.opendaylight.test.bug._3090.rev160101.RootBuilder;
@Override
protected Set<YangModuleInfo> getModuleInfos() throws Exception {
- return Set.of(BindingReflections.getModuleInfo(Root.class));
+ return Set.of(BindingRuntimeHelpers.getYangModuleInfo(Root.class));
}
@Test
import org.opendaylight.mdsal.binding.api.DataTreeModification;
import org.opendaylight.mdsal.binding.api.WriteTransaction;
import org.opendaylight.mdsal.binding.dom.adapter.test.AbstractDataBrokerTest;
-import org.opendaylight.mdsal.binding.spec.reflect.BindingReflections;
+import org.opendaylight.mdsal.binding.runtime.spi.BindingRuntimeHelpers;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.augment.rev140709.TreeComplexUsesAugment;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.Top;
@Override
public void onDataTreeChanged(final Collection<DataTreeModification<T>> changes) {
- this.futureChanges.set(changes);
+ futureChanges.set(changes);
}
@Override
protected Set<YangModuleInfo> getModuleInfos() throws Exception {
return ImmutableSet.of(
- BindingReflections.getModuleInfo(TwoLevelList.class),
- BindingReflections.getModuleInfo(TreeComplexUsesAugment.class)
- );
+ BindingRuntimeHelpers.getYangModuleInfo(TwoLevelList.class),
+ BindingRuntimeHelpers.getYangModuleInfo(TreeComplexUsesAugment.class));
}
@Override
import org.opendaylight.mdsal.binding.api.NotificationPublishService;
import org.opendaylight.mdsal.binding.api.NotificationService.Listener;
import org.opendaylight.mdsal.binding.dom.adapter.test.AbstractNotificationBrokerTest;
-import org.opendaylight.mdsal.binding.spec.reflect.BindingReflections;
+import org.opendaylight.mdsal.binding.runtime.spi.BindingRuntimeHelpers;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.OpendaylightMdsalBindingTestListener;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.TwoLevelListChanged;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.TwoLevelListChangedBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.two.level.list.TopLevelListKey;
import org.opendaylight.yangtools.yang.binding.YangModuleInfo;
import org.opendaylight.yangtools.yang.binding.util.BindingMap;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
public class ForwardedNotificationAdapterTest extends AbstractNotificationBrokerTest {
- private static final Logger LOG = LoggerFactory.getLogger(ForwardedNotificationAdapterTest.class);
-
@Override
protected Set<YangModuleInfo> getModuleInfos() throws Exception {
- return Set.of(BindingReflections.getModuleInfo(TwoLevelListChanged.class));
+ return Set.of(BindingRuntimeHelpers.getYangModuleInfo(TwoLevelListChanged.class));
}
@Test
import static org.opendaylight.mdsal.binding.test.model.util.ListsBindingUtils.topLevelList;
import static org.opendaylight.mdsal.common.api.LogicalDatastoreType.CONFIGURATION;
-import com.google.common.collect.ImmutableSet;
import java.util.HashSet;
import java.util.Objects;
import java.util.Set;
import org.opendaylight.mdsal.binding.api.DataObjectModification.ModificationType;
import org.opendaylight.mdsal.binding.api.WriteTransaction;
import org.opendaylight.mdsal.binding.dom.adapter.test.AbstractDataTreeChangeListenerTest;
-import org.opendaylight.mdsal.binding.spec.reflect.BindingReflections;
+import org.opendaylight.mdsal.binding.runtime.spi.BindingRuntimeHelpers;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.Top;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.two.level.list.TopLevelList;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.two.level.list.TopLevelListBuilder;
@Override
protected Set<YangModuleInfo> getModuleInfos() throws Exception {
- return ImmutableSet.of(BindingReflections.getModuleInfo(Top.class));
+ return Set.of(BindingRuntimeHelpers.getYangModuleInfo(Top.class));
}
@Before
import static org.junit.Assert.assertTrue;
import com.google.common.collect.HashMultimap;
-import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Multimap;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.MoreExecutors;
+import java.util.Set;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import org.opendaylight.mdsal.binding.api.RpcProviderService;
import org.opendaylight.mdsal.binding.dom.adapter.test.util.BindingBrokerTestFactory;
import org.opendaylight.mdsal.binding.dom.adapter.test.util.BindingTestContext;
-import org.opendaylight.mdsal.binding.spec.reflect.BindingReflections;
+import org.opendaylight.mdsal.binding.runtime.spi.BindingRuntimeHelpers;
import org.opendaylight.mdsal.dom.api.DOMRpcIdentifier;
import org.opendaylight.mdsal.dom.api.DOMRpcProviderService;
import org.opendaylight.mdsal.dom.api.DOMRpcResult;
testFactory.setExecutor(MoreExecutors.newDirectExecutorService());
testContext = testFactory.getTestContext();
- testContext.setSchemaModuleInfos(ImmutableSet.of(
- BindingReflections.getModuleInfo(Mdsal500Service.class)));
+ testContext.setSchemaModuleInfos(Set.of(
+ BindingRuntimeHelpers.getYangModuleInfo(Mdsal500Service.class)));
testContext.start();
baRpcProviderService = testContext.getBindingRpcProviderRegistry();
baRpcConsumerService = testContext.getBindingRpcConsumerRegistry();
* @param cls data object class
* @return Instance of {@link YangModuleInfo} associated with model, from which this class was derived.
*/
- public static @NonNull YangModuleInfo getModuleInfo(final Class<?> cls) {
+ private static @NonNull YangModuleInfo getModuleInfo(final Class<?> cls) {
final String packageName = Naming.getModelRootPackageName(cls.getPackage().getName());
final String potentialClassName = getModuleInfoClassName(packageName);
final Class<?> moduleInfoClass;