*/
package org.opendaylight.mdsal.binding.model.ri;
+import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThrows;
import org.opendaylight.yangtools.yang.binding.BaseIdentity;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.DataRoot;
-import org.opendaylight.yangtools.yang.binding.Identifiable;
-import org.opendaylight.yangtools.yang.binding.Identifier;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.Key;
+import org.opendaylight.yangtools.yang.binding.KeyAware;
import org.opendaylight.yangtools.yang.binding.Notification;
-import org.opendaylight.yangtools.yang.binding.NotificationListener;
-import org.opendaylight.yangtools.yang.binding.RpcService;
public class BindingTypesTest {
@Test
assertEquals("BASE_IDENTITY", typeForClass(BaseIdentity.class), BindingTypes.BASE_IDENTITY);
assertEquals("DATA_OBJECT", typeForClass(DataObject.class), BindingTypes.DATA_OBJECT);
assertEquals("DATA_ROOT", typeForClass(DataRoot.class), BindingTypes.DATA_ROOT);
- assertEquals("IDENTIFIABLE", typeForClass(Identifiable.class), BindingTypes.IDENTIFIABLE);
- assertEquals("IDENTIFIER", typeForClass(Identifier.class), BindingTypes.IDENTIFIER);
+ assertEquals("KEY_AWARE", typeForClass(KeyAware.class), BindingTypes.KEY_AWARE);
+ assertEquals("KEY", typeForClass(Key.class), BindingTypes.KEY);
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("RPC_SERVICE", typeForClass(RpcService.class), BindingTypes.RPC_SERVICE);
}
@Test
final ParameterizedType augmentationType = BindingTypes.augmentation(Types.objectType());
assertEquals("Augmentation", augmentationType.getName());
}
+
+ @Test
+ public void testNotificationNull() {
+ assertThrows(NullPointerException.class, () -> BindingTypes.notification(null));
+ }
+
+ @Test
+ public void testNotification() {
+ final ParameterizedType notificationType = BindingTypes.notification(Types.objectType());
+ assertEquals(Types.typeForClass(Notification.class), notificationType.getRawType());
+ assertArrayEquals(new Object[] { Types.objectType() }, notificationType.getActualTypeArguments());
+ }
}
\ No newline at end of file