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;
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
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