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.mdsal.binding.model.util;
10 import static org.junit.Assert.assertEquals;
11 import static org.junit.Assert.assertTrue;
13 import org.junit.Test;
14 import org.opendaylight.mdsal.binding.model.api.ConcreteType;
15 import org.opendaylight.mdsal.binding.model.api.ParameterizedType;
16 import org.opendaylight.mdsal.binding.model.api.Type;
18 public class BaseYangTypesTest {
21 Type stringType = BaseYangTypes.javaTypeForYangType("string");
22 assertEquals("java.lang", stringType.getPackageName());
23 assertEquals("String", stringType.getName());
24 assertTrue(stringType instanceof ConcreteType);
25 ParameterizedType stringBooleanMap = Types.mapTypeFor(
26 BaseYangTypes.javaTypeForYangType("string"),
27 BaseYangTypes.javaTypeForYangType("boolean"));
28 assertTrue(!(stringBooleanMap instanceof ConcreteType));
29 assertEquals("java.util", stringBooleanMap.getPackageName());
30 assertEquals("Map", stringBooleanMap.getName());
31 assertEquals(2, stringBooleanMap.getActualTypeArguments().length);