Package net.opengis.cat.csw20

Examples of net.opengis.cat.csw20.QueryType


        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

        raw.put("outputFormat", "application/xml");
        raw.put("outputSchema", "http://www.opengis.net/cat/csw/2.0.2");

        GetRecordByIdKvpRequestReader reader = new GetRecordByIdKvpRequestReader();
        Object request = reader.createRequest();
        GetRecordByIdType dr = (GetRecordByIdType) reader.read(request, parseKvp(raw), raw);
       
        assertGetRecordByIdValid(dr);
    }
View Full Code Here

    }

    @Test
    public void testXMLReader() throws Exception {
        CSWXmlReader reader = new CSWXmlReader("GetRecordById", "2.0.2", new CSWConfiguration());
        GetRecordByIdType dr = (GetRecordByIdTypereader.read(null, getResourceAsReader("GetRecordById.xml"), (Map) null);
        assertGetRecordByIdValid(dr);
    }
View Full Code Here

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

    @Test
    public void testParseGetRecordsEbrimBrief() throws Exception {
        GetRecordsType gr = (GetRecordsType) parser.parse(getClass().getResourceAsStream(
                "GetRecordsBrief.xml"));
        assertEquals("CSW", gr.getService());
        assertEquals("2.0.2", gr.getVersion());

        // check the attributes
        assertEquals("application/xml", gr.getOutputFormat());
        assertEquals("urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0", gr.getOutputSchema());

        // the query
        QueryType query = (QueryType) gr.getQuery();
        List<QName> expected = new ArrayList<QName>();
        String rimNamespace = "urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0";
        expected.add(new QName(rimNamespace, "Service"));
        expected.add(new QName(rimNamespace, "Classification"));
        expected.add(new QName(rimNamespace, "Association"));
View Full Code Here

        assertEquals(SortOrder.DESCENDING, sorts[1].getSortOrder());
    }

    @Test
    public void testParseGetRecordsFilterSimple() throws Exception {
        GetRecordsType gr = (GetRecordsType) parser.parse(getClass().getResourceAsStream(
                "GetRecordsFilterSimple.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());
        assertEquals(new Integer(1), gr.getStartPosition());
        assertEquals(new Integer(5), gr.getMaxRecords());
        assertEquals(ResultType.RESULTS, gr.getResultType());

        // the query
        QueryType query = (QueryType) gr.getQuery();
        List<QName> expected = new ArrayList<QName>();
        expected.add(new QName("http://www.opengis.net/cat/csw/2.0.2", "Record"));
        assertEquals(expected, query.getTypeNames());

        // the element names
View Full Code Here

TOP

Related Classes of net.opengis.cat.csw20.QueryType

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.