svn-gvsig-desktop / trunk / extensions / extGPE-gvSIG / src-test / org / gvsig / fmap / drivers / gpe / kml / KmlGorlizTest.java @ 37959
History | View | Annotate | Download (2.83 KB)
1 |
package org.gvsig.fmap.drivers.gpe.kml; |
---|---|
2 |
|
3 |
import java.io.File; |
4 |
import java.io.FileNotFoundException; |
5 |
import java.io.IOException; |
6 |
|
7 |
import org.gvsig.fmap.drivers.gpe.reader.GMLVectorialDriver; |
8 |
import org.gvsig.fmap.drivers.gpe.reader.KMLVectorialDriver; |
9 |
import org.gvsig.fmap.drivers.gpe.reader.v2.GPEParserTest; |
10 |
import org.gvsig.gpe.GPERegister; |
11 |
|
12 |
import com.hardcode.gdbms.driver.exceptions.ReadDriverException; |
13 |
import com.iver.cit.gvsig.fmap.crs.CRSFactory; |
14 |
import com.iver.cit.gvsig.fmap.drivers.DriverIOException; |
15 |
import com.iver.cit.gvsig.fmap.layers.FLyrVect; |
16 |
import com.iver.cit.gvsig.fmap.layers.LayerFactory; |
17 |
|
18 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
19 |
*
|
20 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
21 |
*
|
22 |
* This program is free software; you can redistribute it and/or
|
23 |
* modify it under the terms of the GNU General Public License
|
24 |
* as published by the Free Software Foundation; either version 2
|
25 |
* of the License, or (at your option) any later version.
|
26 |
*
|
27 |
* This program is distributed in the hope that it will be useful,
|
28 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
29 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
30 |
* GNU General Public License for more details.
|
31 |
*
|
32 |
* You should have received a copy of the GNU General Public License
|
33 |
* along with this program; if not, write to the Free Software
|
34 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
35 |
*
|
36 |
* For more information, contact:
|
37 |
*
|
38 |
* Generalitat Valenciana
|
39 |
* Conselleria d'Infraestructures i Transport
|
40 |
* Av. Blasco Ib??ez, 50
|
41 |
* 46010 VALENCIA
|
42 |
* SPAIN
|
43 |
*
|
44 |
* +34 963862235
|
45 |
* gvsig@gva.es
|
46 |
* www.gvsig.gva.es
|
47 |
*
|
48 |
* or
|
49 |
*
|
50 |
* IVER T.I. S.A
|
51 |
* Salamanca 50
|
52 |
* 46005 Valencia
|
53 |
* Spain
|
54 |
*
|
55 |
* +34 963163400
|
56 |
* dac@iver.es
|
57 |
*/
|
58 |
/* CVS MESSAGES:
|
59 |
*
|
60 |
* $Id$
|
61 |
* $Log$
|
62 |
*
|
63 |
*/
|
64 |
/**
|
65 |
* @author Jorge Piera LLodr? (jorge.piera@iver.es)
|
66 |
*/
|
67 |
public class KmlGorlizTest extends GPEParserTest { |
68 |
|
69 |
protected KMLVectorialDriver driver;
|
70 |
private FLyrVect layer = null; |
71 |
|
72 |
/*
|
73 |
* (non-Javadoc)
|
74 |
* @see com.iver.cit.gvsig.fmap.drivers.gpe.GPEDriverTest#getFile()
|
75 |
*/
|
76 |
public String getFile() { |
77 |
return "../extGPE-gvSIG" + File.separatorChar + |
78 |
"testdata" + File.separatorChar + "gorliz.kml"; |
79 |
} |
80 |
|
81 |
/*
|
82 |
* (non-Javadoc)
|
83 |
* @see com.iver.cit.gvsig.fmap.drivers.gpe.GPEDriverTest#makeAsserts()
|
84 |
*/
|
85 |
public void makeAsserts() throws DriverIOException, ReadDriverException { |
86 |
assertEquals(getLayer().getSource().getShapeCount(),1);
|
87 |
} |
88 |
|
89 |
public void setUp() throws FileNotFoundException, IOException{ |
90 |
GPERegister.addParsersFile(new File(gpeDriversFile)); |
91 |
driver = new KMLVectorialDriver();
|
92 |
driver.open(new File(getFile())); |
93 |
} |
94 |
|
95 |
public FLyrVect getLayer(){
|
96 |
if (layer == null){ |
97 |
layer = (FLyrVect)LayerFactory.createLayer("Test", driver, CRSFactory.getCRS("EPSG:4326")); |
98 |
} |
99 |
return layer;
|
100 |
} |
101 |
|
102 |
|
103 |
} |