root / branches / v2_0_0_prep / libraries / libFMap_daldb / src-test / org / gvsig / fmap / data / feature / db / DBTest.java @ 24491
History | View | Annotate | Download (15.6 KB)
1 |
package org.gvsig.fmap.data.feature.db; |
---|---|
2 |
|
3 |
import java.util.Iterator; |
4 |
|
5 |
import junit.framework.TestCase; |
6 |
|
7 |
import org.gvsig.fmap.dal.DataExplorer; |
8 |
import org.gvsig.fmap.dal.DataExplorerParameters; |
9 |
import org.gvsig.fmap.dal.DataManager; |
10 |
import org.gvsig.fmap.dal.DataParameters; |
11 |
import org.gvsig.fmap.dal.DataSet; |
12 |
import org.gvsig.fmap.dal.DataStoreParameters; |
13 |
import org.gvsig.fmap.dal.exceptions.CloseException; |
14 |
import org.gvsig.fmap.dal.exceptions.DataException; |
15 |
import org.gvsig.fmap.dal.exceptions.InitializeException; |
16 |
import org.gvsig.fmap.dal.exceptions.ReadException; |
17 |
import org.gvsig.fmap.dal.exceptions.WriteException; |
18 |
import org.gvsig.fmap.dal.feature.Feature; |
19 |
import org.gvsig.fmap.dal.feature.FeatureSet; |
20 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
21 |
import org.gvsig.fmap.dal.feature.FeatureType; |
22 |
import org.gvsig.fmap.dal.feature.file.FileResource; |
23 |
import org.gvsig.fmap.dal.feature.impl.AbstractFeatureStore; |
24 |
import org.gvsig.fmap.dal.feature.visitor.PrintlnFeaturesVisitor; |
25 |
import org.gvsig.fmap.dal.impl.DefaultDataManager; |
26 |
import org.gvsig.fmap.dal.resource.ResourceManager; |
27 |
import org.gvsig.fmap.dal.resource.impl.DefaultResourceManager; |
28 |
import org.gvsig.fmap.dal.resource.spi.AbstractResource; |
29 |
import org.gvsig.fmap.data.feature.db.jdbc.JDBCExplorer; |
30 |
import org.gvsig.fmap.data.feature.db.jdbc.JDBCResource; |
31 |
import org.gvsig.fmap.data.feature.db.jdbc.JDBCStoreParameters; |
32 |
import org.gvsig.fmap.data.feature.db.jdbc.PrepareResourceObserverTest; |
33 |
import org.gvsig.fmap.geom.Geometry; |
34 |
import org.gvsig.fmap.geom.handler.Handler; |
35 |
import org.gvsig.tools.exception.BaseException; |
36 |
import org.gvsig.tools.observer.Observer; |
37 |
|
38 |
import com.iver.utiles.XMLEntity; |
39 |
import com.iver.utiles.XMLException; |
40 |
|
41 |
public abstract class DBTest extends TestCase { |
42 |
|
43 |
public void doFileResourceTest(JDBCStoreParameters params) { |
44 |
doFileResourceTest(params,true);
|
45 |
} |
46 |
|
47 |
public void doFileResourceTest(JDBCStoreParameters params, boolean testEdit) { |
48 |
DataManager manager = DefaultDataManager.getManager(); |
49 |
|
50 |
ResourceManager resMan = DefaultResourceManager.getResourceManager(); |
51 |
|
52 |
AbstractFeatureStore store=null;
|
53 |
FeatureStore store2=null;
|
54 |
FeatureStore store3=null;
|
55 |
try {
|
56 |
store = (AbstractFeatureStore)manager.createStore(params); |
57 |
store2 = (FeatureStore)manager.createStore(params); |
58 |
store3 = (FeatureStore)manager.createStore(params); |
59 |
} catch (InitializeException e1) {
|
60 |
e1.printStackTrace();fail(); |
61 |
} |
62 |
|
63 |
int i=0; |
64 |
AbstractResource res = null;
|
65 |
AbstractResource tmpRes = null;
|
66 |
Object obj = null; |
67 |
|
68 |
Iterator iter = resMan.iterator();
|
69 |
while (iter.hasNext()){
|
70 |
obj = iter.next(); |
71 |
if (obj instanceof JDBCResource){ |
72 |
tmpRes = (AbstractResource)obj; |
73 |
//FIXME no se puede comparar por url porque es de JDBC
|
74 |
if (((JDBCResource) tmpRes).getUrl().equals(params.getUrl())) {
|
75 |
i++; |
76 |
res=tmpRes; |
77 |
} |
78 |
} |
79 |
} |
80 |
|
81 |
assertEquals(1, i);
|
82 |
|
83 |
assertEquals(3, res.getRefencesCount());
|
84 |
|
85 |
try {
|
86 |
store.close(); |
87 |
} catch (CloseException e1) {
|
88 |
e1.printStackTrace();fail(); |
89 |
} |
90 |
|
91 |
assertEquals(false, res.isOpen());
|
92 |
|
93 |
DataSet coll = null;
|
94 |
|
95 |
try {
|
96 |
coll =store.getDataSet(); |
97 |
} catch (ReadException e1) {
|
98 |
e1.printStackTrace();fail(); |
99 |
} |
100 |
|
101 |
coll.iterator().next(); |
102 |
|
103 |
assertEquals(true, res.isOpen());
|
104 |
|
105 |
coll.dispose(); |
106 |
|
107 |
|
108 |
|
109 |
if (store.allowWrite() && testEdit){
|
110 |
/*Test edition notification*/
|
111 |
|
112 |
int fCountOrg=0; |
113 |
int fCountFin=0; |
114 |
try {
|
115 |
fCountOrg = store.getDataSet().size(); |
116 |
} catch (ReadException e2) {
|
117 |
// TODO Auto-generated catch block
|
118 |
e2.printStackTrace();fail(); |
119 |
} |
120 |
try {
|
121 |
store.edit(); |
122 |
} catch (ReadException e1) {
|
123 |
e1.printStackTrace();fail(); |
124 |
} |
125 |
|
126 |
try {
|
127 |
coll = store2.getDataSet(); |
128 |
} catch (ReadException e1) {
|
129 |
e1.printStackTrace();fail(); |
130 |
} |
131 |
|
132 |
try {
|
133 |
store.finishEditing(); |
134 |
} catch (WriteException e1) {
|
135 |
e1.printStackTrace();fail(); |
136 |
} catch (ReadException e1) {
|
137 |
// TODO Auto-generated catch block
|
138 |
e1.printStackTrace();fail(); |
139 |
} |
140 |
|
141 |
try {
|
142 |
fCountFin = store.getDataSet().size(); |
143 |
} catch (ReadException e2) {
|
144 |
// TODO Auto-generated catch block
|
145 |
e2.printStackTrace();fail(); |
146 |
} |
147 |
|
148 |
assertEquals(fCountOrg, fCountFin); |
149 |
|
150 |
|
151 |
boolean isOk = false; |
152 |
try{
|
153 |
coll.iterator().next(); |
154 |
} catch (Exception e){ |
155 |
isOk=true;
|
156 |
} |
157 |
assertTrue("Resource Changed Notification fails",isOk);
|
158 |
|
159 |
coll.dispose(); |
160 |
|
161 |
/*Test edition notification END*/
|
162 |
|
163 |
} |
164 |
|
165 |
|
166 |
JDBCExplorer explorer = null;
|
167 |
try {
|
168 |
explorer = (JDBCExplorer) store.getExplorer(); |
169 |
} catch (ReadException e) {
|
170 |
e.printStackTrace();fail(); |
171 |
} |
172 |
|
173 |
if (explorer != null){ |
174 |
assertEquals(4, res.getRefencesCount());
|
175 |
|
176 |
try {
|
177 |
explorer.list(); |
178 |
} catch (ReadException e) {
|
179 |
e.printStackTrace();fail(); |
180 |
} |
181 |
|
182 |
try {
|
183 |
explorer.dispose(); |
184 |
} catch (DataException e1) {
|
185 |
e1.printStackTrace();fail(); |
186 |
} |
187 |
|
188 |
|
189 |
assertEquals(3, res.getRefencesCount());
|
190 |
} |
191 |
try {
|
192 |
store3.dispose(); |
193 |
} catch (CloseException e1) {
|
194 |
e1.printStackTrace();fail(); |
195 |
} |
196 |
|
197 |
assertEquals(2, res.getRefencesCount());
|
198 |
|
199 |
try {
|
200 |
store2.dispose(); |
201 |
} catch (CloseException e1) {
|
202 |
e1.printStackTrace();fail(); |
203 |
} |
204 |
|
205 |
assertEquals(1, res.getRefencesCount());
|
206 |
|
207 |
try {
|
208 |
store.dispose(); |
209 |
} catch (CloseException e1) {
|
210 |
e1.printStackTrace();fail(); |
211 |
} |
212 |
|
213 |
assertEquals(0, res.getRefencesCount());
|
214 |
res = null;
|
215 |
|
216 |
i=0;
|
217 |
iter = resMan.iterator(); |
218 |
while (iter.hasNext()){
|
219 |
obj = iter.next(); |
220 |
if (obj instanceof FileResource){ |
221 |
tmpRes = (AbstractResource)obj; |
222 |
//FIXME no se puede comparar por url porque es de JDBC
|
223 |
if (((JDBCResource) tmpRes).getUrl().equals(params.getUrl())) {
|
224 |
i++; |
225 |
res=tmpRes; |
226 |
} |
227 |
} |
228 |
} |
229 |
|
230 |
assertEquals(0, i);
|
231 |
|
232 |
doPrepareFileResourceTest(params); |
233 |
|
234 |
} |
235 |
|
236 |
public void doPrepareFileResourceTest(JDBCStoreParameters params) { |
237 |
DataManager manager = DefaultDataManager.getManager(); |
238 |
|
239 |
DefaultResourceManager resMan = DefaultResourceManager.getResourceManager(); |
240 |
|
241 |
String passw = params.getPassw();
|
242 |
params.setPassw("--------------");
|
243 |
|
244 |
Observer obs = new PrepareResourceObserverTest(params.getUrl(), passw); |
245 |
|
246 |
|
247 |
resMan.addObserver(obs); |
248 |
|
249 |
AbstractFeatureStore store=null;
|
250 |
try {
|
251 |
store = (AbstractFeatureStore)manager.createStore(params); |
252 |
} catch (InitializeException e1) {
|
253 |
e1.printStackTrace();fail(); |
254 |
} catch (Exception e2){ |
255 |
e2.printStackTrace();fail(); |
256 |
} |
257 |
|
258 |
try {
|
259 |
store.getDataSet().iterator().next(); |
260 |
} catch (ReadException e) {
|
261 |
// TODO Auto-generated catch block
|
262 |
e.printStackTrace();fail(); |
263 |
} |
264 |
|
265 |
try {
|
266 |
store.close(); |
267 |
} catch (CloseException e) {
|
268 |
// TODO Auto-generated catch block
|
269 |
e.printStackTrace();fail(); |
270 |
} |
271 |
try {
|
272 |
store.dispose(); |
273 |
} catch (CloseException e) {
|
274 |
// TODO Auto-generated catch block
|
275 |
e.printStackTrace();fail(); |
276 |
} |
277 |
params.setPassw(passw); |
278 |
|
279 |
resMan.deleteObserver(obs); |
280 |
|
281 |
} |
282 |
|
283 |
public DBTest() {
|
284 |
super();
|
285 |
} |
286 |
|
287 |
protected void storeTest(DataStoreParameters dp, String filter, String order, boolean testEdit) { |
288 |
DataManager dsm=DefaultDataManager.getManager(); |
289 |
|
290 |
|
291 |
FeatureStore fs=null;
|
292 |
FeatureSet fc = null;
|
293 |
try {
|
294 |
fs = (FeatureStore)dsm.createStore(dp); |
295 |
} catch (InitializeException e) {
|
296 |
e.printStackTrace(); |
297 |
fail("Exception:" + e);
|
298 |
} |
299 |
//
|
300 |
// try {
|
301 |
// fs.open();
|
302 |
// } catch (OpenException e2) {
|
303 |
// e2.printStackTrace();
|
304 |
// fail();
|
305 |
// }
|
306 |
|
307 |
try {
|
308 |
fc = (FeatureSet) fs.getDataSet(); |
309 |
} catch (ReadException e3) {
|
310 |
e3.printStackTrace(); |
311 |
fail(); |
312 |
return;
|
313 |
} |
314 |
int size = fc.size();
|
315 |
fc.dispose(); |
316 |
|
317 |
if (fs.allowWrite() && testEdit) {
|
318 |
|
319 |
try{
|
320 |
|
321 |
fs.edit(); |
322 |
|
323 |
Feature feature1 = fs.createNewFeature(false);
|
324 |
feature1.editing(); |
325 |
feature1.setAttribute("ID",1); |
326 |
Feature feature2 = fs.createNewFeature(false);
|
327 |
feature2.editing(); |
328 |
feature2.setAttribute("ID",2); |
329 |
Feature feature3 = fs.createNewFeature(false);
|
330 |
feature3.editing(); |
331 |
feature3.setAttribute("ID",3); |
332 |
|
333 |
|
334 |
|
335 |
fs.insert(feature1); |
336 |
fs.insert(feature2); |
337 |
fs.insert(feature3); |
338 |
|
339 |
fc = (FeatureSet) fs.getDataSet(); |
340 |
assertEquals(size + 3, fc.size());
|
341 |
fc.dispose(); |
342 |
|
343 |
|
344 |
feature1.editing(); |
345 |
feature1.setAttribute(1,111111); |
346 |
fs.update(feature1); |
347 |
|
348 |
fc = (FeatureSet) fs.getDataSet(); |
349 |
assertEquals(size + 3, fc.size());
|
350 |
fc.dispose(); |
351 |
|
352 |
fs.delete(feature3); |
353 |
fs.delete(feature2); |
354 |
fs.delete(feature1); |
355 |
|
356 |
fc = (FeatureSet) fs.getDataSet(); |
357 |
assertEquals(size, fc.size()); |
358 |
fc.dispose(); |
359 |
|
360 |
}catch (DataException e) {
|
361 |
e.printStackTrace(); |
362 |
fail(); |
363 |
} |
364 |
} |
365 |
|
366 |
//Mostrar por consola todos los registros.
|
367 |
FeatureType ft= fs.getDefaultFeatureType(); |
368 |
|
369 |
try {
|
370 |
fc = (FeatureSet) fs.getDataSet(); |
371 |
} catch (ReadException e3) {
|
372 |
e3.printStackTrace(); |
373 |
fail(); |
374 |
return;
|
375 |
} |
376 |
assertEquals(size, fc.size()); |
377 |
fc.dispose(); |
378 |
|
379 |
// featureCollection = (FeatureCollection)fs.getDataCollection();
|
380 |
// featureCollection = (FeatureCollection)fs.getDataCollection(ft,"NOMBRE = 'CALPE'",null);
|
381 |
// featureCollection = (FeatureCollection)fs.getDataCollection(ft,"AREA > 3.2213163729E7 and AREA < 3.2213163749E7",null);
|
382 |
try {
|
383 |
fc = (FeatureSet)fs.getDataCollection(ft,filter,order); |
384 |
} catch (ReadException e2) {
|
385 |
// TODO Auto-generated catch block
|
386 |
e2.printStackTrace(); |
387 |
} |
388 |
|
389 |
PrintlnFeaturesVisitor visitor=new PrintlnFeaturesVisitor(ft);
|
390 |
try {
|
391 |
fc.accept(visitor); |
392 |
} catch (BaseException e1) {
|
393 |
e1.printStackTrace(); |
394 |
fail("Exception: "+e1);
|
395 |
} |
396 |
fc.dispose(); |
397 |
|
398 |
if (fs.allowWrite() && testEdit){
|
399 |
try {
|
400 |
fs.finishEditing(); |
401 |
// fs.cancelEditing();
|
402 |
} catch (WriteException e) {
|
403 |
e.printStackTrace(); |
404 |
fail("Exception: "+e);
|
405 |
} catch (ReadException e) {
|
406 |
e.printStackTrace(); |
407 |
fail("Exception: "+e);
|
408 |
} |
409 |
} |
410 |
// try {
|
411 |
// fs.close();
|
412 |
// } catch (CloseException e) {
|
413 |
// e.printStackTrace();
|
414 |
// fail("Exception: "+e);
|
415 |
// }
|
416 |
try {
|
417 |
fs.dispose(); |
418 |
} catch (CloseException e) {
|
419 |
// TODO Auto-generated catch block
|
420 |
e.printStackTrace(); |
421 |
} |
422 |
|
423 |
persistenceTest(dp); |
424 |
mapParamsBaseTest(dp); |
425 |
} |
426 |
|
427 |
protected void persistenceTest(DataStoreParameters params) { |
428 |
DataManager manager = DefaultDataManager.getManager(); |
429 |
|
430 |
DataStoreParameters params2 = null;
|
431 |
XMLEntity paramsXML = null;
|
432 |
XMLEntity params2XML = null;
|
433 |
|
434 |
paramsXML = params.getXMLEntity(); |
435 |
|
436 |
try {
|
437 |
params2 = manager.createStoreParameters(paramsXML); |
438 |
} catch (InitializeException e) {
|
439 |
e.printStackTrace(); |
440 |
fail(); |
441 |
} |
442 |
|
443 |
params2XML = params2.getXMLEntity(); |
444 |
|
445 |
assertEquals(paramsXML.toString(), params2XML.toString()); |
446 |
|
447 |
FeatureStore store = null;
|
448 |
XMLEntity storeXML = null;
|
449 |
FeatureStore store2 = null;
|
450 |
XMLEntity store2XML = null;
|
451 |
|
452 |
try {
|
453 |
store = (FeatureStore) manager.createStore(params); |
454 |
} catch (InitializeException e) {
|
455 |
e.printStackTrace(); |
456 |
fail(); |
457 |
} |
458 |
|
459 |
try {
|
460 |
storeXML = store.getXMLEntity(); |
461 |
} catch (XMLException e1) {
|
462 |
e1.printStackTrace(); |
463 |
fail(); |
464 |
} |
465 |
|
466 |
assertNotNull(storeXML); |
467 |
|
468 |
try {
|
469 |
store2 = (FeatureStore) manager.createStore(storeXML); |
470 |
} catch (InitializeException e) {
|
471 |
e.printStackTrace(); |
472 |
fail(); |
473 |
} |
474 |
|
475 |
try {
|
476 |
store2XML = store2.getXMLEntity(); |
477 |
} catch (XMLException e1) {
|
478 |
e1.printStackTrace(); |
479 |
fail(); |
480 |
} |
481 |
|
482 |
assertEquals(storeXML.toString(), store2XML.toString()); |
483 |
|
484 |
FeatureSet coll = null;
|
485 |
FeatureSet coll2 = null;
|
486 |
Iterator iter = null; |
487 |
Iterator iter2 = null; |
488 |
Feature feature = null;
|
489 |
Feature feature2 = null;
|
490 |
Comparable v1 = null; |
491 |
Comparable v2 = null; |
492 |
Handler h = null; |
493 |
Handler h2 = null; |
494 |
|
495 |
try {
|
496 |
coll = (FeatureSet) store.getDataSet(); |
497 |
coll2 = (FeatureSet) store2.getDataSet(); |
498 |
} catch (ReadException e) {
|
499 |
e.printStackTrace(); |
500 |
fail(); |
501 |
} |
502 |
|
503 |
assertEquals(coll.size(), coll2.size()); |
504 |
|
505 |
iter = coll.iterator(); |
506 |
iter2 = coll2.iterator(); |
507 |
int i;
|
508 |
int featureSize = store.getDefaultFeatureType().size();
|
509 |
|
510 |
try {
|
511 |
while (iter.hasNext()) {
|
512 |
feature = (Feature) iter.next(); |
513 |
feature2 = (Feature) iter2.next(); |
514 |
for (i = 0; i < featureSize; i++) { |
515 |
v1 = (Comparable) feature.get(i);
|
516 |
v2 = (Comparable) feature2.get(i);
|
517 |
if (v1 == null) { |
518 |
assertNull(v2); |
519 |
} else if (v1 instanceof Geometry) { |
520 |
assertTrue(v2 instanceof Geometry);
|
521 |
assertEquals(((Geometry) v1).getType(), ((Geometry) v2) |
522 |
.getType()); |
523 |
assertEquals( |
524 |
(((Geometry) v1) |
525 |
.getHandlers(Geometry.SELECTHANDLER)).length, |
526 |
(((Geometry) v2) |
527 |
.getHandlers(Geometry.SELECTHANDLER)).length); |
528 |
h = (((Geometry) v1) |
529 |
.getHandlers(Geometry.SELECTHANDLER))[0];
|
530 |
h2 = (((Geometry) v2) |
531 |
.getHandlers(Geometry.SELECTHANDLER))[0];
|
532 |
|
533 |
assertEquals(0.0, h.getPoint().distance(h2.getPoint()),
|
534 |
0.000001);
|
535 |
|
536 |
h = (((Geometry) v1) |
537 |
.getHandlers(Geometry.SELECTHANDLER))[(((Geometry) v1) |
538 |
.getHandlers(Geometry.SELECTHANDLER)).length - 1];
|
539 |
h2 = (((Geometry) v2) |
540 |
.getHandlers(Geometry.SELECTHANDLER))[(((Geometry) v2) |
541 |
.getHandlers(Geometry.SELECTHANDLER)).length - 1];
|
542 |
|
543 |
assertEquals(0.0, h.getPoint().distance(h2.getPoint()),
|
544 |
0.000001);
|
545 |
|
546 |
} else {
|
547 |
assertEquals(0, v1.compareTo(v2));
|
548 |
} |
549 |
} |
550 |
|
551 |
} |
552 |
} catch (Exception e) { |
553 |
e.printStackTrace(); |
554 |
fail(); |
555 |
} |
556 |
|
557 |
coll.dispose(); |
558 |
coll2.dispose(); |
559 |
|
560 |
try {
|
561 |
store.dispose(); |
562 |
store2.dispose(); |
563 |
} catch (CloseException e) {
|
564 |
e.printStackTrace(); |
565 |
fail(); |
566 |
} |
567 |
|
568 |
} |
569 |
|
570 |
protected void persistenceTest(DataExplorerParameters params1) { |
571 |
DataManager manager = DefaultDataManager.getManager(); |
572 |
|
573 |
XMLEntity params1XML; |
574 |
DataExplorerParameters params2 = null;
|
575 |
XMLEntity params2XML; |
576 |
|
577 |
DataExplorer explorer1 = null;
|
578 |
XMLEntity explorer1XML; |
579 |
DataExplorer explorer2 = null;
|
580 |
XMLEntity explorer2XML; |
581 |
|
582 |
params1XML = params1.getXMLEntity(); |
583 |
|
584 |
try {
|
585 |
params2 = manager.createExplorerParameters(params1XML); |
586 |
} catch (InitializeException e) {
|
587 |
e.printStackTrace(); |
588 |
fail(); |
589 |
} |
590 |
|
591 |
params2XML = params2.getXMLEntity(); |
592 |
|
593 |
assertEquals(params1XML.toString(), params2XML.toString()); |
594 |
|
595 |
try {
|
596 |
explorer1 = manager.createExplorer(params1); |
597 |
} catch (InitializeException e1) {
|
598 |
e1.printStackTrace(); |
599 |
fail(); |
600 |
} |
601 |
|
602 |
explorer1XML = explorer1.getXMLEntity(); |
603 |
|
604 |
try {
|
605 |
explorer2 = manager.createExplorer(explorer1XML); |
606 |
} catch (InitializeException e1) {
|
607 |
e1.printStackTrace(); |
608 |
fail(); |
609 |
} |
610 |
|
611 |
explorer2XML = explorer2.getXMLEntity(); |
612 |
|
613 |
assertEquals(explorer1XML.toString(), explorer2XML.toString()); |
614 |
|
615 |
DataStoreParameters list1[] = null; |
616 |
DataStoreParameters list2[] = null; |
617 |
|
618 |
try {
|
619 |
list1 = explorer1.list(); |
620 |
list2 = explorer2.list(); |
621 |
} catch (ReadException e) {
|
622 |
e.printStackTrace(); |
623 |
fail(); |
624 |
} |
625 |
|
626 |
assertEquals(list1.length, list2.length); |
627 |
|
628 |
for (int i = 0; i < list1.length; i++) { |
629 |
assertEquals(list1[i].getXMLEntity().toString(), list2[i] |
630 |
.getXMLEntity().toString()); |
631 |
} |
632 |
|
633 |
try {
|
634 |
explorer1.dispose(); |
635 |
explorer2.dispose(); |
636 |
} catch (DataException e) {
|
637 |
e.printStackTrace(); |
638 |
fail(); |
639 |
} |
640 |
|
641 |
|
642 |
} |
643 |
|
644 |
private void mapParamsBaseTest(DataParameters params) { |
645 |
Exception e = null; |
646 |
try {
|
647 |
params.put(new Integer(0), "GEOMETRY_x"); |
648 |
} catch (Exception e1) { |
649 |
e = e1; |
650 |
} |
651 |
assertNull(e); |
652 |
|
653 |
e = null;
|
654 |
try {
|
655 |
params.put("kk", "GEOMETRY_x"); |
656 |
} catch (IllegalArgumentException e1) { |
657 |
e = e1; |
658 |
} |
659 |
assertNull(e); |
660 |
|
661 |
e = null;
|
662 |
try {
|
663 |
params.entrySet(); |
664 |
} catch (UnsupportedOperationException e1) { |
665 |
e = e1; |
666 |
} |
667 |
assertNull(e); |
668 |
|
669 |
e = null;
|
670 |
try {
|
671 |
params.keySet().add("hola");
|
672 |
} catch (UnsupportedOperationException e1) { |
673 |
e = e1; |
674 |
} |
675 |
assertNotNull(e); |
676 |
|
677 |
e = null;
|
678 |
try {
|
679 |
params.keySet().remove("storeSecondary");
|
680 |
} catch (UnsupportedOperationException e1) { |
681 |
e = e1; |
682 |
} |
683 |
assertNotNull(e); |
684 |
|
685 |
e = null;
|
686 |
try {
|
687 |
params.values().remove("GEOMETRY_x");
|
688 |
} catch (UnsupportedOperationException e1) { |
689 |
e = e1; |
690 |
} |
691 |
assertNotNull(e); |
692 |
|
693 |
e = null;
|
694 |
try {
|
695 |
params.values().add("GEOMETRY_x");
|
696 |
} catch (UnsupportedOperationException e1) { |
697 |
e = e1; |
698 |
} |
699 |
assertNotNull(e); |
700 |
|
701 |
} |
702 |
|
703 |
} |