assertEquals(multiLeafDesc, ex.evaluate(fType));
}
public static FeatureType createFeatureType() {
FeatureTypeFactory tfac = new UniqueNameFeatureTypeFactoryImpl();
Name fName = new NameImpl(EG, "complexFeatureType");
Collection<PropertyDescriptor> schema = new ArrayList<PropertyDescriptor>();
// add simple attribute
AttributeType attType = new AttributeTypeImpl(SIMPLE_ATTRIBUTE, String.class, false, false,
Collections.EMPTY_LIST, null, null);
AttributeDescriptor attDesc = new AttributeDescriptorImpl(attType, SIMPLE_ATTRIBUTE, 0, 1,
true, null);
schema.add(attDesc);
// build nested attributes
Collection<PropertyDescriptor> rootProperties = new ArrayList<PropertyDescriptor>();
attType = new AttributeTypeImpl(SINGLE_LEAF_ATTRIBUTE, String.class, false, false,
Collections.EMPTY_LIST, null, null);
attDesc = new AttributeDescriptorImpl(attType, SINGLE_LEAF_ATTRIBUTE, 0, 1, true, null);
rootProperties.add(attDesc);
attType = new AttributeTypeImpl(MULTI_LEAF_ATTRIBUTE, String.class, false, false,
Collections.EMPTY_LIST, null, null);
attDesc = new AttributeDescriptorImpl(attType, MULTI_LEAF_ATTRIBUTE, 0, -1, true, null);
rootProperties.add(attDesc);
attType = new ComplexTypeImpl(ROOT_ATTRIBUTE, rootProperties, false, false,
Collections.EMPTY_LIST, null, null);
attDesc = new AttributeDescriptorImpl(attType, ROOT_ATTRIBUTE, 0, -1, true, null);
Collection<PropertyDescriptor> nestedProperties = new ArrayList<PropertyDescriptor>(1);
nestedProperties.add(attDesc);
// add nested properties to complex attribute
attType = new ComplexTypeImpl(COMPLEX_ATTRIBUTE, nestedProperties, false, false,
Collections.EMPTY_LIST, null, null);
attDesc = new AttributeDescriptorImpl(attType, COMPLEX_ATTRIBUTE, 0, -1, true, null);
// add to feature schema
schema.add(attDesc);
return tfac.createFeatureType(fName, schema, null, false, Collections.EMPTY_LIST, null,
null);
}