Revision 28113 branches/v2_0_0_prep/extensions/extGPE-gvSIG/src-test/org/gvsig/fmap/dal/store/gpe/GPETest.java

View differences:

GPETest.java
1 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
*/
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 22

  
23 23
/*
24
* AUTHORS (In addition to CIT):
25
* 2009 {Iver T.I.}   {Task}
26
*/
27
 
24
 * AUTHORS (In addition to CIT):
25
 * 2009 {Iver T.I.}   {Task}
26
 */
27

  
28 28
package org.gvsig.fmap.dal.store.gpe;
29 29

  
30 30
import java.io.File;
31 31

  
32
import org.gvsig.compat.se.SECompatLibrary;
32 33
import org.gvsig.fmap.dal.DALFileLibrary;
33 34
import org.gvsig.fmap.dal.DataStoreParameters;
34 35
import org.gvsig.fmap.dal.exception.DataException;
35
import org.gvsig.fmap.dal.feature.BaseTestFeatureStore;
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;
36 39
import org.gvsig.fmap.geom.impl.DefaultGeometryLibrary;
37
import org.gvsig.gpe.GPERegister;
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;
38 45

  
39 46
/**
40 47
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a>
41 48
 */
42
public class GPETest extends BaseTestFeatureStore {
43
	public static final File file_prueba = new File("testdata/GML-points.gml"); // FIXME
44
	private String parsersFile = "config" + File.separatorChar + "parser.properties";
45
	
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

  
46 56
	protected void setUp() throws Exception {
47
		super.setUp();
48
			
49
		GPERegister.addParsersFile(new File(parsersFile));
50
		
57
		super.setUp();		
58

  
51 59
		DALFileLibrary libFile = new DALFileLibrary();
52 60
		libFile.initialize();
53 61
		libFile.postInitialize();
......
55 63
		DefaultGeometryLibrary geoLib = new DefaultGeometryLibrary();
56 64
		geoLib.initialize();
57 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();
58 74
		
59
		GPELibrary lib = new GPELibrary();
60
		lib.initialize();
61
		lib.postInitialize();	
75
		DefaultGmlLibrary gmlLib = new DefaultGmlLibrary();
76
		gmlLib.initialize();
77
		gmlLib.postInitialize();
78
		
79
		DefaultKmlLibrary kmlLib = new DefaultKmlLibrary();
80
		kmlLib.initialize();
81
		kmlLib.postInitialize();
62 82
	}
63 83

  
64 84
	/*
......
69 89
	 * ()
70 90
	 */
71 91
	public DataStoreParameters getDefaultDataStoreParameters()
72
			throws DataException {
92
	throws DataException {
73 93
		GPEStoreParameters parameters = null;
74 94

  
75 95
		parameters = (GPEStoreParameters) dataManager
76
				.createStoreParameters(GPEStoreProvider.NAME);
96
		.createStoreParameters(GPEStoreProvider.NAME);
77 97

  
78 98
		parameters.setFileName(file_prueba.getAbsolutePath());
79 99
		return parameters;
......
84 104
	 *
85 105
	 * @see org.gvsig.fmap.dal.feature.BaseTestFeatureStore#hasExplorer()
86 106
	 */
87
	public boolean hasExplorer() {
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() {
88 134
		// TODO Auto-generated method stub
89 135
		return false;
90 136
	}

Also available in: Unified diff