Statistics
| Revision:

svn-gvsig-desktop / branches / v10 / extensions / extGPE-gvSIG / src-test / org / gvsig / fmap / drivers / gpe / writer / v2 / GPEGMLToGMLWriterTest.java @ 18292

History | View | Annotate | Download (2.6 KB)

1
package org.gvsig.fmap.drivers.gpe.writer.v2;
2

    
3
import java.io.File;
4

    
5
import org.gvsig.fmap.drivers.gpe.handlers.DefaultFmapContentHandler;
6
import org.gvsig.fmap.drivers.gpe.handlers.FmapErrorHandler;
7
import org.gvsig.fmap.drivers.gpe.handlers.FmapHandlerFactory;
8
import org.gvsig.fmap.drivers.gpe.reader.GMLVectorialDriver;
9
import org.gvsig.gpe.GPEParser;
10
import org.gvsig.gpe.GPERegister;
11

    
12
import com.iver.cit.gvsig.fmap.MapControl;
13
import com.iver.cit.gvsig.fmap.layers.FLayer;
14

    
15
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
16
 *
17
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
18
 *
19
 * This program is free software; you can redistribute it and/or
20
 * modify it under the terms of the GNU General Public License
21
 * as published by the Free Software Foundation; either version 2
22
 * of the License, or (at your option) any later version.
23
 *
24
 * This program is distributed in the hope that it will be useful,
25
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
27
 * GNU General Public License for more details.
28
 *
29
 * You should have received a copy of the GNU General Public License
30
 * along with this program; if not, write to the Free Software
31
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
32
 *
33
 * For more information, contact:
34
 *
35
 *  Generalitat Valenciana
36
 *   Conselleria d'Infraestructures i Transport
37
 *   Av. Blasco Ib??ez, 50
38
 *   46010 VALENCIA
39
 *   SPAIN
40
 *
41
 *      +34 963862235
42
 *   gvsig@gva.es
43
 *      www.gvsig.gva.es
44
 *
45
 *    or
46
 *
47
 *   IVER T.I. S.A
48
 *   Salamanca 50
49
 *   46005 Valencia
50
 *   Spain
51
 *
52
 *   +34 963163400
53
 *   dac@iver.es
54
 */
55
/* CVS MESSAGES:
56
 *
57
 * $Id$
58
 * $Log$
59
 *
60
 */
61
/**
62
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
63
 */
64
public class GPEGMLToGMLWriterTest extends GPEWriterTest{
65
        private String sFile = "../extGPE-gvSIG" + File.separatorChar +
66
        "testdata" + File.separatorChar + "GML-lines.gml";
67

    
68
        protected FLayer getLayerToWrite() throws Exception{
69
                MapControl mapControl = new MapControl();
70
                mapControl.setMapContext(getMapContext());
71
                FmapErrorHandler errorHandler = FmapHandlerFactory.createErrorHandler();
72
                DefaultFmapContentHandler contentHandler = FmapHandlerFactory.createContentHandler(
73
                                errorHandler,
74
                                new GMLVectorialDriver());                
75
                GPEParser parser = GPERegister.createParser("GML");
76
                parser.parse(contentHandler,
77
                                errorHandler,
78
                                new File(sFile).toURI());        
79
                return mapControl.getMapContext().getLayers().getLayer(0);
80
        }
81

    
82
        protected Class getGPEWriterHandlerClass() {
83
                return org.gvsig.gpe.gml.writer.GPEGmlWriterHandlerImplementor.class;
84
        }
85
        
86
}