01: /*
02: * GeoTools - 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: package org.geotools.gml3.bindings;
17:
18: import org.w3c.dom.Document;
19: import org.w3c.dom.Element;
20: import com.vividsolutions.jts.geom.Coordinate;
21: import com.vividsolutions.jts.geom.LineString;
22: import org.geotools.gml3.GML3TestSupport;
23:
24: public class LineStringTypeBindingTest extends GML3TestSupport {
25: public void testPos() throws Exception {
26: document.appendChild(GML3MockData.lineStringWithPos(document,
27: null));
28:
29: LineString line = (LineString) parse();
30: assertNotNull(line);
31:
32: assertEquals(new Coordinate(1d, 2d), line.getPointN(0)
33: .getCoordinate());
34: assertEquals(new Coordinate(3d, 4d), line.getPointN(1)
35: .getCoordinate());
36: }
37:
38: public void testPosList() throws Exception {
39: document.appendChild(GML3MockData.lineStringWithPosList(
40: document, null));
41:
42: LineString line = (LineString) parse();
43: assertNotNull(line);
44:
45: assertEquals(new Coordinate(1d, 2d), line.getPointN(0)
46: .getCoordinate());
47: assertEquals(new Coordinate(3d, 4d), line.getPointN(1)
48: .getCoordinate());
49: }
50: }
|