Remove binding.spec.util package
authorŠimon Ukuš <simon.ukus@pantheon.tech>
Mon, 23 Jan 2023 06:51:17 +0000 (07:51 +0100)
committerAnil Belur <abelur@linuxfoundation.org>
Wed, 19 Jun 2024 00:41:45 +0000 (10:41 +1000)
Deprecated DataObjectReadingUtil is not being used by anyone.

JIRA: MDSAL-801
Change-Id: I33d68733820c200155c99f0d0f703daff450e411
Signed-off-by: Šimon Ukuš <simon.ukus@pantheon.tech>
binding/mdsal-binding-spec-util/src/main/java/module-info.java
binding/mdsal-binding-spec-util/src/test/java/org/opendaylight/mdsal/binding/spec/reflect/BindingReflectionsTest.java
binding/mdsal-binding-spec-util/src/test/java/org/opendaylight/mdsal/binding/spec/util/DataObjectReadingUtilTest.java [deleted file]
binding/mdsal-binding-spec-util/src/test/java/org/opendaylight/mdsal/binding/spec/util/FooChild.java [deleted file]
binding/mdsal-binding-spec-util/src/test/java/org/opendaylight/mdsal/binding/spec/util/GroupingFoo.java [deleted file]
binding/mdsal-binding-spec-util/src/test/java/org/opendaylight/mdsal/binding/spec/util/Node.java [deleted file]
binding/mdsal-binding-spec-util/src/test/java/org/opendaylight/mdsal/binding/spec/util/NodeKey.java [deleted file]
binding/mdsal-binding-spec-util/src/test/java/org/opendaylight/mdsal/binding/spec/util/Nodes.java [deleted file]

index ce69b49b6557d103c4df9bcaf39c5c14eca96293..befcaf20a9b14908d650dae9341eeff75a91e3c3 100644 (file)
@@ -7,7 +7,6 @@
  */
 module org.opendaylight.mdsal.binding.spec.util {
     exports org.opendaylight.mdsal.binding.spec.reflect;
-    exports org.opendaylight.mdsal.binding.spec.util;
 
     uses org.opendaylight.yangtools.yang.binding.YangModelBindingProvider;
 
index 31ea18e27c8d55bb86feb07b4ea498e3d4300575..e04eee6b45bf38b61c5b9590ab3455727c1e4c08 100644 (file)
@@ -10,17 +10,13 @@ package org.opendaylight.mdsal.binding.spec.reflect;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.mock;
 
 import com.google.common.util.concurrent.ListenableFuture;
 import java.util.Collections;
 import java.util.List;
 import org.junit.Test;
-import org.opendaylight.mdsal.binding.spec.util.FooChild;
 import org.opendaylight.yangtools.yang.binding.Augmentation;
 import org.opendaylight.yangtools.yang.binding.BaseIdentity;
-import org.opendaylight.yangtools.yang.binding.ChildOf;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.RpcService;
 import org.opendaylight.yangtools.yang.common.QName;
@@ -37,8 +33,6 @@ public class BindingReflectionsTest {
         assertTrue("Should be BindingClass", BindingReflections.isBindingClass(DataObject.class));
         assertFalse("Should not be Notification", BindingReflections.isNotification(DataObject.class));
 
-        final ChildOf<?> childOf = mock(FooChild.class);
-        doReturn(FooChild.class).when(childOf).implementedInterface();
         assertTrue(BindingReflections.isRpcMethod(TestImplementation.class.getDeclaredMethod("rpcMethodTest")));
         assertEquals(TestImplementation.class, BindingReflections.findAugmentationTarget(TestImplementation.class));
 
diff --git a/binding/mdsal-binding-spec-util/src/test/java/org/opendaylight/mdsal/binding/spec/util/DataObjectReadingUtilTest.java b/binding/mdsal-binding-spec-util/src/test/java/org/opendaylight/mdsal/binding/spec/util/DataObjectReadingUtilTest.java
deleted file mode 100644 (file)
index 67bfe17..0000000
+++ /dev/null
@@ -1,102 +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.mdsal.binding.spec.util;
-
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.mock;
-import static org.opendaylight.mdsal.binding.spec.util.DataObjectReadingUtil.readData;
-
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.UnmodifiableIterator;
-import java.util.Map;
-import java.util.Map.Entry;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.junit.MockitoJUnitRunner;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.Identifiable;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-@Deprecated(since = "11.0.3", forRemoval = true)
-@RunWith(MockitoJUnitRunner.StrictStubs.class)
-public class DataObjectReadingUtilTest {
-    @Mock
-    public InstanceIdentifier<? extends DataObject> pathNull;
-    @Mock
-    public Map.Entry<InstanceIdentifier<? extends DataObject>, DataObject> entryNull;
-    @Mock
-    public DataObject mockedDataObject;
-
-    public InstanceIdentifier<? extends DataObject> path;
-    public Map.Entry<InstanceIdentifier<? extends DataObject>, DataObject> entry;
-
-    @Before
-    public void setup() {
-        path = InstanceIdentifier.builder(Nodes.class).build();
-        final ImmutableMap<InstanceIdentifier<? extends DataObject>, DataObject> map =
-                ImmutableMap.<InstanceIdentifier<? extends DataObject>, DataObject>builder()
-                .put(path, mockedDataObject).build();
-
-        final ImmutableSet<Entry<InstanceIdentifier<? extends DataObject>, DataObject>> entries = map.entrySet();
-        final UnmodifiableIterator<Entry<InstanceIdentifier<? extends DataObject>, DataObject>> it = entries.iterator();
-        while (it.hasNext()) {
-            entry = it.next();
-        }
-    }
-
-    @Test
-    public void testReadData() throws Exception {
-        final Nodes nodes = mock(Nodes.class);
-        doReturn(Nodes.class).when(nodes).implementedInterface();
-        doReturn(null).when(nodes).getNode();
-        entry = ImmutableMap.<InstanceIdentifier<? extends DataObject>, DataObject>builder()
-                .put(path, nodes).build().entrySet().iterator().next();
-        path = InstanceIdentifier.builder(Nodes.class).child(Node.class).build();
-        assertTrue(DataObjectReadingUtil.readData(entry.getValue(),
-                (InstanceIdentifier<DataObject>) entry.getKey(), path).isEmpty());
-
-        final Iterable<Identifiable> iterable = ImmutableList.of();
-        doReturn(iterable).when(nodes).getNode();
-        assertTrue(DataObjectReadingUtil.readData(entry.getValue(),
-                (InstanceIdentifier<DataObject>) entry.getKey(), path).isEmpty());
-    }
-
-    @SuppressWarnings("unchecked")
-    @Test(expected = IllegalArgumentException.class)
-    public void testReadDataParentNull() {
-        readData(entryNull.getValue(), (InstanceIdentifier<DataObject>) entryNull.getKey(), pathNull);
-    }
-
-    @SuppressWarnings("unchecked")
-    @Test(expected = IllegalArgumentException.class)
-    public void testReadDataParentPathNull() {
-        readData(entry.getValue(), (InstanceIdentifier<DataObject>) entryNull.getKey(), pathNull);
-    }
-
-    @SuppressWarnings("unchecked")
-    @Test
-    public void testReadDataWithThreeParams() {
-        assertTrue("Check if contains key",
-                readData(entry.getValue(),
-                        (InstanceIdentifier<DataObject>) entry.getKey(), path).containsKey(entry.getKey()));
-
-        assertTrue("Check if contains value",
-                readData(entry.getValue(),
-                        (InstanceIdentifier<DataObject>) entry.getKey(), path).containsValue(entry.getValue()));
-    }
-
-    @Test(expected = NullPointerException.class)
-    public void testReadDataWithTwoParams() {
-        readData(mockedDataObject, DataObject.class);
-    }
-}
\ No newline at end of file
diff --git a/binding/mdsal-binding-spec-util/src/test/java/org/opendaylight/mdsal/binding/spec/util/FooChild.java b/binding/mdsal-binding-spec-util/src/test/java/org/opendaylight/mdsal/binding/spec/util/FooChild.java
deleted file mode 100644 (file)
index dd5ac3c..0000000
+++ /dev/null
@@ -1,15 +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.mdsal.binding.spec.util;
-
-import org.opendaylight.yangtools.yang.binding.ChildOf;
-
-@Deprecated(since = "11.0.3", forRemoval = true)
-public interface FooChild extends ChildOf<GroupingFoo> {
-
-}
diff --git a/binding/mdsal-binding-spec-util/src/test/java/org/opendaylight/mdsal/binding/spec/util/GroupingFoo.java b/binding/mdsal-binding-spec-util/src/test/java/org/opendaylight/mdsal/binding/spec/util/GroupingFoo.java
deleted file mode 100644 (file)
index 39b4941..0000000
+++ /dev/null
@@ -1,13 +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.mdsal.binding.spec.util;
-
-@Deprecated(since = "11.0.3", forRemoval = true)
-public interface GroupingFoo {
-
-}
diff --git a/binding/mdsal-binding-spec-util/src/test/java/org/opendaylight/mdsal/binding/spec/util/Node.java b/binding/mdsal-binding-spec-util/src/test/java/org/opendaylight/mdsal/binding/spec/util/Node.java
deleted file mode 100644 (file)
index c0059a4..0000000
+++ /dev/null
@@ -1,17 +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.mdsal.binding.spec.util;
-
-import org.opendaylight.yangtools.yang.binding.ChildOf;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.Identifiable;
-
-@Deprecated(since = "11.0.3", forRemoval = true)
-public interface Node extends DataObject, Identifiable<NodeKey>, ChildOf<Nodes> {
-
-}
diff --git a/binding/mdsal-binding-spec-util/src/test/java/org/opendaylight/mdsal/binding/spec/util/NodeKey.java b/binding/mdsal-binding-spec-util/src/test/java/org/opendaylight/mdsal/binding/spec/util/NodeKey.java
deleted file mode 100644 (file)
index fb639bd..0000000
+++ /dev/null
@@ -1,37 +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.mdsal.binding.spec.util;
-
-import java.io.Serial;
-import org.opendaylight.yangtools.yang.binding.Identifier;
-
-@Deprecated(since = "11.0.3", forRemoval = true)
-public class NodeKey implements Identifier<Node> {
-    @Serial
-    private static final long serialVersionUID = 1L;
-
-    private final int id;
-
-    public NodeKey(final int id) {
-        this.id = id;
-    }
-
-    public int getId() {
-        return id;
-    }
-
-    @Override
-    public int hashCode() {
-        return Integer.hashCode(id);
-    }
-
-    @Override
-    public boolean equals(final Object obj) {
-        return this == obj || obj != null && getClass() == obj.getClass() && id == ((NodeKey) obj).id;
-    }
-}
diff --git a/binding/mdsal-binding-spec-util/src/test/java/org/opendaylight/mdsal/binding/spec/util/Nodes.java b/binding/mdsal-binding-spec-util/src/test/java/org/opendaylight/mdsal/binding/spec/util/Nodes.java
deleted file mode 100644 (file)
index add3b4c..0000000
+++ /dev/null
@@ -1,18 +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.mdsal.binding.spec.util;
-
-import org.opendaylight.yangtools.yang.binding.ChildOf;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.DataRoot;
-
-@Deprecated(since = "11.0.3", forRemoval = true)
-public interface Nodes extends ChildOf<DataRoot>, DataObject {
-
-    Iterable<?> getNode();
-}