2 * Copyright (c) 2014 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.generator.util;
10 import static org.junit.Assert.assertEquals;
12 import org.junit.Test;
13 import org.opendaylight.yangtools.sal.binding.model.api.ConcreteType;
14 import org.opendaylight.yangtools.sal.binding.model.api.ParameterizedType;
15 import org.opendaylight.yangtools.sal.binding.model.api.Type;
16 import org.opendaylight.yangtools.sal.binding.model.api.WildcardType;
18 public class TypesTest {
21 public void testVoidType() {
22 final ConcreteType voidType = Types.voidType();
23 assertEquals("Void", voidType.getName());
27 public void testPrimitiveType() {
28 final Type primitiveType = Types.primitiveType("newType", null);
29 assertEquals("newType", primitiveType.getName());
33 public void testMapTypeFor() {
34 final ParameterizedType mapType = Types.mapTypeFor(null, null);
35 assertEquals("Map", mapType.getName());
39 public void testSetTypeFor() {
40 final ParameterizedType setType = Types.setTypeFor(null);
41 assertEquals("Set", setType.getName());
45 public void testListTypeFor() {
46 final ParameterizedType listType = Types.listTypeFor(null);
47 assertEquals("List", listType.getName());
51 public void testWildcardTypeFor() {
52 final WildcardType wildcardType = Types.wildcardTypeFor("org.opendaylight.yangtools.test", "WildcardTypeTest");
53 assertEquals("WildcardTypeTest", wildcardType.getName());
57 public void testAugmentableTypeFor() {
58 ParameterizedType augmentableType = Types.augmentableTypeFor(null);
59 assertEquals("Augmentable", augmentableType.getName());
63 public void augmentationTypeFor() {
64 ParameterizedType augmentationType = Types.augmentationTypeFor(null);
65 assertEquals("Augmentation", augmentationType.getName());