Package net.opengis.cat.csw20.impl

Examples of net.opengis.cat.csw20.impl.UpdateTypeImpl


    private ElementSetType getElementSet(QueryType query) {
        if(query.getElementName() != null && query.getElementName().size() > 0) {
            return ElementSetType.FULL;
        }
        ElementSetType elementSet = query.getElementSetName() != null ? query.getElementSetName().getValue() : null;
        if(elementSet == null) {
            // the default is "summary"
            elementSet = ElementSetType.SUMMARY;
        }
        return elementSet;
View Full Code Here


    Parser parser = new Parser(new CSWConfiguration());

    @Test
    public void testParseCapabilitiesRequest() throws Exception {
        String capRequestPath = "GetCapabilities.xml";
        GetCapabilitiesType caps = (GetCapabilitiesType) parser.parse(getClass().getResourceAsStream(capRequestPath));
        assertEquals("CSW", caps.getService());
       
        List versions = caps.getAcceptVersions().getVersion();
        assertEquals("2.0.2", versions.get(0));
        assertEquals("2.0.0", versions.get(1));
        assertEquals("0.7.2", versions.get(2));
       
        List sections = caps.getSections().getSection();
        assertEquals("OperationsMetadata", sections.get(0));
    }
View Full Code Here

public class GetDomainTest {
    Parser parser = new Parser(new CSWConfiguration());
   
    @Test
    public void testParseGetDomainParameter() throws Exception {
        GetDomainType gd = (GetDomainType) parser.parse(getClass().getResourceAsStream(
                "GetDomainParameter.xml"));
        // check the attributes
        assertEquals("CSW", gd.getService());
        assertEquals("2.0.2", gd.getVersion());
       
        assertEquals("GetRecords.outputFormat", gd.getParameterName());
    }
View Full Code Here

        assertEquals("GetRecords.outputFormat", gd.getParameterName());
    }
   
    @Test
    public void testParseGetDomainProperty() throws Exception {
        GetDomainType gd = (GetDomainType) parser.parse(getClass().getResourceAsStream(
                "GetDomainProperty.xml"));
        // check the attributes
        assertEquals("CSW", gd.getService());
        assertEquals("2.0.2", gd.getVersion());
       
        assertEquals("foo", gd.getPropertyName());
    }
View Full Code Here

        raw.put("request", "GetDomain");
        raw.put("parameterName", "GetRecords.resultType");

        GetDomainKvpRequestReader reader = new GetDomainKvpRequestReader();
        Object request = reader.createRequest();
        GetDomainType gd = (GetDomainType) reader.read(request, parseKvp(raw), raw);

        assertEquals("CSW", gd.getService());
        assertEquals("2.0.2", gd.getVersion());
        assertEquals("GetRecords.resultType", gd.getParameterName());
    }
View Full Code Here

        raw.put("request", "GetDomain");
        raw.put("propertyName", "dc:title");

        GetDomainKvpRequestReader reader = new GetDomainKvpRequestReader();
        Object request = reader.createRequest();
        GetDomainType gd = (GetDomainType) reader.read(request, parseKvp(raw), raw);

        assertEquals("CSW", gd.getService());
        assertEquals("2.0.2", gd.getVersion());
        assertEquals("dc:title", gd.getPropertyName());
    }
View Full Code Here

    }

    @Test
    public void testXMLReaderParameter() throws Exception {
        CSWXmlReader reader = new CSWXmlReader("GetDomain", "2.0.2", new CSWConfiguration());
        GetDomainType gd = (GetDomainType) reader.read(null,
                getResourceAsReader("GetDomainParameter.xml"), (Map) null);
        assertEquals("CSW", gd.getService());
        assertEquals("2.0.2", gd.getVersion());
        assertEquals("GetRecords.resultType", gd.getParameterName());
    }
View Full Code Here

    }

    @Test
    public void testXMLReaderProperty() throws Exception {
        CSWXmlReader reader = new CSWXmlReader("GetDomain", "2.0.2", new CSWConfiguration());
        GetDomainType gd = (GetDomainType) reader.read(null,
                getResourceAsReader("GetDomainProperty.xml"), (Map) null);
        assertEquals("CSW", gd.getService());
        assertEquals("2.0.2", gd.getVersion());
        assertEquals("dc:title", gd.getPropertyName());
    }
View Full Code Here

        assertEquals(new URI("REC-12"), ids.get(2));
    }
   
    @Test
    public void testParseGetRecordsByIdResponse() throws Exception {
        GetRecordByIdResponseType response = (GetRecordByIdResponseType) parser.parse(getClass().getResourceAsStream(
                "GetRecordByIdResponse.xml"));
        assertNotNull(response);
        EList<AbstractRecordType> records = response.getAbstractRecord();
        assertEquals(1, records.size());
        RecordType record = (RecordType) records.get(0);
    }
View Full Code Here

        assertEquals(filter, constraint.getFilter());
    }

    @Test
    public void testParseGetRecordsById() throws Exception {
        GetRecordByIdType gr = (GetRecordByIdType) parser.parse(getClass().getResourceAsStream(
                "GetRecordById.xml"));
        // check the attributes
        assertEquals("CSW", gr.getService());
        assertEquals("2.0.2", gr.getVersion());
        assertEquals("application/xml", gr.getOutputFormat());
        assertEquals("http://www.opengis.net/cat/csw/2.0.2", gr.getOutputSchema());
       
        // the element set name
        ElementSetNameType esn = gr.getElementSetName();
        assertEquals(ElementSetType.SUMMARY, esn.getValue());
       
        // the ids
        List<URI> ids = gr.getId();
        assertEquals(new URI("REC-10"), ids.get(0));
        assertEquals(new URI("REC-11"), ids.get(1));
        assertEquals(new URI("REC-12"), ids.get(2));
    }
View Full Code Here

TOP

Related Classes of net.opengis.cat.csw20.impl.UpdateTypeImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.