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.generator.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.WildcardType;
19 public class TypesTest {
22 public void testVoidType() {
23 final ConcreteType voidType = Types.voidType();
24 assertEquals("Void", voidType.getName());
25 assertNotNull(voidType);
29 public void testPrimitiveType() {
30 final Type primitiveType = Types.primitiveType("newType", null);
31 assertEquals("newType", primitiveType.getName());
32 assertNotNull(primitiveType);
36 public void testMapTypeFor() {
37 final ParameterizedType mapType = Types.mapTypeFor(null, null);
38 assertEquals("Map", mapType.getName());
39 assertNotNull(mapType);
43 public void testSetTypeFor() {
44 final ParameterizedType setType = Types.setTypeFor(null);
45 assertEquals("Set", setType.getName());
46 assertNotNull(setType);
50 public void testListTypeFor() {
51 final ParameterizedType listType = Types.listTypeFor(null);
52 assertEquals("List", listType.getName());
53 assertNotNull(listType);
57 public void testWildcardTypeFor() {
58 final WildcardType wildcardType = Types.wildcardTypeFor("org.opendaylight.yangtools.test", "WildcardTypeTest");
59 assertEquals("WildcardTypeTest", wildcardType.getName());
60 assertNotNull(wildcardType);
64 public void testAugmentableTypeFor() {
65 ParameterizedType augmentableType = Types.augmentableTypeFor(null);
66 assertEquals("Augmentable", augmentableType.getName());
70 public void augmentationTypeFor() {
71 ParameterizedType augmentationType = Types.augmentationTypeFor(null);
72 assertEquals("Augmentation", augmentationType.getName());