root / trunk / libraries / libGPE / src-test / org / gvsig / gpe / readers / GPEReaderBaseTest.java @ 11203
History | View | Annotate | Download (2.62 KB)
1 |
package org.gvsig.gpe.readers; |
---|---|
2 |
|
3 |
import java.io.File; |
4 |
import java.lang.reflect.InvocationTargetException; |
5 |
|
6 |
import org.gvsig.gpe.GPEContentHandlerTest; |
7 |
import org.gvsig.gpe.GPEErrorHandlerTest; |
8 |
import org.gvsig.gpe.GPEParser; |
9 |
import org.gvsig.gpe.GPERegister; |
10 |
|
11 |
import junit.framework.TestCase; |
12 |
|
13 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
14 |
*
|
15 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
16 |
*
|
17 |
* This program is free software; you can redistribute it and/or
|
18 |
* modify it under the terms of the GNU General Public License
|
19 |
* as published by the Free Software Foundation; either version 2
|
20 |
* of the License, or (at your option) any later version.
|
21 |
*
|
22 |
* This program is distributed in the hope that it will be useful,
|
23 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
24 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
25 |
* GNU General Public License for more details.
|
26 |
*
|
27 |
* You should have received a copy of the GNU General Public License
|
28 |
* along with this program; if not, write to the Free Software
|
29 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
30 |
*
|
31 |
* For more information, contact:
|
32 |
*
|
33 |
* Generalitat Valenciana
|
34 |
* Conselleria d'Infraestructures i Transport
|
35 |
* Av. Blasco Ib??ez, 50
|
36 |
* 46010 VALENCIA
|
37 |
* SPAIN
|
38 |
*
|
39 |
* +34 963862235
|
40 |
* gvsig@gva.es
|
41 |
* www.gvsig.gva.es
|
42 |
*
|
43 |
* or
|
44 |
*
|
45 |
* IVER T.I. S.A
|
46 |
* Salamanca 50
|
47 |
* 46005 Valencia
|
48 |
* Spain
|
49 |
*
|
50 |
* +34 963163400
|
51 |
* dac@iver.es
|
52 |
*/
|
53 |
/* CVS MESSAGES:
|
54 |
*
|
55 |
* $Id: GPEReaderBaseTest.java 11203 2007-04-13 13:14:55Z jorpiell $
|
56 |
* $Log$
|
57 |
* Revision 1.2 2007-04-13 13:14:55 jorpiell
|
58 |
* Created the base tests and add some methods to the content handler
|
59 |
*
|
60 |
* Revision 1.1 2007/04/13 07:17:54 jorpiell
|
61 |
* Add the writting tests for the simple geometries
|
62 |
*
|
63 |
*
|
64 |
*/
|
65 |
/**
|
66 |
* This class must be implementend by all the classes that
|
67 |
* implements a GPE reader Parser.
|
68 |
* @author Jorge Piera LLodr? (jorge.piera@iver.es)
|
69 |
*/
|
70 |
public abstract class GPEReaderBaseTest extends TestCase { |
71 |
private File file = null; |
72 |
private GPEParser parser = null; |
73 |
|
74 |
public void setUp() throws Exception{ |
75 |
GPERegister.addGpeDriver(getGPEParserName(), |
76 |
new GPEContentHandlerTest(),
|
77 |
new GPEErrorHandlerTest());
|
78 |
file = new File(getFile()); |
79 |
assertEquals(GPERegister.accept(file),true);
|
80 |
parser = GPERegister.getParser(file); |
81 |
assertNotNull(parser); |
82 |
} |
83 |
|
84 |
public void testParse() throws Exception{ |
85 |
parser.parse(file); |
86 |
} |
87 |
|
88 |
/**
|
89 |
* Each test must to return its parser name
|
90 |
* to register it before to start the parsing
|
91 |
* process
|
92 |
*/
|
93 |
public abstract String getGPEParserName(); |
94 |
|
95 |
/**
|
96 |
* Gets the GML file to open
|
97 |
* @return
|
98 |
*/
|
99 |
public abstract String getFile(); |
100 |
|
101 |
|
102 |
} |