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.mdsal.binding.model.util;
10 import static org.junit.Assert.assertEquals;
11 import static org.junit.Assert.assertNotNull;
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.api.JavaTypeName;
18 import org.opendaylight.mdsal.binding.model.api.WildcardType;
20 public class TypesTest {
23 public void testVoidType() {
24 final ConcreteType voidType = Types.voidType();
25 assertEquals("Void", voidType.getName());
26 assertNotNull(voidType);
30 public void testPrimitiveType() {
31 final Type primitiveType = Types.typeForClass(String[].class);
32 assertEquals("String[]", primitiveType.getName());
36 public void testMapTypeFor() {
37 final ParameterizedType mapType = Types.mapTypeFor(null, null);
38 assertEquals("Map", mapType.getName());
42 public void testSetTypeFor() {
43 final ParameterizedType setType = Types.setTypeFor(null);
44 assertEquals("Set", setType.getName());
48 public void testListTypeFor() {
49 final ParameterizedType listType = Types.listTypeFor(null);
50 assertEquals("List", listType.getName());
54 public void testWildcardTypeFor() {
55 final WildcardType wildcardType = Types.wildcardTypeFor(JavaTypeName.create("org.opendaylight.yangtools.test",
57 assertEquals("WildcardTypeTest", wildcardType.getName());
61 public void testAugmentableTypeFor() {
62 ParameterizedType augmentableType = Types.augmentableTypeFor(null);
63 assertEquals("Augmentable", augmentableType.getName());
67 public void augmentationTypeFor() {
68 ParameterizedType augmentationType = Types.augmentationTypeFor(null);
69 assertEquals("Augmentation", augmentationType.getName());