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.generator.impl;
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;
17 import org.opendaylight.mdsal.binding.model.util.Types;
18 import org.opendaylight.mdsal.binding.yang.types.BaseYangTypes;
20 public class BaseTypeProvider {
24 Type stringType = BaseYangTypes.javaTypeForYangType("string");
25 assertEquals("java.lang", stringType.getPackageName());
26 assertEquals("String", stringType.getName());
27 assertTrue(stringType instanceof ConcreteType);
28 ParameterizedType stringBooleanMap = Types.mapTypeFor(
29 BaseYangTypes.javaTypeForYangType("string"),
30 BaseYangTypes.javaTypeForYangType("boolean"));
31 assertTrue(!(stringBooleanMap instanceof ConcreteType));
32 assertEquals("java.util", stringBooleanMap.getPackageName());
33 assertEquals("Map", stringBooleanMap.getName());
34 assertEquals(2, stringBooleanMap.getActualTypeArguments().length);