From e4d7d82fc8d715b8d00fc624e9e2579fe13b7c58 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Wed, 31 Mar 2021 14:04:28 +0200 Subject: [PATCH] Simplify BinaryTypeTest We have a very simple utility method to achieve the same thing the test is doing for models. Simplify it by using a common method. Change-Id: Ib2311f0f9998f2f42a0b196b5b37fd63be46f048 Signed-off-by: Robert Varga --- .../generator/impl/BinaryTypeTest.java | 21 +------------------ 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/binding/mdsal-binding-generator-impl/src/test/java/org/opendaylight/mdsal/binding/generator/impl/BinaryTypeTest.java b/binding/mdsal-binding-generator-impl/src/test/java/org/opendaylight/mdsal/binding/generator/impl/BinaryTypeTest.java index 94f6606938..20ab9f1eab 100644 --- a/binding/mdsal-binding-generator-impl/src/test/java/org/opendaylight/mdsal/binding/generator/impl/BinaryTypeTest.java +++ b/binding/mdsal-binding-generator-impl/src/test/java/org/opendaylight/mdsal/binding/generator/impl/BinaryTypeTest.java @@ -9,35 +9,16 @@ package org.opendaylight.mdsal.binding.generator.impl; import static org.junit.Assert.assertEquals; -import java.io.File; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.ArrayList; import java.util.List; -import org.junit.BeforeClass; import org.junit.Test; import org.opendaylight.mdsal.binding.model.api.GeneratedType; import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils; public class BinaryTypeTest { - private static final List YANG_MODELS = new ArrayList<>(); - private static final URL YANG_MODELS_FOLDER = AugmentedTypeTest.class.getResource("/binary-type-test-models"); - - @BeforeClass - public static void loadTestResources() throws URISyntaxException { - final File augFolder = new File(YANG_MODELS_FOLDER.toURI()); - for (final File fileEntry : augFolder.listFiles()) { - if (fileEntry.isFile()) { - YANG_MODELS.add(fileEntry); - } - } - } - @Test public void binaryTypeTest() { final List genTypes = DefaultBindingGenerator.generateFor( - YangParserTestUtils.parseYangFiles(YANG_MODELS)); - + YangParserTestUtils.parseYangResourceDirectory("/binary-type-test-models")); assertEquals(9, genTypes.size()); } } -- 2.36.6