X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=binding%2Fmdsal-binding-generator-util%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fmdsal%2Fbinding%2Fmodel%2Futil%2FBindingTypesTest.java;h=f271337f9f897e485c1c37a0059a6a15ff1ce2dd;hb=34bda8712a3306d2f0bfe5d85f70d4cbd9b6f407;hp=4dd4f2766030d9712584530ae06f56fad3170553;hpb=0f351bbc28ddf2cddfe30c8d018646d81953fa17;p=mdsal.git diff --git a/binding/mdsal-binding-generator-util/src/test/java/org/opendaylight/mdsal/binding/model/util/BindingTypesTest.java b/binding/mdsal-binding-generator-util/src/test/java/org/opendaylight/mdsal/binding/model/util/BindingTypesTest.java index 4dd4f27660..f271337f9f 100644 --- a/binding/mdsal-binding-generator-util/src/test/java/org/opendaylight/mdsal/binding/model/util/BindingTypesTest.java +++ b/binding/mdsal-binding-generator-util/src/test/java/org/opendaylight/mdsal/binding/model/util/BindingTypesTest.java @@ -12,6 +12,7 @@ import static org.junit.Assert.assertNotNull; import static org.opendaylight.mdsal.binding.model.util.Types.typeForClass; import org.junit.Test; +import org.opendaylight.mdsal.binding.model.api.ParameterizedType; import org.opendaylight.yangtools.yang.binding.Augmentable; import org.opendaylight.yangtools.yang.binding.Augmentation; import org.opendaylight.yangtools.yang.binding.BaseIdentity; @@ -37,7 +38,8 @@ 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); } @@ -53,11 +55,23 @@ public class BindingTypesTest { @Test public void testAugmentable() { - assertNotNull(BindingTypes.augmentable(Types.objectType())); + ParameterizedType augmentableType = BindingTypes.augmentable(Types.objectType()); + assertEquals("Augmentable", augmentableType.getName()); } @Test public void testChildOf() { 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