2 * Copyright (c) 2018 Pantheon Technologies, 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;
13 import com.google.common.collect.ImmutableList;
14 import com.google.common.collect.ImmutableSet;
15 import java.util.List;
17 import org.junit.Test;
18 import org.opendaylight.mdsal.binding.model.api.JavaTypeName;
19 import org.opendaylight.mdsal.binding.model.api.Type;
20 import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
22 public class Mdsal332Test {
24 public void mdsal332Test() {
25 final List<Type> generateTypes = DefaultBindingGenerator.generateFor(YangParserTestUtils.parseYangResource(
27 assertNotNull(generateTypes);
28 assertEquals(5, generateTypes.size());
30 final List<JavaTypeName> names = generateTypes.stream().map(Type::getIdentifier)
31 .collect(ImmutableList.toImmutableList());
32 final Set<JavaTypeName> uniqueNames = ImmutableSet.copyOf(names);
33 assertEquals(ImmutableList.copyOf(uniqueNames), names);