Examples of CSWConfiguration


Examples of org.geotools.csw.CSWConfiguration

        assertEquals("dc:title", gd.getPropertyName());
    }

    @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

Examples of org.geotools.csw.CSWConfiguration

        assertEquals("GetRecords.resultType", gd.getParameterName());
    }

    @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

Examples of org.geotools.csw.CSWConfiguration

        assertEquals("text/plain", outputFormats.get(1));
    }

    @Test
    public void testXMLReader() throws Exception {
        CSWXmlReader reader = new CSWXmlReader("GetCapabilities", "2.0.2", new CSWConfiguration());
        GetCapabilitiesType caps = (GetCapabilitiesType) reader.read(null,
                getResourceAsReader("GetCapabilities.xml"), (Map) null);
        assertReturnedCapabilitiesComplete(caps);
    }
View Full Code Here

Examples of org.geotools.csw.CSWConfiguration

        // create a schema invalid request
        String capRequest = getResourceAsString("GetCapabilities.xml");
        capRequest = capRequest.replace("ows:Sections", "ows:foo");
        try {
            CSWXmlReader reader = new CSWXmlReader("GetCapabilities", "2.0.2",
                    new CSWConfiguration());
            reader.read(null, new StringReader(capRequest), (Map) null);
            fail("the parsing should have failed, the document is invalid");
        } catch (ServiceException e) {
            // it is a validation exception right?
            assertTrue(e.getCause() instanceof SAXParseException);
View Full Code Here

Examples of org.geotools.csw.CSWConfiguration

        assertDescribeRecordValid(dr);
    }

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

Examples of org.geotools.csw.CSWConfiguration

    @Test
    public void testAllRecordsWithOffset() throws Exception {
        String request = "csw?service=CSW&version=2.0.2&request=GetRecords&typeNames=csw:Record&resultType=results&StartPosition=11&elementSetName=full";
        Document d = getAsDOM(request);
        //print(d);
        checkValidationErrors(d, new CSWConfiguration());

        // check we have the right kind of document
        assertXpathEvaluatesTo("1", "count(/csw:GetRecordsResponse)", d);

        // check we have the expected results
View Full Code Here

Examples of org.geotools.csw.CSWConfiguration

    @Test
    public void testAllRecordsWithMax() throws Exception {
        String request = "csw?service=CSW&version=2.0.2&request=GetRecords&typeNames=csw:Record&resultType=results&StartPosition=11&maxRecords=5&elementSetName=full";
        Document d = getAsDOM(request);
        //print(d);
        checkValidationErrors(d, new CSWConfiguration());

        // check we have the right kind of document
        assertXpathEvaluatesTo("1", "count(/csw:GetRecordsResponse)", d);

        // check we have the expected results
View Full Code Here

Examples of org.geotools.csw.CSWConfiguration

    @Test
    public void testFullTextSearch() throws Exception {
        String request = "csw?service=CSW&version=2.0.2&request=GetRecords&typeNames=csw:Record&resultType=results&elementSetName=brief&constraint=AnyText like '%25about B%25'";
        Document d = getAsDOM(request);
        checkValidationErrors(d, new CSWConfiguration());
        print(d);

        // basic checks
        assertXpathEvaluatesTo("3", "//csw:SearchResults/@numberOfRecordsMatched", d);
        assertXpathEvaluatesTo("3", "//csw:SearchResults/@numberOfRecordsReturned", d);
View Full Code Here

Examples of org.geotools.csw.CSWConfiguration

    public void testFilterBBox() throws Exception {

        String request = "csw?service=CSW&version=2.0.2&request=GetRecords&typeNames=csw:Record&resultType=results"
                + "&constraint=BBOX(ows:BoundingBox, -250, -250, -190, -100)&maxRecords=100";
        Document d = getAsDOM(request);
        checkValidationErrors(d, new CSWConfiguration());
        //print(d);

        // basic checks
        //assertXpathEvaluatesTo("15", "//csw:SearchResults/@numberOfRecordsMatched", d);
        //assertXpathEvaluatesTo("10", "//csw:SearchResults/@numberOfRecordsReturned", d);
View Full Code Here

Examples of org.geotools.csw.CSWConfiguration

    public SimpleRecordIterator(File root, int offset) {
        File[] fileArray = root.listFiles((FilenameFilter) new SuffixFileFilter(".xml",
                IOCase.INSENSITIVE));
        files = Arrays.asList(fileArray).iterator();
        parser = new Parser(new CSWConfiguration());
        this.offset = offset;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.