root / trunk / libraries / libFMap / src-test / com / iver / cit / gvsig / fmap / AllTests.java @ 18621
History | View | Annotate | Download (4.88 KB)
1 |
package com.iver.cit.gvsig.fmap; |
---|---|
2 |
|
3 |
import java.io.File; |
4 |
import java.net.URL; |
5 |
|
6 |
import junit.framework.Test; |
7 |
import junit.framework.TestCase; |
8 |
import junit.framework.TestSuite; |
9 |
|
10 |
import org.cresques.cts.IProjection; |
11 |
|
12 |
import com.iver.cit.gvsig.exceptions.layers.LoadLayerException; |
13 |
import com.iver.cit.gvsig.fmap.core.TestCartographicSupportForSymbol; |
14 |
import com.iver.cit.gvsig.fmap.core.TestCartographySupport; |
15 |
import com.iver.cit.gvsig.fmap.core.rendering.TestAbstractIntervalLegend; |
16 |
import com.iver.cit.gvsig.fmap.core.rendering.TestIClassifiedLegend; |
17 |
import com.iver.cit.gvsig.fmap.core.rendering.TestILegend; |
18 |
import com.iver.cit.gvsig.fmap.core.symbols.TestDrawFills; |
19 |
import com.iver.cit.gvsig.fmap.core.symbols.TestDrawLines; |
20 |
import com.iver.cit.gvsig.fmap.core.symbols.TestDrawMarkers; |
21 |
import com.iver.cit.gvsig.fmap.core.symbols.TestISymbol; |
22 |
import com.iver.cit.gvsig.fmap.core.symbols.TestMultiLayerSymbol; |
23 |
import com.iver.cit.gvsig.fmap.crs.CRSFactory; |
24 |
import com.iver.cit.gvsig.fmap.drivers.dbf.TestDbf; |
25 |
import com.iver.cit.gvsig.fmap.drivers.dgn.TestDgn; |
26 |
import com.iver.cit.gvsig.fmap.featureiterators.DBFeatureIteratorTest; |
27 |
import com.iver.cit.gvsig.fmap.featureiterators.FeatureIteratorTest; |
28 |
import com.iver.cit.gvsig.fmap.featureiterators.PerformanceFeatureIteratorTest; |
29 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
30 |
import com.iver.cit.gvsig.fmap.layers.LayerFactory; |
31 |
import com.iver.cit.gvsig.fmap.layers.LayersIteratorTest; |
32 |
import com.iver.cit.gvsig.fmap.spatialindex.SpatialIndexTest; |
33 |
import com.iver.cit.gvsig.fmap.tools.AreaListenerTest; |
34 |
import com.vividsolutions.jts.operation.overlay.SnappingOverlayOperationTest; |
35 |
|
36 |
public class AllTests extends TestCase{ |
37 |
/**
|
38 |
* The EPSG:4326 projection
|
39 |
*/
|
40 |
public static IProjection TEST_DEFAULT_PROJECTION = |
41 |
CRSFactory.getCRS("EPSG:4326");
|
42 |
|
43 |
/**
|
44 |
* The EPSG:23030 projection
|
45 |
*/
|
46 |
public static IProjection TEST_DEFAULT_MERCATOR_PROJECTION = |
47 |
CRSFactory.getCRS("EPSG:23030");
|
48 |
|
49 |
/**
|
50 |
* The EPSG:23029 projection
|
51 |
*/
|
52 |
public static IProjection test_newProjection = |
53 |
CRSFactory.getCRS("EPSG:23029");
|
54 |
|
55 |
public static Test suite() { |
56 |
TestSuite suite = new TestSuite("Test for com.iver.cit.gvsig.fmap"); |
57 |
//$JUnit-BEGIN$
|
58 |
|
59 |
/* LayersIterator */
|
60 |
suite.addTestSuite(LayersIteratorTest.class); |
61 |
|
62 |
|
63 |
/* Symbols (jaume) */
|
64 |
// integration tests
|
65 |
// ISymbol
|
66 |
suite.addTestSuite(TestISymbol.class); |
67 |
suite.addTestSuite(TestMultiLayerSymbol.class); |
68 |
|
69 |
// CartographicSupport
|
70 |
// suite.addTestSuite(TestCartographySupport.class);
|
71 |
suite.addTest(TestCartographySupport.suite()); |
72 |
|
73 |
//
|
74 |
/*
|
75 |
* Feature iterators
|
76 |
* */
|
77 |
suite.addTestSuite(FeatureIteratorTest.class); |
78 |
|
79 |
/*
|
80 |
* Other Tests present in FMap (cesar)
|
81 |
* Remove them from here and the src-test dir if they are not
|
82 |
* useful anymore.
|
83 |
*/
|
84 |
|
85 |
suite.addTestSuite(AreaListenerTest.class); |
86 |
suite.addTestSuite(DBFeatureIteratorTest.class); |
87 |
suite.addTestSuite(PerformanceFeatureIteratorTest.class); |
88 |
suite.addTestSuite(SnappingOverlayOperationTest.class); |
89 |
suite.addTestSuite(SpatialIndexTest.class); |
90 |
suite.addTestSuite(TestAbstractIntervalLegend.class); |
91 |
suite.addTestSuite(TestCartographicSupportForSymbol.class); |
92 |
suite.addTestSuite(TestDbf.class); |
93 |
suite.addTestSuite(TestDgn.class); |
94 |
suite.addTestSuite(TestDrawFills.class); |
95 |
suite.addTestSuite(TestDrawLines.class); |
96 |
suite.addTestSuite(TestDrawMarkers.class); |
97 |
suite.addTestSuite(TestIClassifiedLegend.class); |
98 |
suite.addTestSuite(TestILegend.class); |
99 |
suite.addTestSuite(TestMultiLayerSymbol.class); |
100 |
|
101 |
//$JUnit-END$
|
102 |
return suite;
|
103 |
} |
104 |
|
105 |
//// jaume
|
106 |
//// PASTED FROM FeatureIteratorTest.java to be globally accessible
|
107 |
static final String fwAndamiDriverPath = "../_fwAndami/gvSIG/extensiones/com.iver.cit.gvsig/drivers"; |
108 |
private static File baseDataPath; |
109 |
private static File baseDriversPath; |
110 |
|
111 |
|
112 |
public static void setUpDrivers() { |
113 |
try {
|
114 |
URL url = AllTests.class.getResource("testdata"); |
115 |
if (url == null) |
116 |
throw new Exception("No se encuentra el directorio con datos de prueba"); |
117 |
|
118 |
baseDataPath = new File(url.getFile()); |
119 |
if (!baseDataPath.exists())
|
120 |
throw new Exception("No se encuentra el directorio con datos de prueba"); |
121 |
|
122 |
baseDriversPath = new File(fwAndamiDriverPath); |
123 |
if (!baseDriversPath.exists())
|
124 |
throw new Exception("Can't find drivers path: " + fwAndamiDriverPath); |
125 |
|
126 |
LayerFactory.setDriversPath(baseDriversPath.getAbsolutePath()); |
127 |
if (LayerFactory.getDM().getDriverNames().length < 1) |
128 |
throw new Exception("Can't find drivers in path: " + fwAndamiDriverPath); |
129 |
} catch (Exception e) { |
130 |
throw new RuntimeException(e); |
131 |
} |
132 |
} |
133 |
|
134 |
public static FLayer newLayer(String fileName, |
135 |
String driverName)
|
136 |
throws LoadLayerException {
|
137 |
File file = new File(baseDataPath, fileName); |
138 |
return LayerFactory.createLayer(fileName,
|
139 |
driverName, |
140 |
file, TEST_DEFAULT_MERCATOR_PROJECTION); |
141 |
} |
142 |
|
143 |
public static MapContext newMapContext(IProjection projection) { |
144 |
ViewPort vp = new ViewPort(projection);
|
145 |
return new MapContext(vp); |
146 |
} |
147 |
|
148 |
//// end past
|
149 |
} |