/**
* explicitly defines all attributes.
*/
@Test
public void attributes() {
ModelDeclaration model = analyze(new String[] {
"@directio.hive.orc(",
" table_name = 'attributes_test',",
" field_mapping = 'name',",
" on_missing_source = 'ignore',",
" on_missing_target = 'fail',",
" on_incompatible_type = 'logging',",
" format_version = '0.11',",
" compression = 'zlib',",
" stripe_size = 123456789,",
")",
"model = { simple : INT; };"
}).findModelDeclaration("model");
OrcFileTrait trait = model.getTrait(OrcFileTrait.class);
assertThat(trait, is(notNullValue()));
assertThat(trait.getOriginalAst(), is(notNullValue()));
assertThat(trait.getTableName(), is("attributes_test"));
assertThat(trait.configuration().getFieldMappingStrategy(), is(FieldMappingStrategy.NAME));
assertThat(trait.configuration().getOnMissingSource(), is(ExceptionHandlingStrategy.IGNORE));