svn-gvsig-desktop / branches / v2_0_0_prep / libraries / libFMap_dalfile / src-test / org / gvsig / fmap / dal / store / dxf / TestDXF.java @ 28017
History | View | Annotate | Download (3.11 KB)
1 |
/* gvSIG. Geographic Information System of the Valencian Government
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department
|
4 |
* of the Valencian Government (CIT)
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 2
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
*/
|
22 |
|
23 |
/*
|
24 |
* AUTHORS (In addition to CIT):
|
25 |
* 2008 IVER T.I. S.A. {{Task}}
|
26 |
*/
|
27 |
|
28 |
package org.gvsig.fmap.dal.store.dxf; |
29 |
|
30 |
import java.io.File; |
31 |
|
32 |
import org.cresques.ProjectionLibrary; |
33 |
import org.cresques.impl.CresquesCtsLibrary; |
34 |
import org.gvsig.fmap.dal.DALFileLibrary; |
35 |
import org.gvsig.fmap.dal.DataStoreParameters; |
36 |
import org.gvsig.fmap.dal.exception.DataException; |
37 |
import org.gvsig.fmap.dal.feature.BaseTestFeatureStore; |
38 |
import org.gvsig.fmap.dal.index.spatial.jts.JTSIndexLibrary; |
39 |
import org.gvsig.fmap.geom.impl.DefaultGeometryLibrary; |
40 |
|
41 |
public class TestDXF extends BaseTestFeatureStore { |
42 |
|
43 |
protected boolean testDXFInitialized = false; |
44 |
|
45 |
public static final File file_prueba = new File(TestDXF.class.getResource( |
46 |
"data/prueba.dxf").getFile());
|
47 |
|
48 |
|
49 |
protected void setUp() throws Exception { |
50 |
super.setUp();
|
51 |
|
52 |
if (testDXFInitialized) {
|
53 |
return;
|
54 |
} |
55 |
|
56 |
|
57 |
DALFileLibrary libFile = new DALFileLibrary();
|
58 |
libFile.initialize(); |
59 |
|
60 |
DefaultGeometryLibrary defGeomLib = new DefaultGeometryLibrary();
|
61 |
defGeomLib.initialize(); |
62 |
|
63 |
ProjectionLibrary projLib = new ProjectionLibrary();
|
64 |
projLib.initialize(); |
65 |
|
66 |
CresquesCtsLibrary cresquesLib = new CresquesCtsLibrary();
|
67 |
cresquesLib.initialize(); |
68 |
|
69 |
DXFLibrary dxfLib = new DXFLibrary();
|
70 |
dxfLib.initialize(); |
71 |
|
72 |
JTSIndexLibrary jtsIndex = new JTSIndexLibrary();
|
73 |
jtsIndex.initialize(); |
74 |
|
75 |
defGeomLib.postInitialize(); |
76 |
libFile.postInitialize(); |
77 |
projLib.postInitialize(); |
78 |
cresquesLib.postInitialize(); |
79 |
dxfLib.postInitialize(); |
80 |
jtsIndex.postInitialize(); |
81 |
|
82 |
|
83 |
testDXFInitialized = true;
|
84 |
} |
85 |
|
86 |
/*
|
87 |
* (non-Javadoc)
|
88 |
*
|
89 |
* @see
|
90 |
* org.gvsig.fmap.dal.feature.BaseTestFeatureStore#getDefaultDataStoreParameters
|
91 |
* ()
|
92 |
*/
|
93 |
public DataStoreParameters getDefaultDataStoreParameters()
|
94 |
throws DataException {
|
95 |
DXFStoreParameters dxfParameters = null;
|
96 |
|
97 |
dxfParameters = (DXFStoreParameters) dataManager |
98 |
.createStoreParameters(DXFStoreProvider.NAME); |
99 |
|
100 |
dxfParameters.setFileName(file_prueba.getAbsolutePath()); |
101 |
dxfParameters.setSRSID("EPSG:23030");
|
102 |
return dxfParameters;
|
103 |
} |
104 |
|
105 |
/*
|
106 |
* (non-Javadoc)
|
107 |
*
|
108 |
* @see org.gvsig.fmap.dal.feature.BaseTestFeatureStore#hasExplorer()
|
109 |
*/
|
110 |
public boolean hasExplorer() { |
111 |
// TODO Auto-generated method stub
|
112 |
return false; |
113 |
} |
114 |
|
115 |
public boolean usesResources() { |
116 |
return true; |
117 |
} |
118 |
|
119 |
} |