Introduce top-level pom file.
[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 import static org.junit.Assert.assertNotNull;
12
13 import org.junit.Test;
14 import org.opendaylight.yangtools.sal.binding.model.api.ConcreteType;
15 import org.opendaylight.yangtools.sal.binding.model.api.ParameterizedType;
16 import org.opendaylight.yangtools.sal.binding.model.api.Type;
17 import org.opendaylight.yangtools.sal.binding.model.api.WildcardType;
18
19 public class TypesTest {
20
21     @Test
22     public void testVoidType() {
23         final ConcreteType voidType = Types.voidType();
24         assertEquals("Void", voidType.getName());
25         assertNotNull(voidType);
26     }
27
28     @Test
29     public void testPrimitiveType() {
30         final Type primitiveType = Types.primitiveType("newType", null);
31         assertEquals("newType", primitiveType.getName());
32         assertNotNull(primitiveType);
33     }
34
35     @Test
36     public void testMapTypeFor() {
37         final ParameterizedType mapType = Types.mapTypeFor(null, null);
38         assertEquals("Map", mapType.getName());
39         assertNotNull(mapType);
40     }
41
42     @Test
43     public void testSetTypeFor() {
44         final ParameterizedType setType = Types.setTypeFor(null);
45         assertEquals("Set", setType.getName());
46         assertNotNull(setType);
47     }
48
49     @Test
50     public void testListTypeFor() {
51         final ParameterizedType listType = Types.listTypeFor(null);
52         assertEquals("List", listType.getName());
53         assertNotNull(listType);
54     }
55
56     @Test
57     public void testWildcardTypeFor() {
58         final WildcardType wildcardType = Types.wildcardTypeFor("org.opendaylight.yangtools.test", "WildcardTypeTest");
59         assertEquals("WildcardTypeTest", wildcardType.getName());
60         assertNotNull(wildcardType);
61     }
62
63     @Test
64     public void testAugmentableTypeFor() {
65         ParameterizedType augmentableType = Types.augmentableTypeFor(null);
66         assertEquals("Augmentable", augmentableType.getName());
67     }
68
69     @Test
70     public void augmentationTypeFor() {
71         ParameterizedType augmentationType = Types.augmentationTypeFor(null);
72         assertEquals("Augmentation", augmentationType.getName());
73     }
74 }