Statistics
| Revision:

gvsig-raster / org.gvsig.raster.wms / trunk / org.gvsig.raster.wms / org.gvsig.raster.wms.remoteclient / src / test / java / org / gvsig / remoteclient / wms / WMSStatusTest.java @ 3083

History | View | Annotate | Download (4.8 KB)

1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
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 3
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
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.remoteclient.wms;
25

    
26
import java.awt.geom.Rectangle2D;
27
import java.util.Vector;
28

    
29
import junit.framework.TestCase;
30
/**
31
 * 
32
 * @author jaume
33
 *
34
 */
35
public class WMSStatusTest extends TestCase {
36
        WMSStatus st1, st2, st3, st4;
37
    protected void setUp() {
38
            st1 = new WMSStatus();
39
            // Layer names
40
            Vector v1 = new Vector();
41
            v1.add("a");
42
            v1.add("b");
43
            v1.add("c");
44
            st1.setLayerNames(v1);
45
            v1.clear();
46
            // Styles
47
            v1.add("s1");
48
            v1.add("s2");
49
            v1.add("s3");
50
            st1.setStyles(v1);
51
            // Transparency
52
            st1.setTransparency(false);
53
            v1.clear();
54
            v1.add("TIME=february");
55
            v1.add("WAVELENGTH=200nm");
56
            st1.setDimensions(v1);
57
            // Extent
58
            Rectangle2D rect1 = new Rectangle2D.Double(1.0, 1.00000001, 5.000000, 6.8);
59
            st1.setExtent(rect1);
60
            // Exception format
61
            st1.setExceptionFormat("bla");
62
            // SRS
63
            st1.setSrs("bla bla");
64
            // Format
65
            st1.setFormat("image/mpeg");
66
            // Width
67
            st1.setWidth(800);
68
            // Height
69
            st1.setHeight(600);
70
            // Online resource
71
            st1.setOnlineResource("alkjf");
72
            
73
            st2 = new WMSStatus();
74
            // Layer names
75
        Vector v2 = new Vector();
76
            v2.add("a");
77
            v2.add("b");
78
            v2.add("c");
79
            st2.setLayerNames(v2);
80
            v2.clear();
81
            // Styles
82
            v2.add("s1");
83
            v2.add("s2");
84
            v2.add("s3");
85
            st2.setStyles(v2);
86
            // Transparency
87
            st2.setTransparency(false);
88
            v2.clear();
89
            // Dimensions
90
            v2.add("TIME=february");
91
            v2.add("WAVELENGTH=200nm");
92
            st2.setDimensions(v2);
93
            // Extent
94
            Rectangle2D rect2 = new Rectangle2D.Double(1.0, 1.00000001, 5.000000, 6.8);
95
            st2.setExtent(rect2);
96
            // Exception format
97
            st2.setExceptionFormat("bla");
98
            // SRS
99
            st2.setSrs("bla bla");
100
            // Format
101
            st2.setFormat("image/mpeg");
102
            // Width
103
            st2.setWidth(800);
104
            // Height
105
            st2.setHeight(600);
106
            // Online resource
107
            st2.setOnlineResource("alkjf");
108
            
109
            st3 = new WMSStatus();
110
            // Layer names
111
        Vector v3 = new Vector();
112
            v3.add("a");
113
            v3.add("b");
114
            v3.add("c");
115
            st3.setLayerNames(v3);
116
            v3.clear();
117
            // Styles
118
            v3.add("s1");
119
            v3.add("s2");
120
            v3.add("s3");
121
            st3.setStyles(v3);
122
            // Transparency
123
            st3.setTransparency(false);
124
            v3.clear();
125
            // Dimensions
126
            v3.add("TIME=february");
127
            v3.add("WAVELENGTH=200nm");
128
            st3.setDimensions(v3);
129
            // Extent
130
            Rectangle2D rect3 = new Rectangle2D.Double(2.0, 1.00000001, 5.000000, 6.8);
131
            st3.setExtent(rect3);
132
            // Exception format
133
            st3.setExceptionFormat("bla");
134
            // SRS
135
            st3.setSrs("bla bla");
136
            // Format
137
            st3.setFormat("image/mpeg");
138
            // Width
139
            st3.setWidth(800);
140
            // Height
141
            st3.setHeight(600);
142
            // Online resource
143
            st3.setOnlineResource("alkjf");
144
        
145
            st4 = new WMSStatus(); 
146
        // Layer names
147
        Vector v4 = new Vector();
148
            v4.add("a");
149
            v4.add("b");
150
            v4.add("c");
151
            st4.setLayerNames(v4);
152
            v4.clear();
153
            // Styles
154
            v4.add("s1");
155
            v4.add("s2");
156
            v4.add("s3");
157
            st4.setStyles(v4);
158
            // Transparency
159
            st4.setTransparency(false);
160
            v4.clear();
161
            // Dimensions
162
            v4.add("TIME=february");
163
            v4.add("WAVELENGTH=200nm");
164
            st4.setDimensions(v4);
165
            // Extent
166
            Rectangle2D rect4 = new Rectangle2D.Double(2.0, 1.00000001, 5.000000, 6.8);
167
            st4.setExtent(rect3);
168
            // Exception format
169
            st4.setExceptionFormat("bla");
170
            // SRS
171
            st4.setSrs("bla bla");
172
            // Format
173
            st4.setFormat("image/mpeg");
174
            // Width
175
            st4.setWidth(800);
176
            // Height
177
            st4.setHeight(600);
178
            // Online resource
179
            st4.setOnlineResource("alkjfa");
180
    }
181

    
182
    public void testEquality() {
183
            assertTrue(st1.equals(st2));
184
            assertFalse(st1.equals(st3)); // (distinct extent)
185
            assertFalse(st3.equals(st4)); // (distinct online resources)
186
    }
187
}