Statistics
| Revision:

root / branches / v2_0_0_prep / applications / appgvSIG / src-test / com / iver / cit / gvsig / project / TableTest.java @ 23383

History | View | Annotate | Download (4.79 KB)

1 12589 caballero
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2005 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 *
19
 * For more information, contact:
20
 *
21
 *  Generalitat Valenciana
22
 *   Conselleria d'Infraestructures i Transport
23
 *   Av. Blasco Ib??ez, 50
24
 *   46010 VALENCIA
25
 *   SPAIN
26
 *
27
 *      +34 963862235
28
 *   gvsig@gva.es
29
 *      www.gvsig.gva.es
30
 *
31
 *    or
32
 *
33
 *   IVER T.I. S.A
34
 *   Salamanca 50
35
 *   46005 Valencia
36
 *   Spain
37
 *
38
 *   +34 963163400
39
 *   dac@iver.es
40
 */
41
42
/* CVS MESSAGES:
43
*
44
* $Id$
45
* $Log$
46 12826 jaume
* Revision 1.2  2007-07-30 12:56:04  jaume
47
* organize imports, java 5 code downgraded to 1.4 and added PictureFillSymbol
48
*
49
* Revision 1.1  2007/07/13 12:31:03  caballero
50 12589 caballero
* TableTest
51
*
52
* Revision 1.1.2.1  2006/11/15 04:10:44  jjdelcerro
53
* *** empty log message ***
54
*
55
* Revision 1.1  2006/11/08 10:57:55  jaume
56
* remove unecessary imports
57
*
58
*
59
*/
60
package com.iver.cit.gvsig.project;
61
62
import java.io.File;
63
64 23383 vcaballero
//import org.gvsig.fmap.datasources.SelectableDataSource;
65
//import org.gvsig.fmap.drivers.formats.dbf.reading.DBFDriver;
66
//import org.gvsig.fmap.drivers.writing.adapters.EditableAdapter;
67 20995 jmvivo
import org.gvsig.fmap.mapcontext.layers.LayerFactory;
68
69 12589 caballero
import junit.framework.TestCase;
70
71 23383 vcaballero
//import com.hardcode.driverManager.Driver;
72
//import com.hardcode.driverManager.DriverLoadException;
73
//import com.hardcode.driverManager.DriverManager;
74
//import com.hardcode.driverManager.DriverValidation;
75
//import com.hardcode.gdbms.driver.exceptions.ReadDriverException;
76
//import com.hardcode.gdbms.engine.data.DataSource;
77
//import com.hardcode.gdbms.engine.data.DataSourceFactory;
78
//import com.hardcode.gdbms.engine.data.NoSuchTableException;
79
//import com.hardcode.gdbms.engine.data.driver.DBDriver;
80
//import com.hardcode.gdbms.engine.data.driver.FileDriver;
81
//import com.hardcode.gdbms.engine.data.driver.ObjectDriver;
82 12589 caballero
import com.iver.andami.PluginServices;
83
import com.iver.cit.gvsig.ProjectExtension;
84
import com.iver.cit.gvsig.project.documents.table.ProjectTable;
85 23383 vcaballero
//TODO comentado para que compile
86 12589 caballero
public class TableTest extends TestCase {
87
        public void testTable() {
88 23383 vcaballero
//                DriverManager dm = new DriverManager();
89
//                dm.setValidation(new DriverValidation() {
90
//                                public boolean validate(Driver d) {
91
//                                        return ((d instanceof ObjectDriver) ||
92
//                                        (d instanceof FileDriver) ||
93
//                                        (d instanceof DBDriver));
94
//                                }
95
//                        });
96
//                dm.loadDrivers(new File("../_fwAndami/gvSIG/extensiones/com.iver.cit.gvsig/drivers"));
97
//
98
//                String[] Campos= {"Tipo_Via","Nombre","Numero","Sexo","CoorX","CoorY"};
99
//        int [] fieldTypes={12,12,12,12,12,12};
100
//        DBFDriver driver = new DBFDriver();
101
//        String name = "Tabla";
102
//        DataSourceFactory dsf =LayerFactory.getDataSourceFactory();
103
//        dsf.setDriverManager(dm);
104
//        dsf.createFileDataSource(driver.getName(), name, "Archivo", Campos, fieldTypes);
105
//        DataSource dataSource = null;
106
//        dsf.createFileDataSource(driver.getName(), name, "MYTABLA.dbf", Campos, fieldTypes);
107
//
108
//        try {
109
//            dataSource = dsf.createRandomDataSource(name, DataSourceFactory.AUTOMATIC_OPENING);
110
//
111
//            dataSource.setDataSourceFactory(dsf);
112
//            SelectableDataSource sds = new SelectableDataSource(dataSource);
113
//            EditableAdapter auxea = new EditableAdapter();
114
//            auxea.setOriginalDataSource(sds);
115
//
116
//
117
//            ProjectTable projectTables = ProjectFactory.createTable(name,
118
//                auxea);
119
//
120
//            ProjectExtension ext = (ProjectExtension)PluginServices.getExtension(ProjectExtension.class);
121
//            ext.getProject().addDocument(projectTables);
122
//        } catch (DriverLoadException e) {
123
//            // TODO Auto-generated catch block
124
//            e.printStackTrace();
125
//        } catch (NoSuchTableException e) {
126
//            // TODO Auto-generated catch block
127
//            e.printStackTrace();
128
//        } catch (ReadDriverException e) {
129
//                        // TODO Auto-generated catch block
130
//                        e.printStackTrace();
131
//                }
132 12589 caballero
        }
133
134
//        public void testSignature() {
135
//                try {
136
//                        assertTrue(p1.computeSignature() == p2.computeSignature());
137
//                } catch (SaveException e) {}
138
////                assertTrue(p1.equals(p2));
139
//        }
140
}