root / branches / v2_0_0_prep / extensions / extGPE-gvSIG / src-test / org / gvsig / fmap / dal / store / gpe / GPETest.java @ 28113
History | View | Annotate | Download (4.2 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 |
* 2009 {Iver T.I.} {Task}
|
26 |
*/
|
27 |
|
28 |
package org.gvsig.fmap.dal.store.gpe; |
29 |
|
30 |
import java.io.File; |
31 |
|
32 |
import org.gvsig.compat.se.SECompatLibrary; |
33 |
import org.gvsig.fmap.dal.DALFileLibrary; |
34 |
import org.gvsig.fmap.dal.DataStoreParameters; |
35 |
import org.gvsig.fmap.dal.exception.DataException; |
36 |
import org.gvsig.fmap.dal.feature.BaseTestEditableFeatureStore; |
37 |
import org.gvsig.fmap.dal.feature.NewFeatureStoreParameters; |
38 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorer; |
39 |
import org.gvsig.fmap.geom.impl.DefaultGeometryLibrary; |
40 |
import org.gvsig.gpe.GPELocator; |
41 |
import org.gvsig.gpe.GPEManager; |
42 |
import org.gvsig.gpe.gml.impl.DefaultGmlLibrary; |
43 |
import org.gvsig.gpe.impl.DefaultGPELibrary; |
44 |
import org.gvsig.gpe.kml.impl.DefaultKmlLibrary; |
45 |
|
46 |
/**
|
47 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a>
|
48 |
*/
|
49 |
public class GPETest extends BaseTestEditableFeatureStore { |
50 |
public static final File file_prueba = new File("testdata/GML-points.gml"); |
51 |
//public static final File dbf_prueba_destino= new File(GPETest.class.getResource("data").getFile()+"/testTemp.gpe");
|
52 |
|
53 |
private FilesystemServerExplorer myExplorer = null; |
54 |
private GPEManager gpeManager = GPELocator.getGPEManager();
|
55 |
|
56 |
protected void setUp() throws Exception { |
57 |
super.setUp();
|
58 |
|
59 |
DALFileLibrary libFile = new DALFileLibrary();
|
60 |
libFile.initialize(); |
61 |
libFile.postInitialize(); |
62 |
|
63 |
DefaultGeometryLibrary geoLib = new DefaultGeometryLibrary();
|
64 |
geoLib.initialize(); |
65 |
geoLib.postInitialize(); |
66 |
|
67 |
SECompatLibrary compatLibrary = new SECompatLibrary();
|
68 |
compatLibrary.initialize(); |
69 |
compatLibrary.postInitialize(); |
70 |
|
71 |
DefaultGPELibrary lib = new DefaultGPELibrary();
|
72 |
lib.initialize(); |
73 |
lib.postInitialize(); |
74 |
|
75 |
DefaultGmlLibrary gmlLib = new DefaultGmlLibrary();
|
76 |
gmlLib.initialize(); |
77 |
gmlLib.postInitialize(); |
78 |
|
79 |
DefaultKmlLibrary kmlLib = new DefaultKmlLibrary();
|
80 |
kmlLib.initialize(); |
81 |
kmlLib.postInitialize(); |
82 |
} |
83 |
|
84 |
/*
|
85 |
* (non-Javadoc)
|
86 |
*
|
87 |
* @see
|
88 |
* org.gvsig.fmap.dal.feature.BaseTestFeatureStore#getDefaultDataStoreParameters
|
89 |
* ()
|
90 |
*/
|
91 |
public DataStoreParameters getDefaultDataStoreParameters()
|
92 |
throws DataException {
|
93 |
GPEStoreParameters parameters = null;
|
94 |
|
95 |
parameters = (GPEStoreParameters) dataManager |
96 |
.createStoreParameters(GPEStoreProvider.NAME); |
97 |
|
98 |
parameters.setFileName(file_prueba.getAbsolutePath()); |
99 |
return parameters;
|
100 |
} |
101 |
|
102 |
/*
|
103 |
* (non-Javadoc)
|
104 |
*
|
105 |
* @see org.gvsig.fmap.dal.feature.BaseTestFeatureStore#hasExplorer()
|
106 |
*/
|
107 |
public boolean hasExplorer() { |
108 |
return false; |
109 |
} |
110 |
|
111 |
/* (non-Javadoc)
|
112 |
* @see org.gvsig.fmap.dal.feature.BaseTestEditableFeatureStore#getDefaultNewDataStoreParameters()
|
113 |
*/
|
114 |
public NewFeatureStoreParameters getDefaultNewDataStoreParameters()
|
115 |
throws Exception { |
116 |
return null; |
117 |
// if (this.myExplorer == null) {
|
118 |
// GPEStoreParameters gpeStoreParameters = (GPEStoreParameters) this
|
119 |
// .getDefaultDataStoreParameters();
|
120 |
// FeatureStore store = (FeatureStore) dataManager
|
121 |
// .createStore(gpeStoreParameters);
|
122 |
// myExplorer = (FilesystemServerExplorer) store.getExplorer();
|
123 |
// store.dispose();
|
124 |
// }
|
125 |
//
|
126 |
// return (NewFeatureStoreParameters) myExplorer
|
127 |
// .getAddParameters(dbf_prueba_destino);
|
128 |
} |
129 |
|
130 |
/* (non-Javadoc)
|
131 |
* @see org.gvsig.fmap.dal.feature.BaseTestEditableFeatureStore#usesResources()
|
132 |
*/
|
133 |
public boolean usesResources() { |
134 |
// TODO Auto-generated method stub
|
135 |
return false; |
136 |
} |
137 |
|
138 |
|
139 |
} |
140 |
|