annotate geo-backend/src/test/java/de/intevation/gnv/geobackend/base/query/QueryExecutorTestCase.java @ 886:8b442223741c

Ordered imports. Removed empty headers. geo-backend/trunk@856 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 29 Mar 2010 09:22:07 +0000
parents 1c3efbd2fc5a
children b757def3ff55
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 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
2
886
8b442223741c Ordered imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 885
diff changeset
3 import de.intevation.gnv.geobackend.base.Result;
8b442223741c Ordered imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 885
diff changeset
4 import de.intevation.gnv.geobackend.base.ResultDescriptor;
8b442223741c Ordered imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 885
diff changeset
5
8b442223741c Ordered imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 885
diff changeset
6 import de.intevation.gnv.geobackend.base.connectionpool.ConnectionPoolFactory;
8b442223741c Ordered imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 885
diff changeset
7
8b442223741c Ordered imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 885
diff changeset
8 import de.intevation.gnv.geobackend.base.query.container.QueryContainerFactory;
8b442223741c Ordered imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 885
diff changeset
9
8b442223741c Ordered imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 885
diff changeset
10 import de.intevation.gnv.geobackend.base.query.exception.QueryException;
8b442223741c Ordered imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 885
diff changeset
11
132
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
12 import java.io.FileInputStream;
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
13 import java.io.InputStream;
886
8b442223741c Ordered imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 885
diff changeset
14
132
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
15 import java.util.Collection;
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
16 import java.util.Iterator;
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
17 import java.util.Properties;
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
18
886
8b442223741c Ordered imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 885
diff changeset
19 import junit.framework.TestCase;
8b442223741c Ordered imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 885
diff changeset
20
132
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
21 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
22 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
23
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
24 /**
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
25 * 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
26 * @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
27 *
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 public class QueryExecutorTestCase extends TestCase {
885
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
30
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
31
132
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 * 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
34 */
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
35 private static Logger log = null;
885
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
36
132
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
37 static{
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
38 BasicConfigurator.configure();
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
39 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
40 }
885
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
41
132
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
42 /**
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
43 * Constructor
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
44 * @param name
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
45 */
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
46 public QueryExecutorTestCase(String name) {
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
47 super(name);
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
48 }
885
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
49
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
50
139
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
51 public void testSpatialQuery(){
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
52 try {
885
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
53
264
5bbdbc0bbddc Added SFS-Support to ArcSDE-Query-Part
Tim Englich <tim.englich@intevation.de>
parents: 139
diff changeset
54 this.testQuery(5, "spatial_query", null);
139
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
55 } catch (QueryException e) {
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
56 log.error(e,e);
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
57 fail();
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
58 }
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
59 }
885
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
60
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
61 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
62 try {
274
ff1b7967e6b9 General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents: 269
diff changeset
63 // this.testQuery(286, "spatial_query_without_intersects", null);
ff1b7967e6b9 General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents: 269
diff changeset
64 this.testQuery(0, "spatial_query_without_intersects2", null);
ff1b7967e6b9 General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents: 269
diff changeset
65 this.testQuery(2060, "spatial_query_without_intersects3", null);
ff1b7967e6b9 General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents: 269
diff changeset
66 this.testQuery(0, "spatial_query_without_intersects4", null);
ff1b7967e6b9 General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents: 269
diff changeset
67 this.testQuery(27031, "spatial_query_without_intersects5", null);
ff1b7967e6b9 General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents: 269
diff changeset
68 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
69 } 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
70 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
71 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
72 }
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
73 }
885
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
74
275
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
75 public void testSpatialQueryWithInnerSelect(){
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
76 try {
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
77 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
78 } catch (QueryException e) {
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
79 log.error(e,e);
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
80 fail();
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 }
885
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
83
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
84
275
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
85 public void testChooseFis(){
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
86 try {
379
31595c0a1a33 Revert Changes of the commit of Revision 377 which was unintended
Tim Englich <tim.englich@intevation.de>
parents: 377
diff changeset
87 this.testQuery(1, "choose_fis_query", null);
275
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
88 } catch (QueryException e) {
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
89 log.error(e, e);
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
90 fail();
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
91 }
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
92 }
885
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
93
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
94
132
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
95 /**
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
96 * 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
97 * 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
98 */
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
99 public void testQueryExecutor(){
885
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
100
132
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
101 try {
885
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
102
139
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
103 this.testQuery(6, "mesh", null);
885
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
104
139
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
105 this.testQuery(1, "mesh_id", new String[]{"5"});
885
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
106
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
107
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
108
132
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
109 } catch (QueryException e) {
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
110 log.error(e,e);
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
111 fail();
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
112 }
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
113 }
885
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
114
139
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
115 public void testTimeSeriesQueries(){
885
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
116
139
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
117 try{
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
118 // Test zum initialisieren der umgebung
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
119 this.testQuery(6, "mesh", null);
885
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
120
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
121
139
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
122 this.testQuery(11, "timeseries_stations", new String[]{"4"});
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
123 this.testQuery(11, "timeseries_stations_op", new String[]{"4"});
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
124 this.testQuery(1, "timeseries_interval", new String[]{"500042 ", "54"});
885
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
125
139
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
126 } catch (QueryException e) {
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
127 log.error(e,e);
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
128 fail();
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
129 }
885
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
130
139
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
131 }
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
132
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
133 /**
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
134 * @param resultsize
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
135 * @param queryID
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
136 * @param filter
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
137 * @throws QueryException
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
138 */
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
139 private void testQuery(int resultsize, String queryID, String[] filter)
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
140 throws QueryException {
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
141 long start = System.currentTimeMillis();
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
142 QueryExecutor queryExecutor = QueryExecutorFactory.getInstance().getQueryExecutor();
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
143 Collection<Result> results = queryExecutor.executeQuery(queryID, filter);
274
ff1b7967e6b9 General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents: 269
diff changeset
144 // if (results == null || results.size() == 0){
ff1b7967e6b9 General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents: 269
diff changeset
145 // log.error("Keine Daten erhalten");
ff1b7967e6b9 General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents: 269
diff changeset
146 // fail();
ff1b7967e6b9 General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents: 269
diff changeset
147 // }else {
139
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
148 assertEquals(resultsize, results.size());
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
149 log.debug(resultsize+" Datens�tze erhalten");
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
150 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
151 while (it.hasNext()){
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
152 Result tmpResult = it.next();
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
153 ResultDescriptor resultDescriptor = tmpResult.getResultDescriptor();
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
154 int columns = resultDescriptor.getColumnCount();
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
155 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
156 String columnName = resultDescriptor.getColumnName(i);
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
157 Object value = tmpResult.getString(columnName);
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
158 log.debug(columnName + " ==> "+value.toString());
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
159 }
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
160 }
274
ff1b7967e6b9 General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents: 269
diff changeset
161 // }
139
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
162 log.debug("Query dauerte: "+(System.currentTimeMillis()-start) +"ms");
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
163 }
885
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
164
132
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
165
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
166
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
167 /**
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
168 * @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
169 */
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
170 @Override
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
171 protected void setUp() throws Exception {
885
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
172
132
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
173 super.setUp();
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
174 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
175 Properties properties = new Properties();
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
176 properties.load(inputStream);
885
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
177
132
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
178 ConnectionPoolFactory cpf = ConnectionPoolFactory.getInstance();
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
179 cpf.initializeConnectionPool(properties);
885
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
180
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
181
132
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
182 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
183 properties = new Properties();
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
184 properties.load(inputStream);
885
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
185
132
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
186 QueryContainerFactory qcf = QueryContainerFactory.getInstance();
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
187 qcf.initializeQueryContainer(properties);
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
188 }
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
189
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
190 }

http://dive4elements.wald.intevation.org