root / branches / v2_0_0_prep / libraries / libFMap_daldb / src-test / org / gvsig / fmap / dal / store / jdbc / JDBCTest.java @ 30580
History | View | Annotate | Download (3.47 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 |
/**
|
29 |
*
|
30 |
*/
|
31 |
package org.gvsig.fmap.dal.store.jdbc; |
32 |
|
33 |
import org.gvsig.fmap.dal.DataStoreParameters; |
34 |
import org.gvsig.fmap.dal.exception.DataException; |
35 |
import org.gvsig.fmap.dal.feature.BaseTestFeatureStore; |
36 |
import org.gvsig.tools.library.impl.DefaultLibrariesInitializer; |
37 |
|
38 |
import com.mysql.jdbc.Driver; |
39 |
|
40 |
/**
|
41 |
* @author jmvivo
|
42 |
*
|
43 |
*/
|
44 |
public class JDBCTest extends BaseTestFeatureStore { |
45 |
|
46 |
protected void setUp() throws Exception { |
47 |
super.setUp();
|
48 |
// FIXME
|
49 |
// ToolsLocator.registerDefaultPersistenceManager(XMLEntityManager.class);
|
50 |
|
51 |
new DefaultLibrariesInitializer().fullInitialize();
|
52 |
|
53 |
// DefaultGeometryLibrary defGeomLib = new DefaultGeometryLibrary();
|
54 |
// defGeomLib.initialize();
|
55 |
//
|
56 |
// DefaultGeometryOperationLibrary defGeomOpLib = new DefaultGeometryOperationLibrary();
|
57 |
// defGeomOpLib.initialize();
|
58 |
//
|
59 |
// ProjectionLibrary projLib = new ProjectionLibrary();
|
60 |
// projLib.initialize();
|
61 |
//
|
62 |
// CresquesCtsLibrary cresquesLib = new CresquesCtsLibrary();
|
63 |
// cresquesLib.initialize();
|
64 |
//
|
65 |
// DALDbLibrary libDb = new DALDbLibrary();
|
66 |
// libDb.initialize();
|
67 |
//
|
68 |
// DBStoreLibrary libDbStore = new DBStoreLibrary();
|
69 |
// libDbStore.initialize();
|
70 |
//
|
71 |
// JDBCLibrary libJDBC = new JDBCLibrary();
|
72 |
// libJDBC.initialize();
|
73 |
//
|
74 |
// JTSIndexLibrary jtsIndex = new JTSIndexLibrary();
|
75 |
// jtsIndex.initialize();
|
76 |
//
|
77 |
// projLib.postInitialize();
|
78 |
// cresquesLib.postInitialize();
|
79 |
// defGeomLib.postInitialize();
|
80 |
// defGeomOpLib.postInitialize();
|
81 |
// libDb.postInitialize();
|
82 |
// libDbStore.postInitialize();
|
83 |
// libJDBC.postInitialize();
|
84 |
// jtsIndex.postInitialize();
|
85 |
} |
86 |
|
87 |
public DataStoreParameters getDefaultDataStoreParameters()
|
88 |
throws DataException {
|
89 |
JDBCStoreParameters parameters = null;
|
90 |
parameters = (JDBCStoreParameters) dataManager |
91 |
.createStoreParameters(JDBCStoreProvider.NAME); |
92 |
|
93 |
|
94 |
parameters.setHost("localhost");
|
95 |
parameters.setPort(3306);
|
96 |
parameters.setUser("test");
|
97 |
parameters.setPassword("test");
|
98 |
parameters.setDBName("gis");
|
99 |
parameters.setTable("alfanum");
|
100 |
parameters.setUrl("jdbc:mysql://" + parameters.getHost() + ":" |
101 |
+ parameters.getPort() + "/" + parameters.getDBName());
|
102 |
parameters.setJDBCDriverClassName(Driver.class.getName());
|
103 |
|
104 |
return parameters;
|
105 |
} |
106 |
|
107 |
/* (non-Javadoc)
|
108 |
* @see org.gvsig.fmap.dal.feature.BaseTestFeatureStore#hasExplorer()
|
109 |
*/
|
110 |
@Override
|
111 |
public boolean hasExplorer() { |
112 |
// TODO Auto-generated method stub
|
113 |
return true; |
114 |
} |
115 |
|
116 |
/* (non-Javadoc)
|
117 |
* @see org.gvsig.fmap.dal.feature.BaseTestFeatureStore#usesResources()
|
118 |
*/
|
119 |
@Override
|
120 |
public boolean usesResources() { |
121 |
// TODO Auto-generated method stub
|
122 |
return true; |
123 |
} |
124 |
|
125 |
} |