Merge "Bug 584: Increase test coverage"
[mdsal.git] / code-generator / binding-generator-util / src / test / java / org / opendaylight / yangtools / binding / generator / util / TypesTest.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.yangtools.binding.generator.util;
9
10 import static org.junit.Assert.assertEquals;
11
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;
17
18 public class TypesTest {
19
20     @Test
21     public void testVoidType() {
22         final ConcreteType voidType = Types.voidType();
23         assertEquals("Void", voidType.getName());
24     }
25
26     @Test
27     public void testPrimitiveType() {
28         final Type primitiveType = Types.primitiveType("newType", null);
29         assertEquals("newType", primitiveType.getName());
30     }
31
32     @Test
33     public void testMapTypeFor() {
34         final ParameterizedType mapType = Types.mapTypeFor(null, null);
35         assertEquals("Map", mapType.getName());
36     }
37
38     @Test
39     public void testSetTypeFor() {
40         final ParameterizedType setType = Types.setTypeFor(null);
41         assertEquals("Set", setType.getName());
42     }
43
44     @Test
45     public void testListTypeFor() {
46         final ParameterizedType listType = Types.listTypeFor(null);
47         assertEquals("List", listType.getName());
48     }
49
50     @Test
51     public void testWildcardTypeFor() {
52         final WildcardType wildcardType = Types.wildcardTypeFor("org.opendaylight.yangtools.test", "WildcardTypeTest");
53         assertEquals("WildcardTypeTest", wildcardType.getName());
54     }
55
56     @Test
57     public void testAugmentableTypeFor() {
58         ParameterizedType augmentableType = Types.augmentableTypeFor(null);
59         assertEquals("Augmentable", augmentableType.getName());
60     }
61
62     @Test
63     public void augmentationTypeFor() {
64         ParameterizedType augmentationType = Types.augmentationTypeFor(null);
65         assertEquals("Augmentation", augmentationType.getName());
66     }
67 }