Search in sources :

Example 46 with XmlSchemaSimpleType

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);
}
Also used : XmlSchema(org.apache.ws.commons.schema.XmlSchema) XmlSchemaElement(org.apache.ws.commons.schema.XmlSchemaElement) XmlSchemaSimpleType(org.apache.ws.commons.schema.XmlSchemaSimpleType) QName(javax.xml.namespace.QName) FeatureMetacardType(org.codice.ddf.spatial.ogc.wfs.catalog.common.FeatureMetacardType) Test(org.junit.Test)

Example 47 with XmlSchemaSimpleType

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);
}
Also used : XmlSchema(org.apache.ws.commons.schema.XmlSchema) XmlSchemaElement(org.apache.ws.commons.schema.XmlSchemaElement) XmlSchemaSimpleType(org.apache.ws.commons.schema.XmlSchemaSimpleType) QName(javax.xml.namespace.QName) FeatureMetacardType(org.codice.ddf.spatial.ogc.wfs.catalog.common.FeatureMetacardType) Test(org.junit.Test)

Example 48 with XmlSchemaSimpleType

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));
}
Also used : XmlSchema(org.apache.ws.commons.schema.XmlSchema) XmlSchemaElement(org.apache.ws.commons.schema.XmlSchemaElement) XmlSchemaSimpleType(org.apache.ws.commons.schema.XmlSchemaSimpleType) QName(javax.xml.namespace.QName) AttributeDescriptor(ddf.catalog.data.AttributeDescriptor) FeatureMetacardType(org.codice.ddf.spatial.ogc.wfs.catalog.common.FeatureMetacardType) Test(org.junit.Test)

Example 49 with XmlSchemaSimpleType

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);
}
Also used : XmlSchema(org.apache.ws.commons.schema.XmlSchema) XmlSchemaElement(org.apache.ws.commons.schema.XmlSchemaElement) XmlSchemaSimpleType(org.apache.ws.commons.schema.XmlSchemaSimpleType) QName(javax.xml.namespace.QName) FeatureMetacardType(org.codice.ddf.spatial.ogc.wfs.catalog.common.FeatureMetacardType) Test(org.junit.Test)

Example 50 with XmlSchemaSimpleType

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);
}
Also used : XmlSchema(org.apache.ws.commons.schema.XmlSchema) XmlSchemaElement(org.apache.ws.commons.schema.XmlSchemaElement) XmlSchemaSimpleType(org.apache.ws.commons.schema.XmlSchemaSimpleType) QName(javax.xml.namespace.QName) FeatureMetacardType(org.codice.ddf.spatial.ogc.wfs.catalog.common.FeatureMetacardType) Test(org.junit.Test)

Aggregations

XmlSchemaSimpleType (org.apache.ws.commons.schema.XmlSchemaSimpleType)60 XmlSchemaElement (org.apache.ws.commons.schema.XmlSchemaElement)44 QName (javax.xml.namespace.QName)38 XmlSchema (org.apache.ws.commons.schema.XmlSchema)31 Test (org.junit.Test)27 FeatureMetacardType (org.codice.ddf.spatial.ogc.wfs.catalog.common.FeatureMetacardType)26 XmlSchemaComplexType (org.apache.ws.commons.schema.XmlSchemaComplexType)20 XmlSchemaType (org.apache.ws.commons.schema.XmlSchemaType)13 XmlSchemaObject (org.apache.ws.commons.schema.XmlSchemaObject)9 XmlSchemaObjectCollection (org.apache.ws.commons.schema.XmlSchemaObjectCollection)9 XmlSchemaGroupBase (org.apache.ws.commons.schema.XmlSchemaGroupBase)8 XmlSchemaParticle (org.apache.ws.commons.schema.XmlSchemaParticle)8 XmlSchemaSimpleTypeRestriction (org.apache.ws.commons.schema.XmlSchemaSimpleTypeRestriction)8 ArrayList (java.util.ArrayList)6 XmlSchemaComplexContentExtension (org.apache.ws.commons.schema.XmlSchemaComplexContentExtension)6 ParameterInfo (org.talend.designer.webservice.ws.wsdlinfo.ParameterInfo)6 AttributeDescriptor (ddf.catalog.data.AttributeDescriptor)4 Iterator (java.util.Iterator)4 List (java.util.List)4 CorbaType (org.apache.cxf.binding.corba.wsdl.CorbaType)4