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