Add BindingTypes.augmentation()
[mdsal.git] / binding / mdsal-binding-generator-util / src / test / java / org / opendaylight / mdsal / binding / model / util / BindingTypesTest.java
index 181e7818a2c01daf6b65a1e7da414a49535eee09..f271337f9f897e485c1c37a0059a6a15ff1ce2dd 100644 (file)
@@ -38,19 +38,40 @@ public class BindingTypesTest {
         assertEquals("IDENTIFIER", typeForClass(Identifier.class), BindingTypes.IDENTIFIER);
         assertEquals("INSTANCE_IDENTIFIER", typeForClass(InstanceIdentifier.class), BindingTypes.INSTANCE_IDENTIFIER);
         assertEquals("NOTIFICATION", typeForClass(Notification.class), BindingTypes.NOTIFICATION);
-        assertEquals("NOTIFICATION_LISTENER", typeForClass(NotificationListener.class), BindingTypes.NOTIFICATION_LISTENER);
+        assertEquals("NOTIFICATION_LISTENER", typeForClass(NotificationListener.class),
+            BindingTypes.NOTIFICATION_LISTENER);
         assertEquals("RPC_SERVICE", typeForClass(RpcService.class), BindingTypes.RPC_SERVICE);
     }
 
+    @Test(expected = NullPointerException.class)
+    public void testAugmentableNull() {
+        BindingTypes.augmentable(null);
+    }
+
+    @Test(expected = NullPointerException.class)
+    public void testChildOfNull() {
+        BindingTypes.childOf(null);
+    }
+
     @Test
     public void testAugmentable() {
-        ParameterizedType augmentType = BindingTypes.augmentable(null);
-        assertNotNull(augmentType);
+        ParameterizedType augmentableType = BindingTypes.augmentable(Types.objectType());
+        assertEquals("Augmentable", augmentableType.getName());
     }
 
     @Test
     public void testChildOf() {
-        ParameterizedType childOfType = BindingTypes.childOf(null);
-        assertNotNull(childOfType);
+        assertNotNull(BindingTypes.childOf(Types.objectType()));
+    }
+
+    @Test(expected = NullPointerException.class)
+    public void testAugmentationNull() {
+        BindingTypes.augmentation(null);
+    }
+
+    @Test
+    public void testAugmentation() {
+        ParameterizedType augmentationType = BindingTypes.augmentation(Types.objectType());
+        assertEquals("Augmentation", augmentationType.getName());
     }
 }
\ No newline at end of file