"@directio.hive.orc",
"model = {",
" simple : INT;",
"};"
});
DataModelDescriptor descriptor = descriptor(loader, "ModelDescriptorFactory");
assertThat(descriptor.createDataModelObject(), instanceOf(loader.modelType("Model")));
assertThat(descriptor.getDataModelComment(), is(nullValue()));
assertThat(descriptor.getPropertyDescriptors(), hasSize(1));
PropertyDescriptor property = descriptor.findPropertyDescriptor("simple");
assertThat(property, is(notNullValue()));
assertThat(property.getFieldName(), is("simple"));
assertThat(property.getTypeInfo(), is((TypeInfo) TypeInfoFactory.intTypeInfo));
assertThat(property.getFieldComment(), is(nullValue()));
HiveTable table = descriptor.getDataModelClass().getAnnotation(HiveTable.class);
assertThat(table, is(notNullValue()));
Class<? extends HiveTableInfo>[] infos = table.value();
assertThat(infos, arrayWithSize(1));
HiveTableInfo info = infos[0].newInstance();
assertThat(info.getTableName(), is("model"));
Method simple = descriptor.getDataModelClass().getMethod("getSimpleOption");
HiveField field = simple.getAnnotation(HiveField.class);
assertThat(field, is(notNullValue()));
assertThat(field.name(), is("simple"));
assertThat(field.type(), is("int"));
assertThat(field.ignore(), is(false));