Further cleanup of test classes 98/96898/1
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 15 Jul 2021 12:23:00 +0000 (14:23 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 15 Jul 2021 12:23:00 +0000 (14:23 +0200)
We have no users of TestLeafSchemaNode and TypeProviderModel is only
used by TypeProviderTest.

Change-Id: I92e8467d60c1e2a784607181674f8ae32b47974b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
binding/mdsal-binding-generator/src/test/java/org/opendaylight/mdsal/binding/yang/types/TestLeafSchemaNode.java [deleted file]
binding/mdsal-binding-generator/src/test/java/org/opendaylight/mdsal/binding/yang/types/TypeProviderModel.java [deleted file]
binding/mdsal-binding-generator/src/test/java/org/opendaylight/mdsal/binding/yang/types/TypeProviderTest.java

diff --git a/binding/mdsal-binding-generator/src/test/java/org/opendaylight/mdsal/binding/yang/types/TestLeafSchemaNode.java b/binding/mdsal-binding-generator/src/test/java/org/opendaylight/mdsal/binding/yang/types/TestLeafSchemaNode.java
deleted file mode 100644 (file)
index eedd2cf..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (c) 2016 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.yang.types;
-
-import com.google.common.collect.ImmutableSet;
-import java.util.Collection;
-import java.util.Optional;
-import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.MustDefinition;
-import org.opendaylight.yangtools.yang.model.api.SchemaPath;
-import org.opendaylight.yangtools.yang.model.api.Status;
-import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
-import org.opendaylight.yangtools.yang.model.api.stmt.LeafEffectiveStatement;
-import org.opendaylight.yangtools.yang.xpath.api.YangXPathExpression.QualifiedBound;
-
-/**
- * Mock Leaf Schema Node designated to increase branch coverage in test cases.
- *
- * @author Lukas Sedlak &lt;lsedlak@cisco.com&gt;
- */
-public class TestLeafSchemaNode implements LeafSchemaNode {
-    @Override
-    public TypeDefinition<?> getType() {
-        return null;
-    }
-
-    @Override
-    @Deprecated
-    public boolean isAugmenting() {
-        return false;
-    }
-
-    @Override
-    @Deprecated
-    public boolean isAddedByUses() {
-        return false;
-    }
-
-    @Override
-    public Optional<Boolean> effectiveConfig() {
-        return Optional.of(Boolean.FALSE);
-    }
-
-    @Override
-    public QName getQName() {
-        throw new UnsupportedOperationException();
-    }
-
-    @Override
-    @Deprecated
-    public SchemaPath getPath() {
-        throw new UnsupportedOperationException();
-    }
-
-    @Override
-    public Optional<String> getDescription() {
-        return Optional.empty();
-    }
-
-    @Override
-    public Optional<String> getReference() {
-        return Optional.empty();
-    }
-
-    @Override
-    public Status getStatus() {
-        return Status.CURRENT;
-    }
-
-    @Override
-    public boolean isMandatory() {
-        return false;
-    }
-
-    @Override
-    public Optional<? extends QualifiedBound> getWhenCondition() {
-        return Optional.empty();
-    }
-
-    @Override
-    public Collection<@NonNull MustDefinition> getMustConstraints() {
-        return ImmutableSet.of();
-    }
-
-    @Override
-    public LeafEffectiveStatement asEffectiveStatement() {
-        throw new UnsupportedOperationException();
-    }
-}
diff --git a/binding/mdsal-binding-generator/src/test/java/org/opendaylight/mdsal/binding/yang/types/TypeProviderModel.java b/binding/mdsal-binding-generator/src/test/java/org/opendaylight/mdsal/binding/yang/types/TypeProviderModel.java
deleted file mode 100644 (file)
index 1bc9760..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (c) 2016 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.yang.types;
-
-import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
-import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
-
-/**
- * Test Model Provider designated to load test resources and provide Schema Context for testing of TypeProviderImpl.
- */
-public final class TypeProviderModel {
-    public static final String TEST_TYPE_PROVIDER_MODULE_NAME = "test-type-provider";
-
-    private TypeProviderModel() {
-
-    }
-
-    public static EffectiveModelContext createTestContext() {
-        return YangParserTestUtils.parseYangResources(TypeProviderModel.class, "/base-yang-types.yang",
-            "/" + TEST_TYPE_PROVIDER_MODULE_NAME + ".yang", "/test-type-provider-b.yang");
-    }
-}
index 1bed451c37b61346fbd7a38fe2a7cc8d715c2b24..954289562e6e4e76b152238840c19380ba914280 100644 (file)
@@ -44,6 +44,7 @@ import org.opendaylight.yangtools.yang.model.api.SchemaPath;
 import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
 import org.opendaylight.yangtools.yang.model.api.type.RangeConstraint;
 import org.opendaylight.yangtools.yang.model.api.type.UnionTypeDefinition;
+import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
 
 /**
  * Test suite for testing public methods in TypeProviderImpl class.
@@ -55,9 +56,8 @@ import org.opendaylight.yangtools.yang.model.api.type.UnionTypeDefinition;
 @Ignore
 @RunWith(MockitoJUnitRunner.class)
 public class TypeProviderTest {
-
-    public static EffectiveModelContext SCHEMA_CONTEXT;
-    public static Module TEST_TYPE_PROVIDER;
+    static EffectiveModelContext SCHEMA_CONTEXT;
+    static Module TEST_TYPE_PROVIDER;
 
     @Mock
     public SchemaPath schemaPath;
@@ -67,8 +67,9 @@ public class TypeProviderTest {
 
     @BeforeClass
     public static void beforeClass() {
-        SCHEMA_CONTEXT = TypeProviderModel.createTestContext();
-        TEST_TYPE_PROVIDER = resolveModule(TypeProviderModel.TEST_TYPE_PROVIDER_MODULE_NAME);
+        SCHEMA_CONTEXT = YangParserTestUtils.parseYangResources(TypeProviderTest.class,
+            "/base-yang-types.yang", "/test-type-provider-b.yang", "/test-type-provider.yang");
+        TEST_TYPE_PROVIDER = resolveModule("test-type-provider");
     }
 
     @AfterClass