svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.plugin / org.gvsig.sqlite / org.gvsig.sqlite.provider / src / test / java / org / gvsig / sqlite / dal / TestCreate.java @ 47779
History | View | Annotate | Download (22.8 KB)
1 |
package org.gvsig.sqlite.dal; |
---|---|
2 |
|
3 |
import java.util.ArrayList; |
4 |
import java.util.Date; |
5 |
import java.util.List; |
6 |
import junit.framework.TestCase; |
7 |
import static junit.framework.TestCase.assertEquals; |
8 |
import org.apache.commons.lang3.StringUtils; |
9 |
import org.gvsig.expressionevaluator.ExpressionBuilder; |
10 |
import org.gvsig.expressionevaluator.ExpressionUtils; |
11 |
import org.gvsig.fmap.dal.DALLocator; |
12 |
import org.gvsig.fmap.dal.DataManager; |
13 |
import org.gvsig.fmap.dal.DataTransaction; |
14 |
import org.gvsig.fmap.dal.DataTypes; |
15 |
import org.gvsig.fmap.dal.exception.ValidateDataParametersException; |
16 |
import org.gvsig.fmap.dal.feature.EditableFeature; |
17 |
import org.gvsig.fmap.dal.feature.EditableFeatureAttributeDescriptor; |
18 |
import org.gvsig.fmap.dal.feature.EditableFeatureType; |
19 |
import org.gvsig.fmap.dal.feature.Feature; |
20 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
21 |
import org.gvsig.fmap.dal.feature.FeatureQuery; |
22 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
23 |
import org.gvsig.fmap.dal.feature.FeatureType; |
24 |
import org.gvsig.fmap.dal.feature.NewFeatureStoreParameters; |
25 |
import org.gvsig.fmap.dal.impl.expressionevaluator.DefaultFeatureAttributeEmulatorExpression; |
26 |
import org.gvsig.fmap.dal.store.jdbc.JDBCStoreParameters; |
27 |
import org.gvsig.fmap.dal.store.jdbc2.JDBCServerExplorer; |
28 |
import org.gvsig.tools.dispose.DisposeUtils; |
29 |
import org.gvsig.tools.library.impl.DefaultLibrariesInitializer; |
30 |
import org.slf4j.Logger; |
31 |
import org.slf4j.LoggerFactory; |
32 |
|
33 |
public class TestCreate extends TestCase { |
34 |
private static final Logger LOGGER = LoggerFactory.getLogger(TestCreate.class); |
35 |
|
36 |
public static final String DBNAME = "testCreate"; |
37 |
|
38 |
public TestCreate(String testName) { |
39 |
super(testName);
|
40 |
} |
41 |
|
42 |
@Override
|
43 |
protected void setUp() throws Exception { |
44 |
super.setUp();
|
45 |
new DefaultLibrariesInitializer().fullInitialize();
|
46 |
} |
47 |
|
48 |
@Override
|
49 |
protected void tearDown() throws Exception { |
50 |
super.tearDown();
|
51 |
} |
52 |
|
53 |
// TODO add test methods here. The name must begin with 'test'. For example:
|
54 |
// public void testHello() {}
|
55 |
|
56 |
protected String getProviderName() { |
57 |
return SQLiteLibrary.NAME;
|
58 |
} |
59 |
|
60 |
protected String getTargetName() { |
61 |
return "testCreateTarget1"; |
62 |
} |
63 |
|
64 |
protected FeatureStore openTargetStore1(JDBCServerExplorer explorer, String targetName) throws Exception { |
65 |
JDBCStoreParameters params; |
66 |
if(StringUtils.isBlank(targetName)) {
|
67 |
params = explorer.get(getTargetName()); |
68 |
} else {
|
69 |
params = explorer.get(targetName); |
70 |
} |
71 |
|
72 |
DataManager dataManager = DALLocator.getDataManager(); |
73 |
FeatureStore store; |
74 |
try {
|
75 |
store = (FeatureStore) dataManager.openStore( |
76 |
getProviderName(), |
77 |
params |
78 |
); |
79 |
} catch(ValidateDataParametersException ex) {
|
80 |
LOGGER.warn(ex.getLocalizedMessageStack()); |
81 |
throw ex;
|
82 |
} |
83 |
return store;
|
84 |
} |
85 |
|
86 |
protected FeatureStore openTargetStore1(JDBCServerExplorer explorer) throws Exception { |
87 |
return openTargetStore1(explorer, getTargetName());
|
88 |
} |
89 |
|
90 |
protected void createFrom(JDBCServerExplorer explorer, FeatureStore sourceStore) throws Exception { |
91 |
createFrom(explorer, sourceStore, getTargetName()); |
92 |
} |
93 |
|
94 |
protected void createFrom(JDBCServerExplorer explorer, FeatureStore sourceStore, String targetName) throws Exception { |
95 |
NewFeatureStoreParameters params = (NewFeatureStoreParameters) explorer.getAddParameters( |
96 |
targetName |
97 |
); |
98 |
EditableFeatureType ft = params.getDefaultFeatureType(); |
99 |
ft.addAll(sourceStore.getDefaultFeatureType()); |
100 |
explorer.add(getProviderName(), params, true);
|
101 |
} |
102 |
|
103 |
protected void checkTypes(JDBCServerExplorer explorer, FeatureType sourceFeatureType) throws Exception { |
104 |
// DataType STRING_TYPE = ToolsLocator.getDataTypesManager().get(DataTypes.STRING);
|
105 |
// DataType INT_TYPE = ToolsLocator.getDataTypesManager().get(DataTypes.INT);
|
106 |
|
107 |
FeatureStore targetStore = openTargetStore1(explorer); |
108 |
FeatureType targetFeatureType = targetStore.getDefaultFeatureType(); |
109 |
|
110 |
assertEquals("Feature type size",sourceFeatureType.size(), targetFeatureType.size());
|
111 |
for (int i = 0; i < sourceFeatureType.size(); i++) { |
112 |
FeatureAttributeDescriptor sourceAttr = sourceFeatureType.get(i); |
113 |
FeatureAttributeDescriptor targetAttr = targetFeatureType.get(i); |
114 |
switch(sourceAttr.getType()) {
|
115 |
case DataTypes.BYTE:
|
116 |
case DataTypes.INT:
|
117 |
case DataTypes.LONG:
|
118 |
case DataTypes.BOOLEAN:
|
119 |
case DataTypes.DATE:
|
120 |
case DataTypes.STRING:
|
121 |
case DataTypes.TIME:
|
122 |
case DataTypes.TIMESTAMP:
|
123 |
case DataTypes.DOUBLE:
|
124 |
case DataTypes.FLOAT:
|
125 |
case DataTypes.DECIMAL:
|
126 |
assertEquals( |
127 |
String.format("Field %s name mismatch", sourceAttr.getName()), |
128 |
sourceAttr.getName(), |
129 |
targetAttr.getName() |
130 |
); |
131 |
assertEquals( |
132 |
String.format("Field %s type mismatch", sourceAttr.getName()), |
133 |
sourceAttr.getDataTypeName(), |
134 |
targetAttr.getDataTypeName() |
135 |
); |
136 |
assertEquals( |
137 |
String.format("Field %s size mismatch", sourceAttr.getName()), |
138 |
sourceAttr.getSize(), |
139 |
targetAttr.getSize() |
140 |
); |
141 |
assertEquals( |
142 |
String.format("Field %s precision mismatch", sourceAttr.getName()), |
143 |
sourceAttr.getPrecision(), |
144 |
targetAttr.getPrecision() |
145 |
); |
146 |
assertEquals( |
147 |
String.format("Field %s scale mismatch", sourceAttr.getName()), |
148 |
sourceAttr.getScale(), |
149 |
targetAttr.getScale() |
150 |
); |
151 |
break;
|
152 |
case DataTypes.GEOMETRY:
|
153 |
assertEquals( |
154 |
String.format("Field %s name mismatch", sourceAttr.getName()), |
155 |
sourceAttr.getName(), |
156 |
targetAttr.getName() |
157 |
); |
158 |
assertEquals( |
159 |
String.format("Field %s type mismatch", sourceAttr.getName()), |
160 |
sourceAttr.getDataTypeName(), |
161 |
targetAttr.getDataTypeName() |
162 |
); |
163 |
assertEquals( |
164 |
String.format("Field %s geometry type mismatch", sourceAttr.getName()), |
165 |
sourceAttr.getGeomType().getName(), |
166 |
targetAttr.getGeomType().getName() |
167 |
); |
168 |
assertEquals( |
169 |
String.format("Field %s geometry SRS mismatch", sourceAttr.getName()), |
170 |
sourceAttr.getSRS().toString(), |
171 |
targetAttr.getSRS().toString() |
172 |
); |
173 |
assertEquals( |
174 |
String.format("Field %s size mismatch", sourceAttr.getName()), |
175 |
sourceAttr.getSize(), |
176 |
targetAttr.getSize() |
177 |
); |
178 |
assertEquals( |
179 |
String.format("Field %s precision mismatch", sourceAttr.getName()), |
180 |
sourceAttr.getPrecision(), |
181 |
targetAttr.getPrecision() |
182 |
); |
183 |
break;
|
184 |
default:
|
185 |
fail( |
186 |
String.format("Field %s type %d (%s) not supported.", |
187 |
targetAttr.getName(), |
188 |
targetAttr.getType(), |
189 |
targetAttr.getDataTypeName() |
190 |
) |
191 |
); |
192 |
} |
193 |
} |
194 |
} |
195 |
|
196 |
protected void copyFrom(JDBCServerExplorer explorer, FeatureStore sourceStore, int mode) throws Exception { |
197 |
copyFrom(explorer, sourceStore, mode, getTargetName()); |
198 |
} |
199 |
|
200 |
protected void copyFrom(JDBCServerExplorer explorer, FeatureStore sourceStore, int mode, String targetName) throws Exception { |
201 |
FeatureStore targetStore = openTargetStore1(explorer, targetName); |
202 |
switch(mode){
|
203 |
case FeatureStore.MODE_FULLEDIT:
|
204 |
targetStore.edit(mode); |
205 |
try {
|
206 |
for (Feature sourceFeature : sourceStore.getFeatureSet()) {
|
207 |
EditableFeature targetFeature = targetStore.createNewFeature(sourceFeature); |
208 |
targetStore.insert(targetFeature); |
209 |
} |
210 |
} finally {
|
211 |
targetStore.finishEditing(); |
212 |
} |
213 |
break;
|
214 |
default:
|
215 |
DataTransaction trans = DALLocator.getDataManager().createTransaction(); |
216 |
trans.begin(); |
217 |
trans.add(targetStore); |
218 |
targetStore.edit(mode); |
219 |
try {
|
220 |
for (Feature sourceFeature : sourceStore.getFeatureSet()) {
|
221 |
EditableFeature targetFeature = targetStore.createNewFeature(sourceFeature); |
222 |
targetStore.insert(targetFeature); |
223 |
} |
224 |
} finally {
|
225 |
targetStore.finishEditing(); |
226 |
} |
227 |
trans.commit(); |
228 |
trans.close(); |
229 |
break;
|
230 |
} |
231 |
} |
232 |
|
233 |
protected void checkData(JDBCServerExplorer explorer, FeatureStore sourceStore) throws Exception { |
234 |
FeatureStore targetStore = openTargetStore1(explorer); |
235 |
|
236 |
List<Feature> sourceFeatures = sourceStore.getFeatures();
|
237 |
List<Feature> targetFeatures = targetStore.getFeatures();
|
238 |
assertEquals("Count features", sourceFeatures.size(), targetFeatures.size());
|
239 |
for (int i = 0; i < targetFeatures.size(); i++) { |
240 |
Feature sourceFeature = sourceFeatures.get(i); |
241 |
Feature targetFeature = targetFeatures.get(i); |
242 |
for (FeatureAttributeDescriptor sourceAttr : sourceStore.getDefaultFeatureType()) {
|
243 |
switch(sourceAttr.getType()) {
|
244 |
case DataTypes.BYTE:
|
245 |
assertEquals( |
246 |
String.format("Feature %03d attribute %s", i, sourceAttr.getName()), |
247 |
sourceFeature.getInt(sourceAttr.getName()), |
248 |
targetFeature.getInt(sourceAttr.getName()) |
249 |
); |
250 |
break;
|
251 |
case DataTypes.TIMESTAMP:
|
252 |
Date sourceTimestamp = sourceFeature.getDate(sourceAttr.getName());
|
253 |
Date targetTimestamp = targetFeature.getDate(sourceAttr.getName());
|
254 |
assertEquals( |
255 |
String.format("Feature %03d attribute %s", i, sourceAttr.getName()), |
256 |
sourceTimestamp, |
257 |
targetTimestamp |
258 |
); |
259 |
break;
|
260 |
case DataTypes.TIME:
|
261 |
assertEquals( |
262 |
String.format("Feature %03d attribute %s", i, sourceAttr.getName()), |
263 |
sourceFeature.getDate(sourceAttr.getName()), |
264 |
targetFeature.getDate(sourceAttr.getName()) |
265 |
); |
266 |
break;
|
267 |
case DataTypes.GEOMETRY:
|
268 |
assertEquals( |
269 |
String.format("Feature %03d attribute %s", i, sourceAttr.getName()), |
270 |
sourceFeature.get(sourceAttr.getName()), |
271 |
targetFeature.get(sourceAttr.getName()) |
272 |
); |
273 |
break;
|
274 |
case DataTypes.STRING:
|
275 |
case DataTypes.INT:
|
276 |
case DataTypes.LONG:
|
277 |
case DataTypes.FLOAT:
|
278 |
case DataTypes.DOUBLE:
|
279 |
default:
|
280 |
Object sourceValue = sourceFeature.get(sourceAttr.getName());
|
281 |
Object targetValue = targetFeature.get(sourceAttr.getName());
|
282 |
if( sourceValue == null ) { |
283 |
LOGGER.info(String.format("Feature %03d attribute %s is null", i, sourceAttr.getName())); |
284 |
} |
285 |
assertEquals( |
286 |
String.format("Feature %03d attribute %s", i, sourceAttr.getName()), |
287 |
sourceValue, |
288 |
targetValue |
289 |
); |
290 |
} |
291 |
} |
292 |
} |
293 |
} |
294 |
|
295 |
|
296 |
public void testCreatePopulateAndCheckData() throws Exception { |
297 |
// FIXME: probablemente habria que empezar por este test para adaptar
|
298 |
// los test a SQLite
|
299 |
try {
|
300 |
FeatureStore sourceStore = TestUtils.openSourceStore1(); |
301 |
JDBCServerExplorer explorer = TestUtils.openServerExplorer(DBNAME); |
302 |
|
303 |
createFrom(explorer, sourceStore); |
304 |
|
305 |
checkTypes(explorer, sourceStore.getDefaultFeatureType()); |
306 |
copyFrom(explorer, sourceStore, FeatureStore.MODE_APPEND); |
307 |
checkData(explorer, sourceStore); |
308 |
|
309 |
JDBCStoreParameters params = explorer.get(this.getTargetName());
|
310 |
explorer.remove(params); |
311 |
|
312 |
createFrom(explorer, sourceStore); |
313 |
checkTypes(explorer, sourceStore.getDefaultFeatureType()); |
314 |
copyFrom(explorer, sourceStore, FeatureStore.MODE_FULLEDIT); |
315 |
checkData(explorer, sourceStore); |
316 |
} catch(Throwable t) { |
317 |
LOGGER.warn("",t);
|
318 |
throw t;
|
319 |
} |
320 |
} |
321 |
|
322 |
public void testCreatePopulate() throws Exception { |
323 |
// FIXME: probablemente habria que empezar por este test para adaptar
|
324 |
// los test a SQLite. Este test a?ade la tabla countries adem?s de la
|
325 |
// de por defecto para los test
|
326 |
try {
|
327 |
FeatureStore sourceStore = TestUtils.openSourceStore1(); |
328 |
JDBCServerExplorer explorer = TestUtils.openServerExplorer(DBNAME); |
329 |
createFrom(explorer, sourceStore); |
330 |
copyFrom(explorer, sourceStore, FeatureStore.MODE_APPEND); |
331 |
|
332 |
|
333 |
FeatureStore countriesStore = TestUtils.openCountriesStore(); |
334 |
createFrom(explorer, countriesStore, "countries");
|
335 |
copyFrom(explorer, countriesStore, FeatureStore.MODE_APPEND, "countries");
|
336 |
|
337 |
} catch(Throwable t) { |
338 |
LOGGER.warn("",t);
|
339 |
throw t;
|
340 |
} |
341 |
} |
342 |
|
343 |
public void testFilterByDate() throws Exception { |
344 |
try {
|
345 |
FeatureStore sourceStore = TestUtils.openSourceStore1(); |
346 |
JDBCServerExplorer explorer = TestUtils.openServerExplorer(DBNAME); |
347 |
|
348 |
createFrom(explorer, sourceStore); |
349 |
copyFrom(explorer, sourceStore, FeatureStore.MODE_APPEND); |
350 |
|
351 |
FeatureStore dbStore = openTargetStore1(explorer); |
352 |
ExpressionBuilder expbuilder = ExpressionUtils.createExpressionBuilder(); |
353 |
|
354 |
String filter = expbuilder.or(
|
355 |
expbuilder.and( |
356 |
expbuilder.gt( |
357 |
expbuilder.column("Time"),
|
358 |
expbuilder.time("01:02:03")
|
359 |
), |
360 |
expbuilder.lt( |
361 |
expbuilder.column("Time"),
|
362 |
expbuilder.time(new Date()) |
363 |
) |
364 |
), |
365 |
expbuilder.and( |
366 |
expbuilder.gt( |
367 |
expbuilder.column("Date"),
|
368 |
expbuilder.date("2019-02-17")
|
369 |
), |
370 |
expbuilder.lt( |
371 |
expbuilder.column("Date"),
|
372 |
expbuilder.date(new Date()) |
373 |
) |
374 |
) |
375 |
).toString(); |
376 |
FeatureQuery query = sourceStore.createFeatureQuery(); |
377 |
query.addFilter(filter); |
378 |
List<Feature> features = dbStore.getFeatures(query);
|
379 |
int sz = features.size();
|
380 |
if(sz > 0) { |
381 |
features.get(0);
|
382 |
} |
383 |
} catch(Throwable t) { |
384 |
LOGGER.warn("",t);
|
385 |
throw t;
|
386 |
} |
387 |
|
388 |
} |
389 |
|
390 |
public void testComputed1() throws Exception { |
391 |
try {
|
392 |
FeatureStore sourceStore = TestUtils.openSourceStore1(); |
393 |
JDBCServerExplorer explorer = TestUtils.openServerExplorer(DBNAME); |
394 |
|
395 |
createFrom(explorer, sourceStore); |
396 |
copyFrom(explorer, sourceStore, FeatureStore.MODE_APPEND); |
397 |
|
398 |
FeatureStore h2Store = openTargetStore1(explorer); |
399 |
h2Store.edit(); |
400 |
FeatureType featureType = h2Store.getDefaultFeatureType(); |
401 |
EditableFeatureType eFeatureType = featureType.getEditable(); |
402 |
eFeatureType.add("Compu1", DataTypes.INTEGER, new DefaultFeatureAttributeEmulatorExpression(eFeatureType, ExpressionUtils.createExpression("ID*2"))); |
403 |
eFeatureType.add("Compu2", DataTypes.INTEGER, new DefaultFeatureAttributeEmulatorExpression(eFeatureType, ExpressionUtils.createExpression("Long+10+Compu1"))); |
404 |
h2Store.update(eFeatureType); |
405 |
h2Store.finishEditing(); |
406 |
List<Feature> features = h2Store.getFeatures();
|
407 |
for (int i = 0; i < features.size(); i++) { |
408 |
Feature feature = features.get(i); |
409 |
assertEquals("Compu1 "+i, feature.getInt("ID") * 2, feature.getInt("Compu1")); |
410 |
if(feature.get("Long")==null) { |
411 |
assertEquals("Compu2 "+i, null, feature.get("Compu2")); |
412 |
} else {
|
413 |
assertEquals("Compu2 "+i, feature.getInt("Long") + 10 + feature.getInt("Compu1"), feature.getInt("Compu2")); |
414 |
} |
415 |
} |
416 |
DisposeUtils.dispose(h2Store); |
417 |
} catch(Throwable t) { |
418 |
LOGGER.warn("",t);
|
419 |
throw t;
|
420 |
} |
421 |
} |
422 |
|
423 |
public void testComputed2() throws Exception { |
424 |
try {
|
425 |
FeatureStore sourceStore = TestUtils.openSourceStore1(); |
426 |
JDBCServerExplorer explorer = TestUtils.openServerExplorer(DBNAME); |
427 |
|
428 |
createFrom(explorer, sourceStore); |
429 |
copyFrom(explorer, sourceStore, FeatureStore.MODE_APPEND); |
430 |
|
431 |
FeatureStore h2Store = openTargetStore1(explorer); |
432 |
h2Store.edit(); |
433 |
FeatureType featureType = h2Store.getDefaultFeatureType(); |
434 |
EditableFeatureType eFeatureType = featureType.getEditable(); |
435 |
FeatureQuery query = sourceStore.createFeatureQuery(); |
436 |
eFeatureType.add("Compu1", DataTypes.INTEGER, new DefaultFeatureAttributeEmulatorExpression(eFeatureType, ExpressionUtils.createExpression("MOD(ID,10)"))); |
437 |
eFeatureType.add("Compu2", DataTypes.INTEGER, new DefaultFeatureAttributeEmulatorExpression(eFeatureType, ExpressionUtils.createExpression("Long+300"))); |
438 |
EditableFeatureAttributeDescriptor extraColumn1 = query.getExtraColumn().add("Extra1", DataTypes.INTEGER);
|
439 |
EditableFeatureAttributeDescriptor extraColumn2 = query.getExtraColumn().add("Extra2", DataTypes.INTEGER);
|
440 |
// EditableFeatureAttributeDescriptor extraColumn3 = query.getExtraColumn().add("LongMax", DataTypes.INTEGER);
|
441 |
extraColumn1.setFeatureAttributeEmulator(new DefaultFeatureAttributeEmulatorExpression(eFeatureType, ExpressionUtils.createExpression("Compu1+1"))); |
442 |
extraColumn2.setFeatureAttributeEmulator(new DefaultFeatureAttributeEmulatorExpression(eFeatureType, ExpressionUtils.createExpression("20+Byte"))); |
443 |
// extraColumn3.setFeatureAttributeEmulator(new DefaultFeatureAttributeEmulatorExpression(eFeatureType, ExpressionUtils.createExpression("Long")));
|
444 |
query.getGroupByColumns().add("Decimal");
|
445 |
query.getGroupByColumns().add("Extra1");
|
446 |
// query.getGroupByColumns().add("Compu1");
|
447 |
query.getAggregateFunctions().put("ID", "MIN"); |
448 |
query.getAggregateFunctions().put("Byte", "MIN"); |
449 |
// query.getAggregateFunctions().put("Long", "MIN");
|
450 |
// query.getAggregateFunctions().put("LongMax", "MAX");
|
451 |
query.getAggregateFunctions().put("Compu1", "MIN"); |
452 |
query.getAggregateFunctions().put("Double", "SUM"); |
453 |
query.getAggregateFunctions().put("Extra2", "SUM"); |
454 |
query.getAggregateFunctions().put("Compu2", "SUM"); |
455 |
h2Store.update(eFeatureType); |
456 |
h2Store.finishEditing(); |
457 |
|
458 |
|
459 |
List<Feature> features0 = h2Store.getFeatures(query);
|
460 |
ArrayList<Feature> features = new ArrayList<>(); |
461 |
|
462 |
for (int i = 0; i < features0.size(); i++) { |
463 |
Feature feature = features0.get(i); |
464 |
features.add(feature.getCopy()); |
465 |
} |
466 |
features0 = null;
|
467 |
Feature feature = features.get(1);
|
468 |
feature.get("Compu1");
|
469 |
feature.get("Compu2");
|
470 |
assertEquals("Compu2", 3602, feature.getInt("Compu2")); |
471 |
assertEquals("Compu1", 1, feature.getInt("Compu1")); |
472 |
|
473 |
// assertEquals("Long0",null,features.get(0).get("Long"));
|
474 |
// assertEquals("Long1",null,features.get(1).get("Long"));
|
475 |
// assertEquals("Long2",1000L,features.get(2).getLong("Long"));
|
476 |
// assertEquals("Long3",1001L,features.get(3).getLong("Long"));
|
477 |
// assertEquals("Long4",2000L,features.get(4).getLong("Long"));
|
478 |
// assertEquals("Long5",2002L,features.get(5).getLong("Long"));
|
479 |
// assertEquals("Long6",3000L,features.get(6).getLong("Long"));
|
480 |
// assertEquals("Long7",4000L,features.get(7).getLong("Long"));
|
481 |
// assertEquals("Long8",4001L,features.get(8).getLong("Long"));
|
482 |
// assertEquals("Long9",5000L,features.get(9).getLong("Long"));
|
483 |
// assertEquals("Long10",5002L,features.get(10).getLong("Long"));
|
484 |
// assertEquals("Long11",6000L,features.get(11).getLong("Long"));
|
485 |
// assertEquals("Long12",6003L,features.get(12).getLong("Long"));
|
486 |
// assertEquals("Long13",7000L,features.get(13).getLong("Long"));
|
487 |
// assertEquals("Long14",7004L,features.get(14).getLong("Long"));
|
488 |
// assertEquals("Long15",8000L,features.get(15).getLong("Long"));
|
489 |
// assertEquals("Long16",8005L,features.get(16).getLong("Long"));
|
490 |
// assertEquals("Long17",9000L,features.get(17).getLong("Long"));
|
491 |
// assertEquals("Long18",9006L,features.get(18).getLong("Long"));
|
492 |
|
493 |
// for (int i = 0; i < features.size(); i++) {
|
494 |
// Feature feature = features.get(i);
|
495 |
// assertEquals("Long", feature.getInt("ID") * 2, feature.getInt("Compu1"));
|
496 |
// assertEquals("Compu2", feature.getInt("Long") + 10 + feature.getInt("Compu1"), feature.getInt("Compu2"));
|
497 |
// }
|
498 |
DisposeUtils.dispose(h2Store); |
499 |
} catch(Throwable t) { |
500 |
LOGGER.warn("",t);
|
501 |
throw t;
|
502 |
} |
503 |
} |
504 |
|
505 |
|
506 |
|
507 |
} |