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.controller.sal.binding.generator.impl;
10 import static org.junit.Assert.assertEquals;
11 import static org.junit.Assert.assertTrue;
13 import org.junit.Ignore;
14 import org.junit.Test;
15 import org.opendaylight.controller.binding.generator.util.Types;
16 import org.opendaylight.controller.sal.binding.generator.spi.TypeProvider;
17 import org.opendaylight.controller.sal.binding.model.api.ConcreteType;
18 import org.opendaylight.controller.sal.binding.model.api.ParameterizedType;
19 import org.opendaylight.controller.sal.binding.model.api.Type;
20 import org.opendaylight.controller.sal.binding.yang.types.BaseYangTypes;
22 public class BaseTypeProvider {
26 TypeProvider provider = BaseYangTypes.BASE_YANG_TYPES_PROVIDER;
28 Type stringType = provider.javaTypeForYangType("string");
29 assertEquals("java.lang", stringType.getPackageName());
30 assertEquals("String", stringType.getName());
31 assertTrue(stringType instanceof ConcreteType);
32 ParameterizedType stringBooleanMap = Types.mapTypeFor(
33 provider.javaTypeForYangType("string"),
34 provider.javaTypeForYangType("boolean"));
35 assertTrue(!(stringBooleanMap instanceof ConcreteType));
36 assertEquals("java.util", stringBooleanMap.getPackageName());
37 assertEquals("Map", stringBooleanMap.getName());
38 assertEquals(2, stringBooleanMap.getActualTypeArguments().length);