001: /*
002: * GeoTools - OpenSource mapping toolkit
003: * http://geotools.org
004: * (C) 2004-2006, Geotools Project Managment Committee (PMC)
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or (at your option) any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: */
016: package org.geotools.data.wfs;
017:
018: import java.io.File;
019: import java.net.URI;
020: import java.util.logging.Level;
021:
022: import junit.framework.TestCase;
023:
024: import org.geotools.test.TestData;
025: import org.geotools.xml.DocumentFactory;
026: import org.xml.sax.SAXException;
027:
028: /**
029: * <p>
030: * DOCUMENT ME!
031: * </p>
032: * @
033: *
034: * @author dzwiers www.refractions.net
035: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/plugin/wfs/src/test/java/org/geotools/data/wfs/WFSGetCapabilitiesTest.java $
036: */
037: public class WFSGetCapabilitiesTest extends TestCase {
038: public void testGeomatics() {
039: try {
040: String path = "geomatics-wfs-getCapabilities.xml";
041:
042: File f = TestData.file(this , path);
043: URI u = f.toURI();
044:
045: Object doc = DocumentFactory.getInstance(u, null,
046: Level.WARNING);
047:
048: assertNotNull("Document missing", doc);
049: System.out.println(doc);
050:
051: } catch (SAXException e) {
052: e.printStackTrace();
053: fail(e.toString());
054: } catch (Throwable e) {
055: e.printStackTrace();
056: fail(e.toString());
057: }
058: }
059:
060: public void testMapServer() {
061: try {
062: String path = "mswfs_gmap-getCapabilities.xml";
063:
064: File f = TestData.file(this , path);
065: URI u = f.toURI();
066:
067: Object doc = DocumentFactory.getInstance(u, null,
068: Level.WARNING);
069:
070: assertNotNull("Document missing", doc);
071: System.out.println(doc);
072:
073: } catch (SAXException e) {
074: e.printStackTrace();
075: fail(e.toString());
076: } catch (Throwable e) {
077: e.printStackTrace();
078: fail(e.toString());
079: }
080: }
081:
082: public void testGaldos() {
083: try {
084: String path = "galdos-http-getCapabilities.xml";
085:
086: File f = TestData.file(this , path);
087: URI u = f.toURI();
088:
089: Object doc = DocumentFactory.getInstance(u, null,
090: Level.WARNING);
091:
092: assertNotNull("Document missing", doc);
093: System.out.println(doc);
094:
095: } catch (SAXException e) {
096: e.printStackTrace();
097: fail(e.toString());
098: } catch (Throwable e) {
099: e.printStackTrace();
100: fail(e.toString());
101: }
102: }
103:
104: public void testIonic() {
105: try {
106: String path = "ionic-wfs-getCapabilities.xml";
107:
108: File f = TestData.file(this , path);
109: URI u = f.toURI();
110:
111: Object doc = DocumentFactory.getInstance(u, null,
112: Level.WARNING);
113:
114: assertNotNull("Document missing", doc);
115: System.out.println(doc);
116:
117: } catch (SAXException e) {
118: e.printStackTrace();
119: fail(e.toString());
120: } catch (Throwable e) {
121: e.printStackTrace();
122: fail(e.toString());
123: }
124: }
125: }
|