01: /*
02: * Geotools2 - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2002-2006, Geotools Project Managment Committee (PMC)
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation;
09: * version 2.1 of the License.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: */
17: package org.geotools.data.shapefile.shp.xml;
18:
19: import java.net.URL;
20:
21: import junit.framework.TestCase;
22:
23: import org.geotools.data.FeatureSource;
24: import org.geotools.data.Query;
25: import org.geotools.data.shapefile.ShapefileDataStore;
26: import org.geotools.TestData;
27:
28: import com.vividsolutions.jts.geom.Envelope;
29:
30: public class ShpXmlFileReaderTest extends TestCase {
31: ShpXmlFileReader reader;
32:
33: protected void setUp() throws Exception {
34: super .setUp();
35: URL example = TestData.url(this , "example.shp.xml");
36: reader = new ShpXmlFileReader(example);
37: }
38:
39: public void testBBox() {
40: Metadata meta = reader.parse();
41: assertNotNull("meta", meta);
42: IdInfo idInfo = meta.getIdinfo();
43: assertNotNull("idInfo", idInfo);
44: Envelope bounding = idInfo.getBounding();
45: assertNotNull(bounding);
46: assertEquals(-180.0, bounding.getMinX(), 0.00001);
47: assertEquals(180.0, bounding.getMaxX(), 0.00001);
48: assertEquals(-90.0, bounding.getMinY(), 0.00001);
49: assertEquals(90.0, bounding.getMaxY(), 0.00001);
50: }
51: }
|