Statistics
| Revision:

root / branches / v10 / extensions / extPublish / src-test / com / iver / cit / gvsig / publish / infoProject / Test_queryView.java @ 13962

History | View | Annotate | Download (4.4 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
package com.iver.cit.gvsig.publish.infoProject;
43

    
44
import java.io.File;
45
import java.net.URL;
46

    
47
import org.gvsig.publish.infoProject.ILayerInfo;
48
import org.gvsig.publish.infoProject.IViewInfo;
49
import org.gvsig.publish.infoProject.LayerInfo;
50
import org.gvsig.publish.infoProject.ViewInfo;
51

    
52
import com.iver.cit.gvsig.project.documents.view.ProjectView;
53
import com.iver.cit.gvsig.publish.util.LocalResourcesTestUtilities;
54

    
55
import junit.framework.TestCase;
56

    
57
/**
58
 * We are testing all methods of DefaultView.  
59
 * 
60
 * @author Jos? Vicente Hig?n (josevicente.higon@iver.es)
61
 *
62
 */
63
public class Test_queryView extends TestCase {
64
        //gvSIG ProjectView
65
        private ProjectView gvView = null;
66
        //information about the view to publish
67
        private IViewInfo viewInfo = null;
68

    
69
        
70
        /**
71
         * initializes the test
72
         */
73
        protected void setUp() throws Exception {
74
                File f = null;
75
                super.setUp();
76
                //gets a new view from the utilities
77
                LocalResourcesTestUtilities util = new LocalResourcesTestUtilities();
78
                this.gvView = util.getBasicView();
79
                //this.gvView = util.getGroupView();
80
                //creates a instance to get view information
81
                this.viewInfo = new ViewInfo(gvView);
82
                //creates a database 
83
                //util.createDBPostGIS();
84
        }
85
        /**
86
         * after the test
87
         */
88
        protected void tearDown() throws Exception {
89
                super.tearDown();
90
        }
91
        /**
92
         * test getName method
93
         */
94
        public void test_getName(){
95
                this.assertEquals("info view fails", "test_view_name",this.viewInfo.getName());
96
                System.out.println(this.viewInfo.getName());        
97
        }
98
        /**
99
         * test getOwner method
100
         */
101
        public void test_getOwner(){
102
                this.assertEquals("info view fails", "test_view_owner",this.viewInfo.getOwner());
103
                System.out.println(this.viewInfo.getOwner());
104
        }
105
        /**
106
         * test getComment method 
107
         */
108
        public void test_getCommnet(){
109
                this.assertEquals("ifo view fails", "test_view_comment",this.viewInfo.getComment());
110
                System.out.println(this.viewInfo.getComment());
111
        }
112
        /**
113
         * test getCreationDate method
114
         */
115
        public void test_getCreationDate(){
116
                this.assertEquals("info view fails", "07/07/07 13:30", this.viewInfo.getCreationDate());
117
                System.out.println(this.viewInfo.getCreationDate());
118
        }
119
        /**
120
         * test getSRS method
121
         */
122
        public void test_getSRS(){
123
                this.assertEquals("info view fails", "EPSG:23031", this.viewInfo.getSRS());
124
                System.out.println(this.viewInfo.getSRS());
125
        }
126
        
127
        /**
128
         * test getMaxX method
129
         */
130
        public void test_getMaxX(){
131
                this.assertEquals("info view fails",110.0, this.viewInfo.getMaxX(),0);
132
                System.out.println(this.viewInfo.getMaxX());
133
        }
134
        /**
135
         * test getMaxX method
136
         */
137
        public void test_getMaxY(){
138
                this.assertEquals("info view fails", 140.0, this.viewInfo.getMaxY(),0);
139
                System.out.println(this.viewInfo.getMaxY());
140
        }
141
        /**
142
         * test getMaxX method
143
         */
144
        public void test_getMinX(){
145
                this.assertEquals("info view fails", 20.0, this.viewInfo.getMinX(),0);
146
                System.out.println(this.viewInfo.getMinX());
147
        }
148
        /**
149
         * test getMaxX method
150
         */
151
        public void test_getMinY(){
152
                this.assertEquals("info view fails", 60.0, this.viewInfo.getMinY(),0);
153
                System.out.println(this.viewInfo.getMinY());
154
        }
155
        /**
156
         * test getLayers method
157
         */
158
        public void test_getLayers(){
159
                ILayerInfo[] layers = this.viewInfo.getLayers();                
160
                for (int i = 0 ; i < layers.length; i++){
161
                        System.out.println(layers[i].getName());                        
162
                }                        
163
        }
164
}