Revision 22037 branches/Mobile_Compatible_Hito_1/libFMap_mobile_shp_driver/src-test/org/gvsig/data/datastores/vectorial/file/shp/FilterTest.java

View differences:

FilterTest.java
23 23
import org.gvsig.data.InitializeException;
24 24
import org.gvsig.data.OpenException;
25 25
import org.gvsig.data.ReadException;
26
import org.gvsig.data.datastores.vectorial.file.ResourceReader;
27
import org.gvsig.data.datastores.vectorial.file.Utils;
26
import org.gvsig.data.datastores.vectorial.file.shp_inst.InstSHPRegister;
27
import org.gvsig.data.datastores.vectorial.file.shp_inst.InstSHPStore;
28 28
import org.gvsig.data.datastores.vectorial.file.shp_jni.JNISHPRegister;
29 29
import org.gvsig.data.datastores.vectorial.file.shp_jni.JNISHPStore;
30 30
import org.gvsig.data.datastores.vectorial.file.shp_mem.MemSHPRegister;
31 31
import org.gvsig.data.datastores.vectorial.file.shp_mem.MemSHPStore;
32 32
import org.gvsig.data.datastores.vectorial.file.shp_util.IGeometricDataStore;
33 33
import org.gvsig.data.datastores.vectorial.file.shp_util.NewShpFeatureID;
34
import org.gvsig.data.datastores.vectorial.file.shp_util.ResourceReader;
35
import org.gvsig.data.datastores.vectorial.file.shp_util.Utils;
34 36
import org.gvsig.data.vectorial.Feature;
35 37
import org.gvsig.data.vectorial.FeatureAttributeDescriptor;
36 38
import org.gvsig.data.vectorial.FeatureType;
......
57 59
	private IGeometricDataStore ioStore;
58 60
	private IGeometricDataStore jniStore;
59 61
	private IGeometricDataStore memStore;
62
	private IGeometricDataStore insStore;
60 63
	
61 64
	public static void main(String[] args) { //
62 65
		junit.textui.TestRunner.run(FilterTest.class);
......
116 119
		Register.selfRegister();
117 120
		MemSHPRegister.selfRegister();
118 121
		JNISHPRegister.selfRegister();
122
		InstSHPRegister.selfRegister();
119 123
	}
120 124
	
121 125
	public void doInitialize() {
......
151 155
		} catch (InitializeException e) {
152 156
			logger.error("While creating datastore: " + e.getMessage());
153 157
		}
158
		// ===============================================
159
		SHPStoreParameters shpParameters4 = null;
160
		shpParameters4 =(SHPStoreParameters) manager.createDataStoreParameters(InstSHPStore.DATASTORE_NAME);
161
		shpParameters4.setFile(fileNormal);
162
		shpParameters4.setDataStoreName(InstSHPStore.DATASTORE_NAME);
163
		try {
164
			insStore = (InstSHPStore) manager.createDataStore((DataStoreParameters) shpParameters4);
165
		} catch (InitializeException e) {
166
			logger.error("While creating datastore: " + e.getMessage());
167
		}
154 168
	}
155 169
	
156 170
	
......
195 209
		order[0]=new FilterFactory2Impl().sort("TIPO", SortOrder.ASCENDING);
196 210
		order[1]=new FilterFactory2Impl().sort("AREA", SortOrder.ASCENDING);
197 211
		assertEquals(9,testshp(null, order, ioStore));
198
//		assertEquals(9,testshp(null, order, jniStore));
199
//		assertEquals(9,testshp(null, order, memStore));
212
		assertEquals(9,testshp(null, order, jniStore));
213
		assertEquals(9,testshp(null, order, memStore));
214
		assertEquals(9,testshp(null, order, insStore));
200 215
	}
201 216
	
202 217
	public void testGT(){
......
207 222
		Expression exp2 = fact.literal(30000000);
208 223
		Filter filter = fact.greater(exp1, exp2);
209 224
		assertEquals(4,testshp(filter, null, ioStore));
210
//		assertEquals(4,testshp(filter, null, jniStore));
211
//		assertEquals(4,testshp(filter, null, memStore));
225
		assertEquals(4,testshp(filter, null, jniStore));
226
		assertEquals(4,testshp(filter, null, memStore));
227
		assertEquals(4,testshp(filter, null, insStore));
212 228
	}
213 229
	
214 230
	public void testGT_string(){
......
221 237
		assertEquals(2,testshp(filter, null, ioStore));
222 238
		assertEquals(2,testshp(filter, null, memStore));
223 239
		assertEquals(2,testshp(filter, null, jniStore));
240
		assertEquals(2,testshp(filter, null, insStore));
224 241
	}
225 242

  
226 243
	public void testGTE(){
......
233 250
		assertEquals(3,testshp(filter, null, ioStore));
234 251
		assertEquals(3,testshp(filter, null, memStore));
235 252
		assertEquals(3,testshp(filter, null, jniStore));
253
		assertEquals(3,testshp(filter, null, insStore));
236 254
	}
237 255
	
238 256
	public void testLT(){
......
245 263
		assertEquals(5,testshp(filter, null, ioStore));
246 264
		assertEquals(5,testshp(filter, null, memStore));
247 265
		assertEquals(5,testshp(filter, null, jniStore));
266
		assertEquals(5,testshp(filter, null, insStore));
248 267
	}
249 268
	
250 269
	public void testLTE(){
......
257 276
		assertEquals(7,testshp(filter, null, ioStore));
258 277
		assertEquals(7,testshp(filter, null, memStore));
259 278
		assertEquals(7,testshp(filter, null, jniStore));
279
		assertEquals(7,testshp(filter, null, insStore));
260 280
	}	
261 281

  
262 282
	public void testEquals(){
......
269 289
		assertEquals(1,testshp(filter, null, ioStore));
270 290
		assertEquals(1,testshp(filter, null, jniStore));
271 291
		assertEquals(1,testshp(filter, null, memStore));
292
		assertEquals(1,testshp(filter, null, insStore));
272 293
	}	
273 294

  
274 295
	public void testEquals_String(){
......
281 302
		assertEquals(1,testshp(filter, null, ioStore));
282 303
		assertEquals(1,testshp(filter, null, memStore));
283 304
		assertEquals(1,testshp(filter, null, jniStore));
305
		assertEquals(1,testshp(filter, null, insStore));
284 306
	}	
285 307

  
286 308
	public void testNotEquals(){
......
293 315
		assertEquals(8,testshp(filter, null, ioStore));
294 316
		assertEquals(8,testshp(filter, null, memStore));
295 317
		assertEquals(8,testshp(filter, null, jniStore));
318
		assertEquals(8,testshp(filter, null, insStore));
296 319
	}	
297 320
	
298 321
	public void testNot(){
......
306 329
		assertEquals(8,testshp(filter, null, ioStore));
307 330
		assertEquals(8,testshp(filter, null, jniStore));
308 331
		assertEquals(8,testshp(filter, null, memStore));
332
		assertEquals(8,testshp(filter, null, insStore));
309 333
	}	
310 334
	
311 335
	/**
......
334 358
		assertEquals(2,testshp(filter, null, ioStore));
335 359
		assertEquals(2,testshp(filter, null, memStore));
336 360
		assertEquals(2,testshp(filter, null, jniStore));
361
		assertEquals(2,testshp(filter, null, insStore));
337 362
	}	
338 363
	
339 364
	public void testLike(){
......
345 370
		assertEquals(2,testshp(filter, null, ioStore));
346 371
		assertEquals(2,testshp(filter, null, jniStore));
347 372
		assertEquals(2,testshp(filter, null, memStore));
373
		assertEquals(2,testshp(filter, null, insStore));
348 374
	}	
349 375

  
350 376
	public void testFId(){
......
372 398
		ids.add(new NewShpFeatureID(memStore, 6));
373 399
		filter = fact.id(ids);
374 400
		assertEquals(2, testshp(filter, null, memStore));
401
		
402
		ids = new HashSet();
403
		ids.add(new ShpFeatureID((SHPStore) insStore, 3));
404
		ids.add(new ShpFeatureID((SHPStore) insStore, 6));
405
		filter = fact.id(ids);
406
		assertEquals(2, testshp(filter, null, insStore));
375 407
	}
376 408

  
377 409
	public void testBBOX(){
......
383 415
		assertEquals(4,testshp(filter, null, ioStore));
384 416
		assertEquals(4,testshp(filter, null, memStore));
385 417
		assertEquals(4,testshp(filter, null, jniStore));
418
		assertEquals(4,testshp(filter, null, insStore));
386 419
	}
387 420
	
388 421
	public void testAnd(){
......
397 430
		assertEquals(1,testshp(filter, null, ioStore));
398 431
		assertEquals(1,testshp(filter, null, jniStore));
399 432
		assertEquals(1,testshp(filter, null, memStore));
433
		assertEquals(1,testshp(filter, null, insStore));
400 434
	}
401 435

  
402 436
	public void testOr(){
......
415 449
		assertEquals(5,testshp(filter, null, ioStore));
416 450
		assertEquals(5,testshp(filter, null, memStore));
417 451
		assertEquals(5,testshp(filter, null, jniStore));
452
		assertEquals(5,testshp(filter, null, insStore));
418 453
	}
419 454
	
420 455
	/**
......
431 466
		assertEquals(4,testshp(filter, null, ioStore));
432 467
		assertEquals(4,testshp(filter, null, jniStore));
433 468
		assertEquals(4,testshp(filter, null, memStore));
469
		assertEquals(4,testshp(filter, null, insStore));
434 470
	}
435 471
	
436 472
	/**
......
447 483
		assertEquals(4,testshp(filter, null, ioStore));
448 484
		assertEquals(4,testshp(filter, null, memStore));
449 485
		assertEquals(4,testshp(filter, null, jniStore));
486
		assertEquals(4,testshp(filter, null, insStore));
450 487
	}
451 488

  
452 489
	/**
......
463 500
		assertEquals(4,testshp(filter, null, ioStore));
464 501
		assertEquals(4,testshp(filter, null, jniStore));
465 502
		assertEquals(4,testshp(filter, null, memStore));
503
		assertEquals(4,testshp(filter, null, insStore));
466 504
	}
467 505
	
468 506
	/**
......
479 517
		assertEquals(4,testshp(filter, null, ioStore));
480 518
		assertEquals(4,testshp(filter, null, memStore));
481 519
		assertEquals(4,testshp(filter, null, jniStore));
520
		assertEquals(4,testshp(filter, null, insStore));
482 521
	}
483 522
	
484 523

  

Also available in: Unified diff