annotate geo-backend/src/test/java/de/intevation/gnv/geobackend/base/query/QueryExecutorTestCase.java @ 885:1c3efbd2fc5a

Removes trailing whitespace. geo-backend/trunk@850 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 29 Mar 2010 07:49:16 +0000
parents 31595c0a1a33
children 8b442223741c
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 {
885
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
28
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
29
132
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;
885
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
34
132
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 }
885
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
39
132
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 }
885
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
47
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
48
139
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 {
885
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
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 }
885
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
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 }
885
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
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 }
885
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
81
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
82
275
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 {
379
31595c0a1a33 Revert Changes of the commit of Revision 377 which was unintended
Tim Englich <tim.englich@intevation.de>
parents: 377
diff changeset
85 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
86 } catch (QueryException e) {
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
87 log.error(e, e);
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
88 fail();
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
89 }
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
90 }
885
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
91
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
92
132
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
93 /**
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
94 * 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
95 * 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
96 */
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
97 public void testQueryExecutor(){
885
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
98
132
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
99 try {
885
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
100
139
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
101 this.testQuery(6, "mesh", null);
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(1, "mesh_id", new String[]{"5"});
885
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
104
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
105
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
106
132
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
107 } catch (QueryException e) {
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
108 log.error(e,e);
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
109 fail();
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
110 }
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
111 }
885
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
112
139
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
113 public void testTimeSeriesQueries(){
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 try{
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
116 // Test zum initialisieren der umgebung
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
117 this.testQuery(6, "mesh", null);
885
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
118
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
119
139
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
120 this.testQuery(11, "timeseries_stations", new String[]{"4"});
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
121 this.testQuery(11, "timeseries_stations_op", new String[]{"4"});
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
122 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
123
139
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
124 } catch (QueryException e) {
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
125 log.error(e,e);
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
126 fail();
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
127 }
885
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
128
139
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
129 }
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
130
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 * @param resultsize
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
133 * @param queryID
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
134 * @param filter
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
135 * @throws QueryException
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
136 */
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
137 private void testQuery(int resultsize, String queryID, String[] filter)
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
138 throws QueryException {
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
139 long start = System.currentTimeMillis();
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
140 QueryExecutor queryExecutor = QueryExecutorFactory.getInstance().getQueryExecutor();
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
141 Collection<Result> results = queryExecutor.executeQuery(queryID, filter);
274
ff1b7967e6b9 General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents: 269
diff changeset
142 // if (results == null || results.size() == 0){
ff1b7967e6b9 General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents: 269
diff changeset
143 // log.error("Keine Daten erhalten");
ff1b7967e6b9 General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents: 269
diff changeset
144 // fail();
ff1b7967e6b9 General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents: 269
diff changeset
145 // }else {
139
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
146 assertEquals(resultsize, results.size());
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
147 log.debug(resultsize+" Datens�tze erhalten");
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
148 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
149 while (it.hasNext()){
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
150 Result tmpResult = it.next();
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
151 ResultDescriptor resultDescriptor = tmpResult.getResultDescriptor();
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
152 int columns = resultDescriptor.getColumnCount();
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
153 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
154 String columnName = resultDescriptor.getColumnName(i);
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
155 Object value = tmpResult.getString(columnName);
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
156 log.debug(columnName + " ==> "+value.toString());
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
157 }
9063c5fcebf7 Added the possibility to use Innerselects in SpatialQueries
Tim Englich <tim.englich@intevation.de>
parents: 274
diff changeset
158 }
274
ff1b7967e6b9 General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents: 269
diff changeset
159 // }
139
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
160 log.debug("Query dauerte: "+(System.currentTimeMillis()-start) +"ms");
9f2eaefe9dd4 Some Log Messages Added.
Tim Englich <tim.englich@intevation.de>
parents: 133
diff changeset
161 }
885
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
162
132
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
163
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 /**
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
166 * @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
167 */
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
168 @Override
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
169 protected void setUp() throws Exception {
885
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
170
132
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
171 super.setUp();
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
172 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
173 Properties properties = new Properties();
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
174 properties.load(inputStream);
885
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
175
132
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
176 ConnectionPoolFactory cpf = ConnectionPoolFactory.getInstance();
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
177 cpf.initializeConnectionPool(properties);
885
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
178
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
179
132
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
180 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
181 properties = new Properties();
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
182 properties.load(inputStream);
885
1c3efbd2fc5a Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 379
diff changeset
183
132
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
184 QueryContainerFactory qcf = QueryContainerFactory.getInstance();
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
185 qcf.initializeQueryContainer(properties);
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
186 }
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
187
5a583cff97ea Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
188 }

http://dive4elements.wald.intevation.org