use of org.apache.ws.commons.schema.XmlSchemaSimpleType in project ddf by codice.
the class FeatureMetacardTypeTest method testfeatureMetacardTypeFindIntegerProperties.
@Test
public void testfeatureMetacardTypeFindIntegerProperties() {
XmlSchema schema = new XmlSchema();
XmlSchemaElement integerElement = new XmlSchemaElement(schema, true);
integerElement.setSchemaType(new XmlSchemaSimpleType(schema, false));
integerElement.setSchemaTypeName(Constants.XSD_INTEGER);
integerElement.setName(ELEMENT_NAME_1);
XmlSchemaElement intElement = new XmlSchemaElement(schema, true);
intElement.setSchemaType(new XmlSchemaSimpleType(schema, false));
intElement.setSchemaTypeName(Constants.XSD_INT);
intElement.setName(ELEMENT_NAME_2);
XmlSchemaElement positivieIntegerElement = new XmlSchemaElement(schema, true);
positivieIntegerElement.setSchemaType(new XmlSchemaSimpleType(schema, false));
positivieIntegerElement.setSchemaTypeName(Constants.XSD_POSITIVEINTEGER);
positivieIntegerElement.setName(ELEMENT_NAME_3);
schema.getElements().put(new QName(ELEMENT_NAME_1), integerElement);
schema.getElements().put(new QName(ELEMENT_NAME_2), intElement);
schema.getElements().put(new QName(ELEMENT_NAME_3), positivieIntegerElement);
FeatureMetacardType featureMetacardType = new FeatureMetacardType(schema, FEATURE_TYPE, NON_QUERYABLE_PROPS, Wfs20Constants.GML_3_2_NAMESPACE);
assertAttributeDescriptor(featureMetacardType, ELEMENT_NAME_1, BasicTypes.STRING_TYPE);
assertAttributeDescriptor(featureMetacardType, ELEMENT_NAME_2, BasicTypes.INTEGER_TYPE);
assertAttributeDescriptor(featureMetacardType, ELEMENT_NAME_3, BasicTypes.STRING_TYPE);
}
use of org.apache.ws.commons.schema.XmlSchemaSimpleType in project ddf by codice.
the class FeatureMetacardTypeTest method testfeatureMetacardTypeFindBooleanProperties.
@Test
public void testfeatureMetacardTypeFindBooleanProperties() {
XmlSchema schema = new XmlSchema();
XmlSchemaElement booleanElement = new XmlSchemaElement(schema, true);
booleanElement.setSchemaType(new XmlSchemaSimpleType(schema, false));
booleanElement.setSchemaTypeName(Constants.XSD_BOOLEAN);
booleanElement.setName(ELEMENT_NAME_1);
schema.getElements().put(new QName(ELEMENT_NAME_1), booleanElement);
FeatureMetacardType featureMetacardType = new FeatureMetacardType(schema, FEATURE_TYPE, NON_QUERYABLE_PROPS, Wfs20Constants.GML_3_2_NAMESPACE);
assertAttributeDescriptor(featureMetacardType, ELEMENT_NAME_1, BasicTypes.BOOLEAN_TYPE);
}
use of org.apache.ws.commons.schema.XmlSchemaSimpleType in project ddf by codice.
the class FeatureMetacardTypeTest method testFeatureMetacardTypeFindTaxonomyMetacardAttributes.
@Test
public void testFeatureMetacardTypeFindTaxonomyMetacardAttributes() {
XmlSchema schema = new XmlSchema();
XmlSchemaElement element = new XmlSchemaElement(schema, true);
element.setSchemaType(new XmlSchemaSimpleType(schema, false));
element.setSchemaTypeName(Constants.XSD_STRING);
element.setName(ELEMENT_NAME);
schema.getElements().put(new QName(ELEMENT_NAME), element);
FeatureMetacardType fmt = new FeatureMetacardType(schema, FEATURE_TYPE, NON_QUERYABLE_PROPS, Wfs20Constants.GML_3_2_NAMESPACE);
Set<AttributeDescriptor> descriptors = initDescriptors();
for (AttributeDescriptor ad : descriptors) {
assertBasicAttributeDescriptor(fmt, ad.getName(), ad.getType());
assertFalse(fmt.getAttributeDescriptor(ad.getName()).isStored());
}
// +1 to account for one element added to schema.
assertThat(fmt.getAttributeDescriptors().size(), is(descriptors.size() + 1));
}
use of org.apache.ws.commons.schema.XmlSchemaSimpleType in project ddf by codice.
the class FeatureMetacardTypeTest method testfeatureMetacardTypeFindShortProperties.
@Test
public void testfeatureMetacardTypeFindShortProperties() {
XmlSchema schema = new XmlSchema();
XmlSchemaElement shortElement = new XmlSchemaElement(schema, true);
shortElement.setSchemaType(new XmlSchemaSimpleType(schema, false));
shortElement.setSchemaTypeName(Constants.XSD_SHORT);
shortElement.setName(ELEMENT_NAME_1);
schema.getElements().put(new QName(ELEMENT_NAME_1), shortElement);
FeatureMetacardType featureMetacardType = new FeatureMetacardType(schema, FEATURE_TYPE, NON_QUERYABLE_PROPS, Wfs20Constants.GML_3_2_NAMESPACE);
assertAttributeDescriptor(featureMetacardType, ELEMENT_NAME_1, BasicTypes.SHORT_TYPE);
}
use of org.apache.ws.commons.schema.XmlSchemaSimpleType in project ddf by codice.
the class FeatureMetacardTypeTest method testfeatureMetacardTypeFindLongProperties.
@Test
public void testfeatureMetacardTypeFindLongProperties() {
XmlSchema schema = new XmlSchema();
XmlSchemaElement longElement = new XmlSchemaElement(schema, true);
longElement.setSchemaType(new XmlSchemaSimpleType(schema, false));
longElement.setSchemaTypeName(Constants.XSD_LONG);
longElement.setName(ELEMENT_NAME_1);
schema.getElements().put(new QName(ELEMENT_NAME_1), longElement);
FeatureMetacardType featureMetacardType = new FeatureMetacardType(schema, FEATURE_TYPE, NON_QUERYABLE_PROPS, Wfs20Constants.GML_3_2_NAMESPACE);
assertAttributeDescriptor(featureMetacardType, ELEMENT_NAME_1, BasicTypes.LONG_TYPE);
}
Aggregations