root / branches / v10 / extensions / extPublish / src-test / com / iver / cit / gvsig / publish / util / test_LocalResourcesTestUtilities.java @ 13570
History | View | Annotate | Download (3.26 KB)
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2004-2006 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 Iba?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 |
* @author Jos? Vicente Hig?n (josevicente.higon@iver.es)
|
43 |
*/
|
44 |
package com.iver.cit.gvsig.publish.util; |
45 |
|
46 |
import java.io.File; |
47 |
import java.net.URL; |
48 |
|
49 |
import com.iver.cit.gvsig.fmap.MapContext; |
50 |
import com.iver.cit.gvsig.fmap.drivers.DriverIOException; |
51 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
52 |
import com.iver.cit.gvsig.fmap.layers.FLyrVect; |
53 |
|
54 |
import junit.framework.TestCase; |
55 |
|
56 |
public class test_LocalResourcesTestUtilities extends TestCase { |
57 |
private LocalResourcesTestUtilities util = null; |
58 |
protected void setUp() throws Exception { |
59 |
super.setUp();
|
60 |
File f = null; |
61 |
//gets absolute path
|
62 |
URL url = this.getClass().getResource("../resources"); |
63 |
if (url == null) |
64 |
throw new Exception("Can't find resources directory"); |
65 |
f = new File(url.getFile()); |
66 |
if (!f.exists())
|
67 |
throw new Exception("Can't find resources dir"); |
68 |
|
69 |
//gets a new view from the utilities
|
70 |
util = new LocalResourcesTestUtilities(f.getAbsolutePath());
|
71 |
//create database
|
72 |
//System.err.println("Creating database publish");
|
73 |
//this.util.createDBPostGIS();
|
74 |
} |
75 |
|
76 |
protected void tearDown() throws Exception { |
77 |
super.tearDown();
|
78 |
//delete database
|
79 |
//System.err.println("Deleting database publish");
|
80 |
//this.util.dropDBPostGIS();
|
81 |
} |
82 |
|
83 |
public void test_layerPostGIS(){ |
84 |
//get postGIS layer
|
85 |
//System.err.println("Getting postGIS layer");
|
86 |
//this.util.getLayerPostGIS();
|
87 |
|
88 |
} |
89 |
|
90 |
public void test_layerShp(){ |
91 |
System.err.println("Getting shapefiles"); |
92 |
FLayer line = null;
|
93 |
FLayer point = null;
|
94 |
FLayer polygon = null;
|
95 |
line = this.util.getShapeLine();
|
96 |
this.assertNotNull(line);
|
97 |
point = this.util.getShapePoint();
|
98 |
this.assertNotNull(point);
|
99 |
polygon = this.util.getShapePolygon();
|
100 |
this.assertNotNull(polygon);
|
101 |
//testing source
|
102 |
this.assertNotNull(((FLyrVect)line).getSource());
|
103 |
this.assertNotNull(((FLyrVect)point).getSource());
|
104 |
this.assertNotNull(((FLyrVect)polygon).getSource());
|
105 |
} |
106 |
|
107 |
public void test_layerECW(){ |
108 |
System.err.println("Getting ECW"); |
109 |
this.util.getLayerECW();
|
110 |
} |
111 |
|
112 |
public void test_GroupView(){ |
113 |
System.err.println("Getting GroupedLayer"); |
114 |
this.util.getGroupView();
|
115 |
} |
116 |
|
117 |
} |