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.Test;
16 import org.opendaylight.mdsal.binding.model.api.JavaTypeName;
17 import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
18 import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
20 public class Mdsal829Test {
21 private static final EffectiveModelContext MODEL_CONTEXT =
22 YangParserTestUtils.parseYangResource("/mdsal829.yang", Set.of());
25 public void testCompileTimeTypes() {
26 assertEquals(1, DefaultBindingGenerator.generateFor(MODEL_CONTEXT).size());
30 public void testRunTimeTypes() {
31 final var types = BindingRuntimeTypesFactory.createTypes(MODEL_CONTEXT);
32 assertSame(MODEL_CONTEXT, types.modelContext());
33 final var schema = types.findSchema(
34 JavaTypeName.create("org.opendaylight.yang.gen.v1.mdsal829.norev", "Mdsal829Data")).orElseThrow();
35 assertNotNull(schema);