annotate geo-backend/src/test/java/de/intevation/gnv/geobackend/base/query/QueryExecutorTestCase.java @ 377:6a585e87c18b

Added RegionFilter-Support to HorizontalProfile InstantaneousPoint geo-backend/trunk@377 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Fri, 27 Nov 2009 12:59:04 +0000
parents 9063c5fcebf7
children 31595c0a1a33
rev   line source
132
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1 /**
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
2 *
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
3 */
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
4 package de.intevation.gnv.geobackend.base.query;
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
5
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
6 import java.io.FileInputStream;
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
7 import java.io.InputStream;
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
8 import java.util.Collection;
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
9 import java.util.Iterator;
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
10 import java.util.Properties;
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
11
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
12 import org.apache.log4j.BasicConfigurator;
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
13 import org.apache.log4j.Logger;
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
14
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
15 import de.intevation.gnv.geobackend.base.Result;
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
16 import de.intevation.gnv.geobackend.base.ResultDescriptor;
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
17 import de.intevation.gnv.geobackend.base.connectionpool.ConnectionPoolFactory;
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
18 import de.intevation.gnv.geobackend.base.query.container.QueryContainerFactory;
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
19 import de.intevation.gnv.geobackend.base.query.exception.QueryException;
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
20 import junit.framework.TestCase;
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
21
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
22 /**
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
23 * TestCase for the QueryExecutor interface
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
24 * @author Tim Englich <tim.englich@intevation.de>
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
25 *
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
26 */
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
27 public class QueryExecutorTestCase extends TestCase {
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
28
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
29
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
30 /**
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
31 * the logger, used to log exceptions and additonaly information
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
32 */
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
33 private static Logger log = null;
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
34
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
35 static{
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
36 BasicConfigurator.configure();
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
37 log = Logger.getLogger(QueryExecutorTestCase.class);
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
38 }
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
39
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
40 /**
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
41 * Constructor
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
42 * @param name
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
43 */
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
44 public QueryExecutorTestCase(String name) {
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
45 super(name);
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
46 }
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
47
139
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
48
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
49 public void testSpatialQuery(){
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
50 try {
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
51
264
5bbdbc0bbddc Added SFS-Support to ArcSDE-Query-Part
Tim Englich <tim.englich@intevation.de>
parents: 139
diff changeset
52 this.testQuery(5, "spatial_query", null);
139
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
53 } catch (QueryException e) {
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
54 log.error(e,e);
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
55 fail();
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
56 }
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
57 }
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
58
266
1530890b28c9 Added SFS-Support to ArcSDE-Query-Part without any Spatial restriction in the where clause
Tim Englich <tim.englich@intevation.de>
parents: 264
diff changeset
59 public void testSpatialQueryWithoutIntersects(){
1530890b28c9 Added SFS-Support to ArcSDE-Query-Part without any Spatial restriction in the where clause
Tim Englich <tim.englich@intevation.de>
parents: 264
diff changeset
60 try {
274
ff1b7967e6b9 General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents: 269
diff changeset
61 // this.testQuery(286, "spatial_query_without_intersects", null);
ff1b7967e6b9 General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents: 269
diff changeset
62 this.testQuery(0, "spatial_query_without_intersects2", null);
ff1b7967e6b9 General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents: 269
diff changeset
63 this.testQuery(2060, "spatial_query_without_intersects3", null);
ff1b7967e6b9 General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents: 269
diff changeset
64 this.testQuery(0, "spatial_query_without_intersects4", null);
ff1b7967e6b9 General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents: 269
diff changeset
65 this.testQuery(27031, "spatial_query_without_intersects5", null);
ff1b7967e6b9 General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents: 269
diff changeset
66 this.testQuery(8464, "spatial_query_without_intersects6", null);
266
1530890b28c9 Added SFS-Support to ArcSDE-Query-Part without any Spatial restriction in the where clause
Tim Englich <tim.englich@intevation.de>
parents: 264
diff changeset
67 } catch (QueryException e) {
1530890b28c9 Added SFS-Support to ArcSDE-Query-Part without any Spatial restriction in the where clause
Tim Englich <tim.englich@intevation.de>
parents: 264
diff changeset
68 log.error(e,e);
1530890b28c9 Added SFS-Support to ArcSDE-Query-Part without any Spatial restriction in the where clause
Tim Englich <tim.englich@intevation.de>
parents: 264
diff changeset
69 fail();
1530890b28c9 Added SFS-Support to ArcSDE-Query-Part without any Spatial restriction in the where clause
Tim Englich <tim.englich@intevation.de>
parents: 264
diff changeset
70 }
1530890b28c9 Added SFS-Support to ArcSDE-Query-Part without any Spatial restriction in the where clause
Tim Englich <tim.englich@intevation.de>
parents: 264
diff changeset
71 }
1530890b28c9 Added SFS-Support to ArcSDE-Query-Part without any Spatial restriction in the where clause
Tim Englich <tim.englich@intevation.de>
parents: 264
diff changeset
72
275
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
73 public void testSpatialQueryWithInnerSelect(){
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
74 try {
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
75 this.testQuery(1998, "spatial_query_with_innerselect", null);
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
76 } catch (QueryException e) {
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
77 log.error(e,e);
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
78 fail();
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
79 }
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
80 }
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
81
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
82
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
83 public void testChooseFis(){
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
84 try {
377
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
85 this.testQuery(4, "choose_fis_query", null);
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
86 } catch (QueryException e) {
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
87 log.error(e, e);
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
88 //fail();
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
89 }
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
90 try {
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
91 this.testQuery(33, "choose_fis_query_2", null);
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
92 } catch (QueryException e) {
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
93 log.error(e, e);
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
94 //fail();
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
95 }
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
96 try {
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
97 this.testQuery(4, "choose_fis_query_3", null);
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
98 } catch (QueryException e) {
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
99 log.error(e, e);
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
100 //fail();
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
101 }
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
102 }
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
103
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
104 public void testChooseFisAttributeFirst(){
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
105 try {
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
106 this.testQuery(33, "choose_fis_query", null);
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
107 } catch (QueryException e) {
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
108 log.error(e, e);
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
109 //fail();
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
110 }
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
111 }
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
112
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
113
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
114 public void testAreaFilterInstPoint(){
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
115 try {
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
116 //this.testQuery(2, "test_vehicle_orig", null);
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
117 this.testQuery(4, "test_track_area", null);
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
118 } catch (QueryException e) {
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
119 log.error(e, e);
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
120 //fail();
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
121 }
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
122 }
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
123
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
124 public void testChooseFisSpatialFirst(){
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
125 try {
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
126 this.testQuery(4, "choose_fis_query", null);
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
127 } catch (QueryException e) {
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
128 log.error(e, e);
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
129 //fail();
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
130 }
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
131 }
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
132
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
133 public void testODVQueries(){
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
134 try {
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
135 //this.testQuery(47875, "query_odv_data_timeseriespoint", null);
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
136 //this.testQuery(5, "query_odv_data_vp_timeseriespoint", null);
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
137 //this.testQuery(672, "query_odv_data_mesh", null);
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
138 this.testQuery(8, "query_odv_data_vp_mesh", null);
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
139
275
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
140 } catch (QueryException e) {
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
141 log.error(e, e);
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
142 fail();
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
143 }
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
144 }
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
145
139
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
146
132
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
147 /**
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
148 * Tests if the Databaseconnection can be established and
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
149 * Data could be read from the Database
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
150 */
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
151 public void testQueryExecutor(){
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
152
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
153 try {
133
56655046194f Fix Bug setting the Filtervalues into the Statement.
Tim Englich <tim.englich@intevation.de>
parents: 132
diff changeset
154
139
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
155 this.testQuery(6, "mesh", null);
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
156
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
157 this.testQuery(1, "mesh_id", new String[]{"5"});
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
158
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
159
133
56655046194f Fix Bug setting the Filtervalues into the Statement.
Tim Englich <tim.englich@intevation.de>
parents: 132
diff changeset
160
132
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
161 } catch (QueryException e) {
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
162 log.error(e,e);
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
163 fail();
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
164 }
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
165 }
139
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
166
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
167 public void testTimeSeriesQueries(){
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
168
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
169 try{
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
170 // Test zum initialisieren der umgebung
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
171 this.testQuery(6, "mesh", null);
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
172
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
173
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
174 this.testQuery(11, "timeseries_stations", new String[]{"4"});
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
175 this.testQuery(11, "timeseries_stations_op", new String[]{"4"});
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
176 this.testQuery(1, "timeseries_interval", new String[]{"500042 ", "54"});
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
177
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
178 } catch (QueryException e) {
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
179 log.error(e,e);
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
180 fail();
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
181 }
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
182
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
183 }
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
184
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
185 /**
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
186 * @param resultsize
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
187 * @param queryID
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
188 * @param filter
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
189 * @throws QueryException
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
190 */
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
191 private void testQuery(int resultsize, String queryID, String[] filter)
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
192 throws QueryException {
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
193 long start = System.currentTimeMillis();
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
194 QueryExecutor queryExecutor = QueryExecutorFactory.getInstance().getQueryExecutor();
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
195 Collection<Result> results = queryExecutor.executeQuery(queryID, filter);
274
ff1b7967e6b9 General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents: 269
diff changeset
196 // if (results == null || results.size() == 0){
ff1b7967e6b9 General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents: 269
diff changeset
197 // log.error("Keine Daten erhalten");
ff1b7967e6b9 General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents: 269
diff changeset
198 // fail();
ff1b7967e6b9 General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents: 269
diff changeset
199 // }else {
139
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
200 assertEquals(resultsize, results.size());
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
201 log.debug(resultsize+" Datens�tze erhalten");
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
202 Iterator<Result> it = results.iterator();
275
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
203 while (it.hasNext()){
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
204 Result tmpResult = it.next();
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
205 ResultDescriptor resultDescriptor = tmpResult.getResultDescriptor();
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
206 int columns = resultDescriptor.getColumnCount();
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
207 for (int i = 0; i < columns; i++){
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
208 String columnName = resultDescriptor.getColumnName(i);
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
209 Object value = tmpResult.getString(columnName);
377
6a585e87c18b Added RegionFilter-Support to HorizontalProfile InstantaneousPoint
Tim Englich <tim.englich@intevation.de>
parents: 275
diff changeset
210 if (value != null)
275
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
211 log.debug(columnName + " ==> "+value.toString());
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
212 }
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
213 }
274
ff1b7967e6b9 General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents: 269
diff changeset
214 // }
139
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
215 log.debug("Query dauerte: "+(System.currentTimeMillis()-start) +"ms");
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
216 }
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
217
132
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
218
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
219
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
220 /**
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
221 * @see junit.framework.TestCase#setUp()
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
222 */
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
223 @Override
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
224 protected void setUp() throws Exception {
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
225
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
226 super.setUp();
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
227 InputStream inputStream = new FileInputStream("src/test/ressources/ArcSDEConnectionPoolTestCase.properties");
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
228 Properties properties = new Properties();
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
229 properties.load(inputStream);
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
230
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
231 ConnectionPoolFactory cpf = ConnectionPoolFactory.getInstance();
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
232 cpf.initializeConnectionPool(properties);
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
233
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
234
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
235 inputStream = new FileInputStream("src/test/ressources/QueryExecutorTestCase.properties");
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
236 properties = new Properties();
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
237 properties.load(inputStream);
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
238
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
239 QueryContainerFactory qcf = QueryContainerFactory.getInstance();
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
240 qcf.initializeQueryContainer(properties);
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
241 }
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
242
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
243 }

http://dive4elements.wald.intevation.org