Revision 11203 trunk/libraries/libGPE/src-test/org/gvsig/gpe/readers/GPEReaderBaseTest.java
GPEReaderBaseTest.java | ||
---|---|---|
1 | 1 |
package org.gvsig.gpe.readers; |
2 | 2 |
|
3 | 3 |
import java.io.File; |
4 |
import java.lang.reflect.InvocationTargetException; |
|
4 | 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 |
|
|
5 | 11 |
import junit.framework.TestCase; |
6 | 12 |
|
7 | 13 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
... | ... | |
48 | 54 |
* |
49 | 55 |
* $Id$ |
50 | 56 |
* $Log$ |
51 |
* Revision 1.1 2007-04-13 07:17:54 jorpiell |
|
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 |
|
52 | 61 |
* Add the writting tests for the simple geometries |
53 | 62 |
* |
54 | 63 |
* |
... | ... | |
60 | 69 |
*/ |
61 | 70 |
public abstract class GPEReaderBaseTest extends TestCase { |
62 | 71 |
private File file = null; |
72 |
private GPEParser parser = null; |
|
63 | 73 |
|
64 |
public void setUp(){ |
|
74 |
public void setUp() throws Exception{ |
|
75 |
GPERegister.addGpeDriver(getGPEParserName(), |
|
76 |
new GPEContentHandlerTest(), |
|
77 |
new GPEErrorHandlerTest()); |
|
65 | 78 |
file = new File(getFile()); |
79 |
assertEquals(GPERegister.accept(file),true); |
|
80 |
parser = GPERegister.getParser(file); |
|
81 |
assertNotNull(parser); |
|
66 | 82 |
} |
67 | 83 |
|
84 |
public void testParse() throws Exception{ |
|
85 |
parser.parse(file); |
|
86 |
} |
|
87 |
|
|
68 | 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 |
/** |
|
69 | 96 |
* Gets the GML file to open |
70 | 97 |
* @return |
71 | 98 |
*/ |
72 | 99 |
public abstract String getFile(); |
73 | 100 |
|
74 |
/** |
|
75 |
* Return the numbre of features |
|
76 |
* @return |
|
77 |
*/ |
|
78 |
public abstract int getNumFeatures(); |
|
79 |
|
|
80 |
/** |
|
81 |
* Compare the feature number i |
|
82 |
* @param i |
|
83 |
*/ |
|
84 |
public abstract void compareFeature(int i); |
|
101 |
|
|
85 | 102 |
} |
Also available in: Unified diff