/
DummyMapControllerTest.java
280 lines (225 loc) · 8.13 KB
/
DummyMapControllerTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
// -*- mode: java; c-basic-offset: 2; -*-
// Copyright © 2017 Massachusetts Institute of Technology, All rights reserved.
// Released under the Apache License, Version 2.0
// http://www.apache.org/licenses/LICENSE-2.0
package com.google.appinventor.components.runtime.util;
import com.google.appinventor.components.runtime.util.MapFactory.MapCircle;
import com.google.appinventor.components.runtime.util.MapFactory.MapLineString;
import com.google.appinventor.components.runtime.util.MapFactory.MapMarker;
import com.google.appinventor.components.runtime.util.MapFactory.MapPolygon;
import com.google.appinventor.components.runtime.util.MapFactory.MapRectangle;
import com.google.appinventor.components.runtime.util.MapFactory.MapType;
import org.junit.Before;
import org.junit.Test;
/**
* The only purpose this test serves is to ensure that we have 100% coverage of DummyMapController
* so that in future extensions to Maps, if we add new methods, we test that the new methods also
* throw UnsupportedOperationException.
*/
public class DummyMapControllerTest {
private DummyMapController mapController;
@Before
public void setUp() {
mapController = new DummyMapController();
}
@Test(expected = UnsupportedOperationException.class)
public void testGetViewThrows() {
mapController.getView();
}
@Test(expected = UnsupportedOperationException.class)
public void testGetLatitude() {
mapController.getLatitude();
}
@Test(expected = UnsupportedOperationException.class)
public void testGetLongitude() {
mapController.getLongitude();
}
@Test(expected = UnsupportedOperationException.class)
public void testSetCenter() {
mapController.setCenter(0.0, 0.0);
}
@Test(expected = UnsupportedOperationException.class)
public void testSetZoom() {
mapController.setZoom(0);
}
@Test(expected = UnsupportedOperationException.class)
public void testGetZoom() {
mapController.getZoom();
}
@Test(expected = UnsupportedOperationException.class)
public void testSetMapType() {
mapController.setMapType(MapType.ROADS);
}
@Test(expected = UnsupportedOperationException.class)
public void testGetMapType() {
mapController.getMapType();
}
@Test(expected = UnsupportedOperationException.class)
public void testSetCompassEnabled() {
mapController.setCompassEnabled(true);
}
@Test(expected = UnsupportedOperationException.class)
public void testIsCompassEnabled() {
mapController.isCompassEnabled();
}
@Test(expected = UnsupportedOperationException.class)
public void testSetZoomEnabled() {
mapController.setZoomEnabled(true);
}
@Test(expected = UnsupportedOperationException.class)
public void testIsZoomEnabled() {
mapController.isZoomEnabled();
}
@Test(expected = UnsupportedOperationException.class)
public void testSetZoomControlEnabled() {
mapController.setZoomControlEnabled(true);
}
@Test(expected = UnsupportedOperationException.class)
public void testIsZoomControlEnabled() {
mapController.isZoomControlEnabled();
}
@Test(expected = UnsupportedOperationException.class)
public void testShowUserEnabled() {
mapController.setShowUserEnabled(true);
}
@Test(expected = UnsupportedOperationException.class)
public void testIsShowUserEnabled() {
mapController.isShowUserEnabled();
}
@Test(expected = UnsupportedOperationException.class)
public void testSetRotationEnabled() {
mapController.setRotationEnabled(true);
}
@Test(expected = UnsupportedOperationException.class)
public void testIsRotationEnabled() {
mapController.isRotationEnabled();
}
@Test(expected = UnsupportedOperationException.class)
public void testSetPanEnabled() {
mapController.setPanEnabled(true);
}
@Test(expected = UnsupportedOperationException.class)
public void testIsPanEnabled() {
mapController.isPanEnabled();
}
@Test(expected = UnsupportedOperationException.class)
public void testPanTo() {
mapController.panTo(0.0, 0.0, 0, 1);
}
@Test(expected = UnsupportedOperationException.class)
public void testAddEventListener() {
mapController.addEventListener(null);
}
@Test(expected = UnsupportedOperationException.class)
public void testAddFeatureMarker() {
mapController.addFeature((MapMarker) null);
}
@Test(expected = UnsupportedOperationException.class)
public void testUpdateFeaturePosition() {
mapController.updateFeaturePosition((MapMarker) null);
}
@Test(expected = UnsupportedOperationException.class)
public void testUpdateFeatureFill() {
mapController.updateFeatureFill(null);
}
@Test(expected = UnsupportedOperationException.class)
public void testUpdateFeatureImage() {
mapController.updateFeatureImage(null);
}
@Test(expected = UnsupportedOperationException.class)
public void testUpdateFeatureText() {
mapController.updateFeatureText(null);
}
@Test(expected = UnsupportedOperationException.class)
public void testUpdateFeatureDraggable() {
mapController.updateFeatureDraggable(null);
}
@Test(expected = UnsupportedOperationException.class)
public void testGetBoundingBox() {
mapController.getBoundingBox();
}
@Test(expected = UnsupportedOperationException.class)
public void testSetBoundingBox() {
mapController.setBoundingBox(null);
}
@Test(expected = UnsupportedOperationException.class)
public void testAddFeatureLineString() {
mapController.addFeature((MapLineString) null);
}
@Test(expected = UnsupportedOperationException.class)
public void testAddFeaturePolygon() {
mapController.addFeature((MapPolygon) null);
}
@Test(expected = UnsupportedOperationException.class)
public void testAddFeatureCircle() {
mapController.addFeature((MapCircle) null);
}
@Test(expected = UnsupportedOperationException.class)
public void testAddFeatureRectangle() {
mapController.addFeature((MapRectangle) null);
}
@Test(expected = UnsupportedOperationException.class)
public void testRemoveFeature() {
mapController.removeFeature(null);
}
@Test(expected = UnsupportedOperationException.class)
public void testShowFeature() {
mapController.showFeature(null);
}
@Test(expected = UnsupportedOperationException.class)
public void testHideFeature() {
mapController.hideFeature(null);
}
@Test(expected = UnsupportedOperationException.class)
public void testIsFeatureVisible() {
mapController.isFeatureVisible(null);
}
@Test(expected = UnsupportedOperationException.class)
public void testShowInfobox() {
mapController.showInfobox(null);
}
@Test(expected = UnsupportedOperationException.class)
public void testHideInfobox() {
mapController.hideInfobox(null);
}
@Test(expected = UnsupportedOperationException.class)
public void testIsInfoboxVisible() {
mapController.isInfoboxVisible(null);
}
@Test(expected = UnsupportedOperationException.class)
public void testUpdateFeaturePositionLineString() {
mapController.updateFeaturePosition((MapLineString) null);
}
@Test(expected = UnsupportedOperationException.class)
public void testUpdateFeaturePositionPolygon() {
mapController.updateFeaturePosition((MapPolygon) null);
}
@Test(expected = UnsupportedOperationException.class)
public void testUpdateFeatureHoles() {
mapController.updateFeatureDraggable(null);
}
@Test(expected = UnsupportedOperationException.class)
public void testUpdateFeaturePositionCircle() {
mapController.updateFeaturePosition((MapCircle) null);
}
@Test(expected = UnsupportedOperationException.class)
public void testUpdateFeaturePositionRectangle() {
mapController.updateFeaturePosition((MapRectangle) null);
}
@Test(expected = UnsupportedOperationException.class)
public void testUpdateFeatureStroke() {
mapController.updateFeatureStroke(null);
}
@Test(expected = UnsupportedOperationException.class)
public void testUpdateFeatureSize() {
mapController.updateFeatureSize(null);
}
@Test(expected = UnsupportedOperationException.class)
public void testGetLocationListener() {
mapController.getLocationListener();
}
@Test(expected = UnsupportedOperationException.class)
public void testGetOverlayCount() {
mapController.getOverlayCount();
}
}