2 * Copyright (c) 2013 Cisco Systems, Inc. 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.yangtools.binding.model.ri;
10 import static org.junit.jupiter.api.Assertions.assertEquals;
11 import static org.junit.jupiter.api.Assertions.assertInstanceOf;
13 import org.junit.jupiter.api.Test;
14 import org.opendaylight.yangtools.binding.BindingInstanceIdentifier;
15 import org.opendaylight.yangtools.binding.model.api.ConcreteType;
17 class BaseYangTypesTest {
20 final var stringType = assertInstanceOf(ConcreteType.class, BaseYangTypes.javaTypeForYangType("string"));
21 assertEquals("java.lang", stringType.getPackageName());
22 assertEquals("String", stringType.getName());
23 final var stringBooleanMap = Types.mapTypeFor(
24 BaseYangTypes.javaTypeForYangType("string"),
25 BaseYangTypes.javaTypeForYangType("boolean"));
27 assertEquals("java.util", stringBooleanMap.getPackageName());
28 assertEquals("Map", stringBooleanMap.getName());
29 assertEquals(2, stringBooleanMap.getActualTypeArguments().length);
31 assertEquals(Types.typeForClass(BindingInstanceIdentifier.class), BaseYangTypes.INSTANCE_IDENTIFIER);