2 * Copyright (c) 2023 PANTHEON.tech, s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.mdsal.binding.generator.impl;
10 import static org.junit.Assert.assertEquals;
11 import static org.junit.Assert.assertNotNull;
12 import static org.junit.Assert.assertSame;
15 import org.junit.BeforeClass;
16 import org.junit.Test;
17 import org.opendaylight.mdsal.binding.model.api.JavaTypeName;
18 import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
19 import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
21 public class Mdsal829Test {
22 private static EffectiveModelContext CONTEXT;
25 public static void beforeClass() {
26 CONTEXT = YangParserTestUtils.parseYangResource("/mdsal829.yang", Set.of());
30 public void testCompileTimeTypes() {
31 assertEquals(1, DefaultBindingGenerator.generateFor(CONTEXT).size());
35 public void testRunTimeTypes() {
36 final var types = BindingRuntimeTypesFactory.createTypes(CONTEXT);
37 assertSame(CONTEXT, types.getEffectiveModelContext());
38 final var schema = types.findSchema(
39 JavaTypeName.create("org.opendaylight.yang.gen.v1.mdsal829.norev", "Mdsal829Data")).orElseThrow();
40 assertNotNull(schema);