Statistics
| Revision:

svn-gvsig-desktop / branches / v10 / extensions / extPublish / src-test / gvsig / publish / infoproject / Test_queryView.java @ 16218

History | View | Annotate | Download (4.18 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 org.gvsig.publish.infoproject;
43

    
44
import java.io.File;
45

    
46
import junit.framework.TestCase;
47

    
48
import org.gvsig.publish.util.LocalResourcesTestUtilities;
49

    
50
import com.iver.cit.gvsig.project.documents.view.ProjectView;
51

    
52

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

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