Revision 734
org.gvsig.oracle/tags/org.gvsig.oracle-2.0.118/org.gvsig.oracle.provider/pom.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
|
|
3 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
4 |
|
|
5 |
<modelVersion>4.0.0</modelVersion> |
|
6 |
<artifactId>org.gvsig.oracle.provider</artifactId> |
|
7 |
<packaging>jar</packaging> |
|
8 |
<name>${project.artifactId}</name> |
|
9 |
<description>DAL provider for PostgeSQL files</description> |
|
10 |
<parent> |
|
11 |
<groupId>org.gvsig</groupId> |
|
12 |
<artifactId>org.gvsig.oracle</artifactId> |
|
13 |
<version>2.0.118</version> |
|
14 |
</parent> |
|
15 |
|
|
16 |
<dependencies> |
|
17 |
<dependency> |
|
18 |
<groupId>com.googlecode.log4jdbc</groupId> |
|
19 |
<artifactId>log4jdbc</artifactId> |
|
20 |
<scope>compile</scope> |
|
21 |
</dependency> |
|
22 |
<dependency> |
|
23 |
<groupId>org.gvsig</groupId> |
|
24 |
<artifactId>org.gvsig.tools.lib</artifactId> |
|
25 |
<scope>compile</scope> |
|
26 |
</dependency> |
|
27 |
<dependency> |
|
28 |
<groupId>org.gvsig</groupId> |
|
29 |
<artifactId>org.gvsig.projection.api</artifactId> |
|
30 |
<scope>compile</scope> |
|
31 |
</dependency> |
|
32 |
<dependency> |
|
33 |
<groupId>org.gvsig</groupId> |
|
34 |
<artifactId>org.gvsig.fmap.dal.api</artifactId> |
|
35 |
<scope>compile</scope> |
|
36 |
</dependency> |
|
37 |
|
|
38 |
<dependency> |
|
39 |
<groupId>org.gvsig</groupId> |
|
40 |
<artifactId>org.gvsig.fmap.dal.db.jdbc</artifactId> |
|
41 |
<scope>compile</scope> |
|
42 |
</dependency> |
|
43 |
<dependency> |
|
44 |
<groupId>org.gvsig</groupId> |
|
45 |
<artifactId>org.gvsig.fmap.dal.db.jdbc</artifactId> |
|
46 |
<scope>test</scope> |
|
47 |
<type>test-jar</type> |
|
48 |
</dependency> |
|
49 |
|
|
50 |
<dependency> |
|
51 |
<groupId>org.gvsig</groupId> |
|
52 |
<artifactId>org.gvsig.fmap.dal.db.lib</artifactId> |
|
53 |
<scope>compile</scope> |
|
54 |
</dependency> |
|
55 |
|
|
56 |
<dependency> |
|
57 |
<groupId>org.gvsig</groupId> |
|
58 |
<artifactId>org.gvsig.fmap.dal.spi</artifactId> |
|
59 |
<scope>compile</scope> |
|
60 |
</dependency> |
|
61 |
<dependency> |
|
62 |
<groupId>org.gvsig</groupId> |
|
63 |
<artifactId>org.gvsig.metadata.lib.basic.api</artifactId> |
|
64 |
<scope>compile</scope> |
|
65 |
</dependency> |
|
66 |
<dependency> |
|
67 |
<groupId>org.gvsig</groupId> |
|
68 |
<artifactId>org.gvsig.fmap.geometry.api</artifactId> |
|
69 |
<scope>compile</scope> |
|
70 |
</dependency> |
|
71 |
<dependency> |
|
72 |
<groupId>org.gvsig</groupId> |
|
73 |
<artifactId>org.gvsig.expressionevaluator.lib.api</artifactId> |
|
74 |
<scope>compile</scope> |
|
75 |
</dependency> |
|
76 |
<dependency> |
|
77 |
<groupId>org.gvsig</groupId> |
|
78 |
<artifactId>org.gvsig.expressionevaluator.geometry.lib.api</artifactId> |
|
79 |
<scope>compile</scope> |
|
80 |
</dependency> |
|
81 |
<dependency> |
|
82 |
<groupId>org.gvsig</groupId> |
|
83 |
<artifactId>org.gvsig.timesupport.lib.api</artifactId> |
|
84 |
<scope>compile</scope> |
|
85 |
</dependency> |
|
86 |
<dependency> |
|
87 |
<groupId>org.gvsig</groupId> |
|
88 |
<artifactId>org.gvsig.utils</artifactId> |
|
89 |
<scope>compile</scope> |
|
90 |
</dependency> |
|
91 |
|
|
92 |
<dependency> |
|
93 |
<groupId>com.oracle</groupId> |
|
94 |
<artifactId>ojdbc</artifactId> |
|
95 |
<scope>compile</scope> |
|
96 |
</dependency> |
|
97 |
|
|
98 |
<dependency> |
|
99 |
<groupId>commons-dbcp</groupId> |
|
100 |
<artifactId>commons-dbcp</artifactId> |
|
101 |
<scope>compile</scope> |
|
102 |
</dependency> |
|
103 |
<dependency> |
|
104 |
<groupId>commons-collections</groupId> |
|
105 |
<artifactId>commons-collections</artifactId> |
|
106 |
<scope>compile</scope> |
|
107 |
</dependency> |
|
108 |
|
|
109 |
|
|
110 |
<!-- TESTS --> |
|
111 |
<dependency> |
|
112 |
<groupId>org.gvsig</groupId> |
|
113 |
<artifactId>org.gvsig.fmap.dal.impl</artifactId> |
|
114 |
<scope>test</scope> |
|
115 |
</dependency> |
|
116 |
<dependency> |
|
117 |
<groupId>org.gvsig</groupId> |
|
118 |
<artifactId>${org.gvsig.fmap.geometry.impl}</artifactId> |
|
119 |
<scope>test</scope> |
|
120 |
</dependency> |
|
121 |
<dependency> |
|
122 |
<groupId>org.gvsig</groupId> |
|
123 |
<artifactId>org.gvsig.tools.lib</artifactId> |
|
124 |
<type>test-jar</type> |
|
125 |
<scope>test</scope> |
|
126 |
</dependency> |
|
127 |
<dependency> |
|
128 |
<groupId>org.gvsig</groupId> |
|
129 |
<artifactId>org.gvsig.compat.se</artifactId> |
|
130 |
<scope>test</scope> |
|
131 |
</dependency> |
|
132 |
<dependency> |
|
133 |
<groupId>org.gvsig</groupId> |
|
134 |
<artifactId>org.gvsig.expressionevaluator.lib.impl</artifactId> |
|
135 |
<scope>test</scope> |
|
136 |
</dependency> |
|
137 |
<dependency> |
|
138 |
<groupId>org.gvsig</groupId> |
|
139 |
<artifactId>org.gvsig.expressionevaluator.geometry.lib.impl</artifactId> |
|
140 |
<scope>test</scope> |
|
141 |
</dependency> |
|
142 |
<dependency> |
|
143 |
<groupId>org.gvsig</groupId> |
|
144 |
<artifactId>${org.gvsig.proj.lib.impl}</artifactId> |
|
145 |
<scope>test</scope> |
|
146 |
</dependency> |
|
147 |
|
|
148 |
<!-- <dependency> |
|
149 |
<groupId>org.gvsig</groupId> |
|
150 |
<artifactId>org.gvsig.projection.cresques.impl</artifactId> |
|
151 |
<scope>test</scope> |
|
152 |
</dependency>--> |
|
153 |
<!-- <dependency> |
|
154 |
<groupId>org.gvsig</groupId> |
|
155 |
<artifactId>org.gvsig.compat.se</artifactId> |
|
156 |
<scope>test</scope> |
|
157 |
</dependency>--> |
|
158 |
<dependency> |
|
159 |
<groupId>org.gvsig</groupId> |
|
160 |
<artifactId>org.gvsig.metadata.lib.basic.impl</artifactId> |
|
161 |
<scope>test</scope> |
|
162 |
</dependency> |
|
163 |
<dependency> |
|
164 |
<groupId>org.gvsig</groupId> |
|
165 |
<artifactId>org.gvsig.timesupport.lib.impl</artifactId> |
|
166 |
<scope>test</scope> |
|
167 |
</dependency> |
|
168 |
|
|
169 |
<dependency> |
|
170 |
<groupId>org.gvsig</groupId> |
|
171 |
<artifactId>org.gvsig.fmap.dal.file.csv</artifactId> |
|
172 |
<scope>test</scope> |
|
173 |
</dependency> |
|
174 |
<dependency> |
|
175 |
<groupId>org.gvsig</groupId> |
|
176 |
<artifactId>org.gvsig.fmap.dal.file.lib</artifactId> |
|
177 |
<scope>test</scope> |
|
178 |
</dependency> |
|
179 |
<dependency> |
|
180 |
<groupId>org.gvsig</groupId> |
|
181 |
<artifactId>org.gvsig.tools.util.impl</artifactId> |
|
182 |
<scope>test</scope> |
|
183 |
</dependency> |
|
184 |
|
|
185 |
</dependencies> |
|
186 |
|
|
187 |
<build> |
|
188 |
<plugins> |
|
189 |
|
|
190 |
<plugin> |
|
191 |
<groupId>org.apache.maven.plugins</groupId> |
|
192 |
<artifactId>maven-surefire-plugin</artifactId> |
|
193 |
<configuration> |
|
194 |
<!-- Skip test execution ? --> |
|
195 |
<skipTests>false</skipTests> |
|
196 |
<!-- Ignore test execution failure ? --> |
|
197 |
<testFailureIgnore>false</testFailureIgnore> |
|
198 |
<excludes> |
|
199 |
<exclude>**/TestCreate.java</exclude> |
|
200 |
</excludes> |
|
201 |
</configuration> |
|
202 |
</plugin> |
|
203 |
|
|
204 |
<!-- Skip test compilation ? --> |
|
205 |
<plugin> |
|
206 |
<groupId>org.apache.maven.plugins</groupId> |
|
207 |
<artifactId>maven-compiler-plugin</artifactId> |
|
208 |
<executions> |
|
209 |
<execution> |
|
210 |
<id>default-testCompile</id> |
|
211 |
<phase>process-test-sources</phase> |
|
212 |
<goals> |
|
213 |
<goal>testCompile</goal> |
|
214 |
</goals> |
|
215 |
<configuration> |
|
216 |
<skip>false</skip> |
|
217 |
</configuration> |
|
218 |
</execution> |
|
219 |
</executions> |
|
220 |
</plugin> |
|
221 |
|
|
222 |
</plugins> |
|
223 |
</build> |
|
224 |
|
|
225 |
</project> |
org.gvsig.oracle/tags/org.gvsig.oracle-2.0.118/org.gvsig.oracle.provider/src/test/java/org/gvsig/oracle/dal/TestCreate.java | ||
---|---|---|
1 |
package org.gvsig.oracle.dal; |
|
2 |
|
|
3 |
import java.util.Date; |
|
4 |
import java.util.List; |
|
5 |
import junit.framework.TestCase; |
|
6 |
import static junit.framework.TestCase.assertEquals; |
|
7 |
import org.gvsig.fmap.dal.DALLocator; |
|
8 |
import org.gvsig.fmap.dal.DataManager; |
|
9 |
import org.gvsig.fmap.dal.DataTypes; |
|
10 |
import org.gvsig.fmap.dal.exception.ValidateDataParametersException; |
|
11 |
import org.gvsig.fmap.dal.feature.EditableFeature; |
|
12 |
import org.gvsig.fmap.dal.feature.EditableFeatureType; |
|
13 |
import org.gvsig.fmap.dal.feature.Feature; |
|
14 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
|
15 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
16 |
import org.gvsig.fmap.dal.feature.FeatureType; |
|
17 |
import org.gvsig.fmap.dal.feature.NewFeatureStoreParameters; |
|
18 |
import org.gvsig.fmap.dal.store.jdbc.JDBCStoreParameters; |
|
19 |
import org.gvsig.fmap.dal.store.jdbc2.JDBCServerExplorer; |
|
20 |
import org.gvsig.fmap.geom.Geometry; |
|
21 |
import org.gvsig.tools.library.impl.DefaultLibrariesInitializer; |
|
22 |
import org.slf4j.Logger; |
|
23 |
import org.slf4j.LoggerFactory; |
|
24 |
|
|
25 |
public class TestCreate extends TestCase { |
|
26 |
|
|
27 |
private static final Logger LOGGER = LoggerFactory.getLogger(TestCreate.class); |
|
28 |
|
|
29 |
public static final String DBNAME = "testCreate"; |
|
30 |
|
|
31 |
public static final int ZERO_DEFAULT_DISPLAY_SIZE = 0; |
|
32 |
public static final int BYTE_DEFAULT_DISPLAY_SIZE = 4; |
|
33 |
public static final int FLOAT_DEFAULT_DISPLAY_SIZE = 4; |
|
34 |
public static final int DOUBLE_DEFAULT_DISPLAY_SIZE = 8; |
|
35 |
|
|
36 |
public TestCreate(String testName) { |
|
37 |
super(testName); |
|
38 |
} |
|
39 |
|
|
40 |
@Override |
|
41 |
protected void setUp() throws Exception { |
|
42 |
super.setUp(); |
|
43 |
new DefaultLibrariesInitializer().fullInitialize(); |
|
44 |
} |
|
45 |
|
|
46 |
@Override |
|
47 |
protected void tearDown() throws Exception { |
|
48 |
super.tearDown(); |
|
49 |
} |
|
50 |
|
|
51 |
// TODO add test methods here. The name must begin with 'test'. For example: |
|
52 |
// public void testHello() {} |
|
53 |
protected String getProviderName() { |
|
54 |
return OracleLibrary.NAME; |
|
55 |
} |
|
56 |
|
|
57 |
protected String getTargetName() { |
|
58 |
return "testCreateTarget6".toUpperCase(); |
|
59 |
} |
|
60 |
|
|
61 |
protected FeatureStore openTargetStore1(JDBCServerExplorer explorer) throws Exception { |
|
62 |
JDBCStoreParameters params = explorer.get(getTargetName()); |
|
63 |
|
|
64 |
DataManager dataManager = DALLocator.getDataManager(); |
|
65 |
FeatureStore store; |
|
66 |
try { |
|
67 |
store = (FeatureStore) dataManager.openStore( |
|
68 |
getProviderName(), |
|
69 |
params |
|
70 |
); |
|
71 |
} catch (ValidateDataParametersException ex) { |
|
72 |
LOGGER.warn(ex.getLocalizedMessageStack()); |
|
73 |
throw ex; |
|
74 |
} |
|
75 |
return store; |
|
76 |
} |
|
77 |
|
|
78 |
protected void createFrom(JDBCServerExplorer explorer, FeatureStore sourceStore) throws Exception { |
|
79 |
NewFeatureStoreParameters params = (NewFeatureStoreParameters) explorer.getAddParameters( |
|
80 |
getTargetName() |
|
81 |
); |
|
82 |
EditableFeatureType ft = params.getDefaultFeatureType(); |
|
83 |
ft.addAll(sourceStore.getDefaultFeatureType()); |
|
84 |
explorer.add(getProviderName(), params, true); |
|
85 |
} |
|
86 |
|
|
87 |
protected void checkTypes(JDBCServerExplorer explorer, FeatureType sourceFeatureType, boolean withDalResource) throws Exception { |
|
88 |
FeatureStore targetStore = openTargetStore1(explorer); |
|
89 |
FeatureType targetFeatureType = targetStore.getDefaultFeatureType(); |
|
90 |
|
|
91 |
assertEquals("Feature type size", sourceFeatureType.size(), targetFeatureType.size()); |
|
92 |
for (int i = 0; i < sourceFeatureType.size(); i++) { |
|
93 |
FeatureAttributeDescriptor sourceAttr = sourceFeatureType.get(i); |
|
94 |
FeatureAttributeDescriptor targetAttr = targetFeatureType.get(i); |
|
95 |
if (withDalResource) { |
|
96 |
if (sourceAttr.getType() == DataTypes.GEOMETRY) { |
|
97 |
assertEquals( |
|
98 |
String.format("Field %s name mismatch", sourceAttr.getName()), |
|
99 |
sourceAttr.getName().toUpperCase(), |
|
100 |
targetAttr.getName() |
|
101 |
); |
|
102 |
} else { |
|
103 |
assertEquals( |
|
104 |
String.format("Field %s name mismatch", sourceAttr.getName()), |
|
105 |
sourceAttr.getName(), |
|
106 |
targetAttr.getName() |
|
107 |
); |
|
108 |
} |
|
109 |
|
|
110 |
assertEquals( |
|
111 |
String.format("Field %s type mismatch", sourceAttr.getName()), |
|
112 |
sourceAttr.getDataTypeName(), |
|
113 |
targetAttr.getDataTypeName() |
|
114 |
); |
|
115 |
assertEquals( |
|
116 |
String.format("Field %s display size mismatch", sourceAttr.getName()), |
|
117 |
sourceAttr.getDisplaySize(), |
|
118 |
targetAttr.getDisplaySize() |
|
119 |
); |
|
120 |
assertEquals( |
|
121 |
String.format("Field %s size mismatch", sourceAttr.getName()), |
|
122 |
sourceAttr.getSize(), |
|
123 |
targetAttr.getSize() |
|
124 |
); |
|
125 |
assertEquals( |
|
126 |
String.format("Field %s precision mismatch", sourceAttr.getName()), |
|
127 |
sourceAttr.getPrecision(), |
|
128 |
targetAttr.getPrecision() |
|
129 |
); |
|
130 |
assertEquals( |
|
131 |
String.format("Field %s scale mismatch", sourceAttr.getName()), |
|
132 |
sourceAttr.getScale(), |
|
133 |
targetAttr.getScale() |
|
134 |
); |
|
135 |
|
|
136 |
if (sourceAttr.getType() == DataTypes.GEOMETRY) { |
|
137 |
assertEquals( |
|
138 |
String.format("Field %s geometry type mismatch", sourceAttr.getName()), |
|
139 |
sourceAttr.getGeomType().getName(), |
|
140 |
targetAttr.getGeomType().getName() |
|
141 |
); |
|
142 |
assertEquals( |
|
143 |
String.format("Field %s geometry SRS mismatch", sourceAttr.getName()), |
|
144 |
sourceAttr.getSRS().getAbrev(), |
|
145 |
targetAttr.getSRS().getAbrev() |
|
146 |
); |
|
147 |
|
|
148 |
} |
|
149 |
|
|
150 |
} else { |
|
151 |
switch (sourceAttr.getType()) { |
|
152 |
case DataTypes.BYTE: |
|
153 |
assertEquals( |
|
154 |
String.format("Field %s name mismatch", sourceAttr.getName()), |
|
155 |
sourceAttr.getName(), |
|
156 |
targetAttr.getName() |
|
157 |
); |
|
158 |
assertEquals( |
|
159 |
String.format("Field %s type mismatch", sourceAttr.getName()), |
|
160 |
DataTypes.DECIMAL, |
|
161 |
targetAttr.getDataType().getType() |
|
162 |
); |
|
163 |
assertEquals( |
|
164 |
String.format("Field %s display size mismatch", sourceAttr.getName()), |
|
165 |
BYTE_DEFAULT_DISPLAY_SIZE, |
|
166 |
targetAttr.getDisplaySize() |
|
167 |
); |
|
168 |
assertEquals( |
|
169 |
String.format("Field %s size mismatch", sourceAttr.getName()), |
|
170 |
sourceAttr.getSize(), |
|
171 |
targetAttr.getSize() |
|
172 |
); |
|
173 |
assertEquals( |
|
174 |
String.format("Field %s precision mismatch", sourceAttr.getName()), |
|
175 |
sourceAttr.getPrecision(), |
|
176 |
targetAttr.getPrecision() |
|
177 |
); |
|
178 |
assertEquals( |
|
179 |
String.format("Field %s scale mismatch", sourceAttr.getName()), |
|
180 |
sourceAttr.getScale(), |
|
181 |
targetAttr.getScale() |
|
182 |
); |
|
183 |
break; |
|
184 |
case DataTypes.BOOLEAN: |
|
185 |
assertEquals( |
|
186 |
String.format("Field %s name mismatch", sourceAttr.getName()), |
|
187 |
sourceAttr.getName(), |
|
188 |
targetAttr.getName() |
|
189 |
); |
|
190 |
assertEquals( |
|
191 |
String.format("Field %s type mismatch", sourceAttr.getName()), |
|
192 |
DataTypes.STRING_NAME, |
|
193 |
targetAttr.getDataTypeName() |
|
194 |
); |
|
195 |
assertEquals(String.format("Field %s display size mismatch", sourceAttr.getName()), |
|
196 |
ZERO_DEFAULT_DISPLAY_SIZE, |
|
197 |
targetAttr.getDisplaySize() |
|
198 |
); |
|
199 |
assertEquals(String.format("Field %s size mismatch", sourceAttr.getName()), |
|
200 |
OracleSQLBuilder.BOOLEAN_STRING_DEFAULT_LENGTH, |
|
201 |
targetAttr.getSize() |
|
202 |
); |
|
203 |
assertEquals( |
|
204 |
String.format("Field %s precision mismatch", sourceAttr.getName()), |
|
205 |
sourceAttr.getPrecision(), |
|
206 |
targetAttr.getPrecision() |
|
207 |
); |
|
208 |
assertEquals( |
|
209 |
String.format("Field %s scale mismatch", sourceAttr.getName()), |
|
210 |
sourceAttr.getScale(), |
|
211 |
targetAttr.getScale() |
|
212 |
); |
|
213 |
break; |
|
214 |
case DataTypes.STRING: |
|
215 |
assertEquals( |
|
216 |
String.format("Field %s name mismatch", sourceAttr.getName()), |
|
217 |
sourceAttr.getName(), |
|
218 |
targetAttr.getName() |
|
219 |
); |
|
220 |
assertEquals( |
|
221 |
String.format("Field %s type mismatch", sourceAttr.getName()), |
|
222 |
sourceAttr.getDataTypeName(), |
|
223 |
targetAttr.getDataTypeName() |
|
224 |
); |
|
225 |
assertEquals(String.format("Field %s display size mismatch", sourceAttr.getName()), |
|
226 |
ZERO_DEFAULT_DISPLAY_SIZE, |
|
227 |
targetAttr.getDisplaySize() |
|
228 |
); |
|
229 |
assertEquals( |
|
230 |
String.format("Field %s size mismatch", sourceAttr.getName()), |
|
231 |
sourceAttr.getSize(), |
|
232 |
targetAttr.getSize() |
|
233 |
); |
|
234 |
assertEquals( |
|
235 |
String.format("Field %s precision mismatch", sourceAttr.getName()), |
|
236 |
sourceAttr.getPrecision(), |
|
237 |
targetAttr.getPrecision() |
|
238 |
); |
|
239 |
assertEquals( |
|
240 |
String.format("Field %s scale mismatch", sourceAttr.getName()), |
|
241 |
sourceAttr.getScale(), |
|
242 |
targetAttr.getScale() |
|
243 |
); |
|
244 |
break; |
|
245 |
case DataTypes.TIME: |
|
246 |
case DataTypes.DATE: |
|
247 |
assertEquals( |
|
248 |
String.format("Field %s name mismatch", sourceAttr.getName()), |
|
249 |
sourceAttr.getName(), |
|
250 |
targetAttr.getName() |
|
251 |
); |
|
252 |
assertEquals( |
|
253 |
String.format("Field %s type mismatch", sourceAttr.getName()), |
|
254 |
DataTypes.TIMESTAMP_NAME, |
|
255 |
targetAttr.getDataTypeName() |
|
256 |
); |
|
257 |
assertEquals(String.format("Field %s display size mismatch", sourceAttr.getName()), |
|
258 |
ZERO_DEFAULT_DISPLAY_SIZE, |
|
259 |
targetAttr.getDisplaySize() |
|
260 |
); |
|
261 |
assertEquals( |
|
262 |
String.format("Field %s size mismatch", sourceAttr.getName()), |
|
263 |
sourceAttr.getSize(), |
|
264 |
targetAttr.getSize() |
|
265 |
); |
|
266 |
assertEquals( |
|
267 |
String.format("Field %s precision mismatch", sourceAttr.getName()), |
|
268 |
sourceAttr.getPrecision(), |
|
269 |
targetAttr.getPrecision() |
|
270 |
); |
|
271 |
assertEquals( |
|
272 |
String.format("Field %s scale mismatch", sourceAttr.getName()), |
|
273 |
sourceAttr.getScale(), |
|
274 |
targetAttr.getScale() |
|
275 |
); |
|
276 |
break; |
|
277 |
|
|
278 |
case DataTypes.DOUBLE: |
|
279 |
assertEquals( |
|
280 |
String.format("Field %s name mismatch", sourceAttr.getName()), |
|
281 |
sourceAttr.getName(), |
|
282 |
targetAttr.getName() |
|
283 |
); |
|
284 |
assertEquals( |
|
285 |
String.format("Field %s type mismatch", sourceAttr.getName()), |
|
286 |
sourceAttr.getDataTypeName(), |
|
287 |
targetAttr.getDataTypeName() |
|
288 |
); |
|
289 |
assertEquals( |
|
290 |
String.format("Field %s display size mismatch", sourceAttr.getName()), |
|
291 |
DOUBLE_DEFAULT_DISPLAY_SIZE, |
|
292 |
targetAttr.getDisplaySize() |
|
293 |
); |
|
294 |
assertEquals( |
|
295 |
String.format("Field %s size mismatch", sourceAttr.getName()), |
|
296 |
sourceAttr.getSize(), |
|
297 |
targetAttr.getSize() |
|
298 |
); |
|
299 |
assertEquals( |
|
300 |
String.format("Field %s precision mismatch", sourceAttr.getName()), |
|
301 |
sourceAttr.getPrecision(), |
|
302 |
targetAttr.getPrecision() |
|
303 |
); |
|
304 |
assertEquals( |
|
305 |
String.format("Field %s scale mismatch", sourceAttr.getName()), |
|
306 |
sourceAttr.getScale(), |
|
307 |
targetAttr.getScale() |
|
308 |
); |
|
309 |
break; |
|
310 |
case DataTypes.FLOAT: |
|
311 |
assertEquals( |
|
312 |
String.format("Field %s name mismatch", sourceAttr.getName()), |
|
313 |
sourceAttr.getName(), |
|
314 |
targetAttr.getName() |
|
315 |
); |
|
316 |
assertEquals( |
|
317 |
String.format("Field %s type mismatch", sourceAttr.getName()), |
|
318 |
sourceAttr.getDataTypeName(), |
|
319 |
targetAttr.getDataTypeName() |
|
320 |
); |
|
321 |
assertEquals( |
|
322 |
String.format("Field %s display size mismatch", sourceAttr.getName()), |
|
323 |
FLOAT_DEFAULT_DISPLAY_SIZE, |
|
324 |
targetAttr.getDisplaySize() |
|
325 |
); |
|
326 |
assertEquals( |
|
327 |
String.format("Field %s size mismatch", sourceAttr.getName()), |
|
328 |
sourceAttr.getSize(), |
|
329 |
targetAttr.getSize() |
|
330 |
); |
|
331 |
assertEquals( |
|
332 |
String.format("Field %s precision mismatch", sourceAttr.getName()), |
|
333 |
sourceAttr.getPrecision(), |
|
334 |
targetAttr.getPrecision() |
|
335 |
); |
|
336 |
assertEquals( |
|
337 |
String.format("Field %s scale mismatch", sourceAttr.getName()), |
|
338 |
sourceAttr.getScale(), |
|
339 |
targetAttr.getScale() |
|
340 |
); |
|
341 |
break; |
|
342 |
|
|
343 |
case DataTypes.INT: |
|
344 |
case DataTypes.LONG: |
|
345 |
case DataTypes.TIMESTAMP: |
|
346 |
assertEquals( |
|
347 |
String.format("Field %s name mismatch", sourceAttr.getName()), |
|
348 |
sourceAttr.getName(), |
|
349 |
targetAttr.getName() |
|
350 |
); |
|
351 |
assertEquals( |
|
352 |
String.format("Field %s type mismatch", sourceAttr.getName()), |
|
353 |
sourceAttr.getDataType().getType(), |
|
354 |
targetAttr.getDataType().getType() |
|
355 |
); |
|
356 |
assertEquals(String.format("Field %s display size mismatch", sourceAttr.getName()), |
|
357 |
ZERO_DEFAULT_DISPLAY_SIZE, |
|
358 |
targetAttr.getDisplaySize() |
|
359 |
); |
|
360 |
assertEquals( |
|
361 |
String.format("Field %s size mismatch", sourceAttr.getName()), |
|
362 |
sourceAttr.getSize(), |
|
363 |
targetAttr.getSize() |
|
364 |
); |
|
365 |
assertEquals( |
|
366 |
String.format("Field %s precision mismatch", sourceAttr.getName()), |
|
367 |
sourceAttr.getPrecision(), |
|
368 |
targetAttr.getPrecision() |
|
369 |
); |
|
370 |
assertEquals( |
|
371 |
String.format("Field %s scale mismatch", sourceAttr.getName()), |
|
372 |
sourceAttr.getScale(), |
|
373 |
targetAttr.getScale() |
|
374 |
); |
|
375 |
break; |
|
376 |
|
|
377 |
case DataTypes.DECIMAL: |
|
378 |
assertEquals( |
|
379 |
String.format("Field %s name mismatch", sourceAttr.getName()), |
|
380 |
sourceAttr.getName(), |
|
381 |
targetAttr.getName() |
|
382 |
); |
|
383 |
assertEquals( |
|
384 |
String.format("Field %s type mismatch", sourceAttr.getName()), |
|
385 |
sourceAttr.getDataTypeName(), |
|
386 |
targetAttr.getDataTypeName() |
|
387 |
); |
|
388 |
assertEquals( |
|
389 |
String.format("Field %s display size mismatch", sourceAttr.getName()), |
|
390 |
sourceAttr.getPrecision() + 2, //Precision plus sign and decimal separator |
|
391 |
targetAttr.getDisplaySize() |
|
392 |
); |
|
393 |
assertEquals( |
|
394 |
String.format("Field %s size mismatch", sourceAttr.getName()), |
|
395 |
sourceAttr.getSize(), |
|
396 |
targetAttr.getSize() |
|
397 |
); |
|
398 |
assertEquals( |
|
399 |
String.format("Field %s precision mismatch", sourceAttr.getName()), |
|
400 |
sourceAttr.getPrecision(), |
|
401 |
targetAttr.getPrecision() |
|
402 |
); |
|
403 |
assertEquals( |
|
404 |
String.format("Field %s scale mismatch", sourceAttr.getName()), |
|
405 |
sourceAttr.getScale(), |
|
406 |
targetAttr.getScale() |
|
407 |
); |
|
408 |
break; |
|
409 |
case DataTypes.GEOMETRY: |
|
410 |
assertEquals( |
|
411 |
String.format("Field %s name mismatch", sourceAttr.getName()), |
|
412 |
sourceAttr.getName().toUpperCase(), |
|
413 |
targetAttr.getName() |
|
414 |
); |
|
415 |
assertEquals( |
|
416 |
String.format("Field %s type mismatch", sourceAttr.getName()), |
|
417 |
sourceAttr.getDataTypeName(), |
|
418 |
targetAttr.getDataTypeName() |
|
419 |
); |
|
420 |
assertEquals( |
|
421 |
String.format("Field %s geometry type mismatch", sourceAttr.getName()), |
|
422 |
sourceAttr.getGeomType().getName(), |
|
423 |
targetAttr.getGeomType().getName() |
|
424 |
); |
|
425 |
assertEquals( |
|
426 |
String.format("Field %s geometry SRS mismatch", sourceAttr.getName()), |
|
427 |
sourceAttr.getSRS().getAbrev(), |
|
428 |
targetAttr.getSRS().getAbrev() |
|
429 |
); |
|
430 |
assertEquals( |
|
431 |
String.format("Field %s size mismatch", sourceAttr.getName()), |
|
432 |
sourceAttr.getSize(), |
|
433 |
targetAttr.getSize() |
|
434 |
); |
|
435 |
assertEquals( |
|
436 |
String.format("Field %s precision mismatch", sourceAttr.getName()), |
|
437 |
sourceAttr.getPrecision(), |
|
438 |
targetAttr.getPrecision() |
|
439 |
); |
|
440 |
break; |
|
441 |
default: |
|
442 |
fail( |
|
443 |
String.format("Field %s type %d (%s) not supported.", |
|
444 |
targetAttr.getName(), |
|
445 |
targetAttr.getType(), |
|
446 |
targetAttr.getDataTypeName() |
|
447 |
) |
|
448 |
); |
|
449 |
} |
|
450 |
} |
|
451 |
} |
|
452 |
} |
|
453 |
|
|
454 |
protected void copyFrom(JDBCServerExplorer explorer, FeatureStore sourceStore, int mode) throws Exception { |
|
455 |
FeatureStore targetStore = openTargetStore1(explorer); |
|
456 |
targetStore.edit(mode); |
|
457 |
try { |
|
458 |
for (Feature sourceFeature : sourceStore.getFeatureSet()) { |
|
459 |
EditableFeature targetFeature = targetStore.createNewFeature(sourceFeature); |
|
460 |
targetStore.insert(targetFeature); |
|
461 |
} |
|
462 |
} finally { |
|
463 |
targetStore.finishEditing(); |
|
464 |
} |
|
465 |
} |
|
466 |
|
|
467 |
protected void checkData(JDBCServerExplorer explorer, FeatureStore sourceStore, boolean withDalResource) throws Exception { |
|
468 |
FeatureStore targetStore = openTargetStore1(explorer); |
|
469 |
|
|
470 |
List<Feature> sourceFeatures = sourceStore.getFeatures(); |
|
471 |
List<Feature> targetFeatures = targetStore.getFeatures(); |
|
472 |
assertEquals("Count features", sourceFeatures.size(), targetFeatures.size()); |
|
473 |
for (int i = 0; i < targetFeatures.size(); i++) { |
|
474 |
Feature sourceFeature = sourceFeatures.get(i); |
|
475 |
Feature targetFeature = targetFeatures.get(i); |
|
476 |
for (FeatureAttributeDescriptor sourceAttr : sourceStore.getDefaultFeatureType()) { |
|
477 |
switch (sourceAttr.getType()) { |
|
478 |
case DataTypes.BYTE: |
|
479 |
assertEquals( |
|
480 |
String.format("Feature %03d attribute %s", i, sourceAttr.getName()), |
|
481 |
sourceFeature.getInt(sourceAttr.getName()), |
|
482 |
targetFeature.getInt(sourceAttr.getName()) |
|
483 |
); |
|
484 |
break; |
|
485 |
case DataTypes.TIMESTAMP: |
|
486 |
Date sourceTimestamp = sourceFeature.getDate(sourceAttr.getName()); |
|
487 |
Date targetTimestamp = targetFeature.getDate(sourceAttr.getName()); |
|
488 |
assertEquals( |
|
489 |
String.format("Feature %03d attribute %s", i, sourceAttr.getName()), |
|
490 |
sourceTimestamp, |
|
491 |
targetTimestamp |
|
492 |
); |
|
493 |
break; |
|
494 |
case DataTypes.TIME: |
|
495 |
assertEquals( |
|
496 |
String.format("Feature %03d attribute %s", i, sourceAttr.getName()), |
|
497 |
sourceFeature.getDate(sourceAttr.getName()), |
|
498 |
targetFeature.getDate(sourceAttr.getName()) |
|
499 |
); |
|
500 |
break; |
|
501 |
case DataTypes.GEOMETRY: |
|
502 |
Geometry sourceGeometry = (Geometry) (sourceFeature.get(sourceAttr.getName())); |
|
503 |
Geometry targetGeometry = (Geometry) (targetFeature.get(sourceAttr.getName())); |
|
504 |
if (sourceGeometry == null) { |
|
505 |
assertNull(targetGeometry); |
|
506 |
} else { |
|
507 |
assertEquals( |
|
508 |
String.format("Feature %03d attribute %s", i, sourceAttr.getName()), |
|
509 |
sourceGeometry.getGeometryType(), |
|
510 |
targetGeometry.getGeometryType() |
|
511 |
); |
|
512 |
assertTrue(sourceGeometry.distance(targetGeometry) < 0.0000000000001); |
|
513 |
} |
|
514 |
|
|
515 |
break; |
|
516 |
|
|
517 |
case DataTypes.BOOLEAN: |
|
518 |
assertEquals( |
|
519 |
String.format("Feature %03d attribute %s", i, sourceAttr.getName()), |
|
520 |
sourceFeature.getBoolean(sourceAttr.getName()), |
|
521 |
targetFeature.getBoolean(sourceAttr.getName()) |
|
522 |
); |
|
523 |
break; |
|
524 |
case DataTypes.STRING: |
|
525 |
case DataTypes.INT: |
|
526 |
case DataTypes.LONG: |
|
527 |
case DataTypes.FLOAT: |
|
528 |
case DataTypes.DOUBLE: |
|
529 |
default: |
|
530 |
Object sourceValue = sourceFeature.get(sourceAttr.getName()); |
|
531 |
Object targetValue = targetFeature.get(sourceAttr.getName()); |
|
532 |
if (sourceValue == null) { |
|
533 |
LOGGER.info(String.format("Feature %03d attribute %s is null", i, sourceAttr.getName())); |
|
534 |
} |
|
535 |
assertEquals( |
|
536 |
String.format("Feature %03d attribute %s", i, sourceAttr.getName()), |
|
537 |
sourceValue, |
|
538 |
targetValue |
|
539 |
); |
|
540 |
} |
|
541 |
} |
|
542 |
} |
|
543 |
} |
|
544 |
|
|
545 |
public void testCreatePopulateAndCheckDataWithoutDalResource() throws Exception { |
|
546 |
// FeatureStore sourceStore = TestUtils.openSourceStoreShort(); |
|
547 |
FeatureStore sourceStore = TestUtils.openSourceStore1(); |
|
548 |
JDBCServerExplorer explorer = TestUtils.openServerExplorer(); |
|
549 |
|
|
550 |
JDBCStoreParameters params = explorer.get(this.getTargetName()); |
|
551 |
if(params != null && explorer.exists(params) ){ |
|
552 |
explorer.remove(params); |
|
553 |
} |
|
554 |
|
|
555 |
createFrom(explorer, sourceStore); |
|
556 |
|
|
557 |
TestUtils.removeDALResource(this.getTargetName()); |
|
558 |
checkTypes(explorer, sourceStore.getDefaultFeatureType(), false); |
|
559 |
|
|
560 |
copyFrom(explorer, sourceStore, FeatureStore.MODE_APPEND); |
|
561 |
TestUtils.removeDALResource(this.getTargetName()); |
|
562 |
checkData(explorer, sourceStore, false); |
|
563 |
|
|
564 |
explorer.remove(params); |
|
565 |
|
|
566 |
createFrom(explorer, sourceStore); |
|
567 |
copyFrom(explorer, sourceStore, FeatureStore.MODE_FULLEDIT); |
|
568 |
TestUtils.removeDALResource(this.getTargetName()); |
|
569 |
checkData(explorer, sourceStore, false); |
|
570 |
|
|
571 |
explorer.remove(params); |
|
572 |
|
|
573 |
} |
|
574 |
|
|
575 |
public void testCreatePopulateAndCheckDataWithDalResource() throws Exception { |
|
576 |
// FeatureStore sourceStore = TestUtils.openSourceStoreShort(); |
|
577 |
FeatureStore sourceStore = TestUtils.openSourceStore1(); |
|
578 |
JDBCServerExplorer explorer = TestUtils.openServerExplorer(); |
|
579 |
|
|
580 |
JDBCStoreParameters params = explorer.get(this.getTargetName()); |
|
581 |
if (params != null && explorer.exists(params)) { |
|
582 |
explorer.remove(params); |
|
583 |
} |
|
584 |
|
|
585 |
createFrom(explorer, sourceStore); |
|
586 |
|
|
587 |
checkTypes(explorer, sourceStore.getDefaultFeatureType(), true); |
|
588 |
|
|
589 |
copyFrom(explorer, sourceStore, FeatureStore.MODE_APPEND); |
|
590 |
checkData(explorer, sourceStore, true); |
|
591 |
|
|
592 |
explorer.remove(params); |
|
593 |
|
|
594 |
createFrom(explorer, sourceStore); |
|
595 |
copyFrom(explorer, sourceStore, FeatureStore.MODE_FULLEDIT); |
|
596 |
checkData(explorer, sourceStore, true); |
|
597 |
|
|
598 |
explorer.remove(params); |
|
599 |
|
|
600 |
} |
|
601 |
|
|
602 |
} |
org.gvsig.oracle/tags/org.gvsig.oracle-2.0.118/org.gvsig.oracle.provider/src/test/java/org/gvsig/oracle/dal/operations/sql/TestDate.java | ||
---|---|---|
1 |
package org.gvsig.oracle.dal.operations.sql; |
|
2 |
|
|
3 |
import java.text.ParseException; |
|
4 |
import java.text.SimpleDateFormat; |
|
5 |
import java.util.Date; |
|
6 |
import java.util.List; |
|
7 |
import junit.framework.TestCase; |
|
8 |
import org.gvsig.expressionevaluator.GeometryExpressionBuilder; |
|
9 |
import org.gvsig.fmap.dal.feature.FeatureQuery; |
|
10 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
11 |
import org.gvsig.fmap.dal.feature.FeatureType; |
|
12 |
import org.gvsig.fmap.dal.store.jdbc2.JDBCHelper; |
|
13 |
import org.gvsig.fmap.dal.store.jdbc2.OperationsFactory; |
|
14 |
import org.gvsig.fmap.dal.store.jdbc2.OperationsFactory.TableReference; |
|
15 |
import org.gvsig.fmap.dal.store.jdbc2.spi.JDBCSQLBuilderBase; |
|
16 |
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.ResultSetForSetProviderOperation; |
|
17 |
import org.gvsig.oracle.dal.TestUtils; |
|
18 |
import org.gvsig.tools.library.impl.DefaultLibrariesInitializer; |
|
19 |
import org.slf4j.Logger; |
|
20 |
import org.slf4j.LoggerFactory; |
|
21 |
|
|
22 |
public class TestDate extends TestCase { |
|
23 |
|
|
24 |
private static final Logger LOGGER = LoggerFactory.getLogger(TestDate.class); |
|
25 |
|
|
26 |
public TestDate(String testName) { |
|
27 |
super(testName); |
|
28 |
} |
|
29 |
|
|
30 |
@Override |
|
31 |
protected void setUp() throws Exception { |
|
32 |
super.setUp(); |
|
33 |
new DefaultLibrariesInitializer().fullInitialize(); |
|
34 |
} |
|
35 |
|
|
36 |
@Override |
|
37 |
protected void tearDown() throws Exception { |
|
38 |
super.tearDown(); |
|
39 |
} |
|
40 |
|
|
41 |
private java.sql.Date date(String x) throws ParseException { |
|
42 |
Date d; |
|
43 |
if (x == null) { |
|
44 |
d = new Date(); |
|
45 |
} else { |
|
46 |
d = new SimpleDateFormat("yyyy-M-d").parse(x); |
|
47 |
} |
|
48 |
return new java.sql.Date(d.getTime()); |
|
49 |
} |
|
50 |
|
|
51 |
private java.sql.Time time(String x) throws ParseException { |
|
52 |
Date d = new SimpleDateFormat("H:mm:ss").parse(x); |
|
53 |
return new java.sql.Time(d.getTime()); |
|
54 |
} |
|
55 |
|
|
56 |
private java.sql.Timestamp timestamp(String x) throws ParseException { |
|
57 |
Date d = new SimpleDateFormat("yyyy-M-d H:mm:ss").parse(x); |
|
58 |
return new java.sql.Timestamp(d.getTime()); |
|
59 |
} |
|
60 |
|
|
61 |
public void testDate1() throws Exception { |
|
62 |
JDBCHelper helper = TestUtils.getJDBCHelper(); |
|
63 |
JDBCSQLBuilderBase sqlbuilder = helper.createSQLBuilder(); |
|
64 |
OperationsFactory operations = helper.getOperations(); |
|
65 |
|
|
66 |
List<String> expectedSQLs = TestUtils.getSQLs("date.sql"); |
|
67 |
|
|
68 |
FeatureStore sourceStore = TestUtils.openSourceStore1(); |
|
69 |
|
|
70 |
TableReference table = operations.createTableReference( |
|
71 |
"dbtest", |
|
72 |
sqlbuilder.default_schema(), |
|
73 |
"test", |
|
74 |
null |
|
75 |
); |
|
76 |
GeometryExpressionBuilder expbuilder = sqlbuilder.expression(); |
|
77 |
|
|
78 |
String filter = expbuilder.or( |
|
79 |
expbuilder.and( |
|
80 |
expbuilder.gt( |
|
81 |
expbuilder.column("Time"), |
|
82 |
expbuilder.timestamp("1970-01-01 01:02:03") |
|
83 |
), |
|
84 |
expbuilder.lt( |
|
85 |
expbuilder.column("Time"), |
|
86 |
expbuilder.timestamp("1970-01-01 20:52:55") |
|
87 |
) |
|
88 |
), |
|
89 |
expbuilder.and( |
|
90 |
expbuilder.gt( |
|
91 |
expbuilder.column("Date"), |
|
92 |
expbuilder.date("2019-02-17") |
|
93 |
), |
|
94 |
expbuilder.lt( |
|
95 |
expbuilder.column("Date"), |
|
96 |
expbuilder.date("2020-02-23") |
|
97 |
) |
|
98 |
) |
|
99 |
).toString(); |
|
100 |
FeatureType featureType = sourceStore.getDefaultFeatureType(); |
|
101 |
FeatureQuery query = sourceStore.createFeatureQuery(); |
|
102 |
query.addFilter(filter); |
|
103 |
ResultSetForSetProviderOperation resultSetForSetProvider = operations.createResultSetForSetProvider( |
|
104 |
table, |
|
105 |
null, |
|
106 |
null, |
|
107 |
query, |
|
108 |
featureType, |
|
109 |
featureType, |
|
110 |
0, |
|
111 |
0, |
|
112 |
0 |
|
113 |
); |
|
114 |
String sql = resultSetForSetProvider.getSQL(); |
|
115 |
System.out.println("###### SQL:" + sql); |
|
116 |
System.out.println("###### EXP:" + expectedSQLs.get(0)); |
|
117 |
|
|
118 |
assertEquals("Date SQL", expectedSQLs.get(0), sql); |
|
119 |
} |
|
120 |
|
|
121 |
// TODO: a?adir un test con where, group y order. |
|
122 |
} |
org.gvsig.oracle/tags/org.gvsig.oracle-2.0.118/org.gvsig.oracle.provider/src/test/java/org/gvsig/oracle/dal/operations/sql/TestTableIsEmpty.java | ||
---|---|---|
1 |
package org.gvsig.oracle.dal.operations.sql; |
|
2 |
|
|
3 |
import java.util.List; |
|
4 |
import junit.framework.TestCase; |
|
5 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
6 |
import org.gvsig.fmap.dal.feature.FeatureType; |
|
7 |
import org.gvsig.fmap.dal.store.jdbc2.JDBCHelper; |
|
8 |
import org.gvsig.fmap.dal.store.jdbc2.OperationsFactory; |
|
9 |
import org.gvsig.fmap.dal.store.jdbc2.OperationsFactory.TableReference; |
|
10 |
import org.gvsig.fmap.dal.store.jdbc2.spi.JDBCSQLBuilderBase; |
|
11 |
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.TableIsEmptyOperation; |
|
12 |
import org.gvsig.oracle.dal.TestUtils; |
|
13 |
import org.gvsig.tools.library.impl.DefaultLibrariesInitializer; |
|
14 |
import org.slf4j.Logger; |
|
15 |
import org.slf4j.LoggerFactory; |
|
16 |
|
|
17 |
public class TestTableIsEmpty extends TestCase { |
|
18 |
|
|
19 |
private static final Logger LOGGER = LoggerFactory.getLogger(TestTableIsEmpty.class); |
|
20 |
|
|
21 |
public TestTableIsEmpty(String testName) { |
|
22 |
super(testName); |
|
23 |
} |
|
24 |
|
|
25 |
@Override |
|
26 |
protected void setUp() throws Exception { |
|
27 |
super.setUp(); |
|
28 |
new DefaultLibrariesInitializer().fullInitialize(); |
|
29 |
} |
|
30 |
|
|
31 |
@Override |
|
32 |
protected void tearDown() throws Exception { |
|
33 |
super.tearDown(); |
|
34 |
} |
|
35 |
|
|
36 |
// TODO add test methods here. The name must begin with 'test'. For example: |
|
37 |
// public void testHello() {} |
|
38 |
|
|
39 |
public void testTableIsEmpty() throws Exception { |
|
40 |
JDBCHelper helper = TestUtils.getJDBCHelper(); |
|
41 |
JDBCSQLBuilderBase sqlbuilder = helper.createSQLBuilder(); |
|
42 |
OperationsFactory operations = helper.getOperations(); |
|
43 |
|
|
44 |
List<String> expectedSQLs = TestUtils.getSQLs("tableIsEmpty.sql"); |
|
45 |
|
|
46 |
FeatureStore sourceStore = TestUtils.openSourceStore1(); |
|
47 |
|
|
48 |
TableReference table = operations.createTableReference( |
|
49 |
"dbtest", |
|
50 |
sqlbuilder.default_schema(), |
|
51 |
"test", |
|
52 |
null |
|
53 |
); |
|
54 |
FeatureType featureType = sourceStore.getDefaultFeatureType(); |
|
55 |
TableIsEmptyOperation tableIsEmpty = operations.createTableIsEmpty( |
|
56 |
featureType, |
|
57 |
table, |
|
58 |
null, |
|
59 |
null |
|
60 |
); |
|
61 |
|
|
62 |
String sql = tableIsEmpty.getSQL(); |
|
63 |
assertEquals("TableIsEmpty SQL", expectedSQLs.get(0), sql); |
|
64 |
} |
|
65 |
|
|
66 |
} |
org.gvsig.oracle/tags/org.gvsig.oracle-2.0.118/org.gvsig.oracle.provider/src/test/java/org/gvsig/oracle/dal/operations/sql/TestPerformChanges.java | ||
---|---|---|
1 |
package org.gvsig.oracle.dal.operations.sql; |
|
2 |
|
|
3 |
import java.util.Collections; |
|
4 |
import java.util.List; |
|
5 |
import junit.framework.TestCase; |
|
6 |
import org.gvsig.fmap.dal.DALLocator; |
|
7 |
import org.gvsig.fmap.dal.DataTypes; |
|
8 |
import org.gvsig.fmap.dal.feature.EditableFeatureAttributeDescriptor; |
|
9 |
import org.gvsig.fmap.dal.feature.EditableFeatureType; |
|
10 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
11 |
import org.gvsig.fmap.dal.feature.FeatureType; |
|
12 |
import org.gvsig.fmap.dal.feature.FeatureType.FeatureTypeChanged; |
|
13 |
import org.gvsig.fmap.dal.store.jdbc2.JDBCHelper; |
|
14 |
import org.gvsig.fmap.dal.store.jdbc2.OperationsFactory; |
|
15 |
import org.gvsig.fmap.dal.store.jdbc2.OperationsFactory.TableReference; |
|
16 |
import org.gvsig.fmap.dal.store.jdbc2.spi.JDBCSQLBuilderBase; |
|
17 |
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.PerformChangesOperation; |
|
18 |
import org.gvsig.oracle.dal.TestUtils; |
|
19 |
import org.gvsig.tools.library.impl.DefaultLibrariesInitializer; |
|
20 |
import org.slf4j.Logger; |
|
21 |
import org.slf4j.LoggerFactory; |
|
22 |
|
|
23 |
public class TestPerformChanges extends TestCase { |
|
24 |
|
|
25 |
private static final Logger LOGGER = LoggerFactory.getLogger(TestPerformChanges.class); |
|
26 |
|
|
27 |
public TestPerformChanges(String testName) { |
|
28 |
super(testName); |
|
29 |
} |
|
30 |
|
|
31 |
@Override |
|
32 |
protected void setUp() throws Exception { |
|
33 |
super.setUp(); |
|
34 |
new DefaultLibrariesInitializer().fullInitialize(); |
|
35 |
} |
|
36 |
|
|
37 |
@Override |
|
38 |
protected void tearDown() throws Exception { |
|
39 |
super.tearDown(); |
|
40 |
} |
|
41 |
|
|
42 |
// TODO add test methods here. The name must begin with 'test'. For example: |
|
43 |
// public void testHello() {} |
|
44 |
|
|
45 |
public void testPerformChanges() throws Exception { |
|
46 |
JDBCHelper helper = TestUtils.getJDBCHelper(); |
|
47 |
JDBCSQLBuilderBase sqlbuilder = helper.createSQLBuilder(); |
|
48 |
OperationsFactory operations = helper.getOperations(); |
|
49 |
|
|
50 |
List<String> expectedSQLs = TestUtils.getSQLs("performChanges.sql"); |
|
51 |
|
|
52 |
FeatureStore sourceStore = TestUtils.openSourceStore1(); |
|
53 |
|
|
54 |
TableReference table = operations.createTableReference( |
|
55 |
"dbtest", |
|
56 |
sqlbuilder.default_schema(), |
|
57 |
"test", |
|
58 |
null |
|
59 |
); |
|
60 |
FeatureType featureType = sourceStore.getDefaultFeatureType(); |
|
61 |
|
|
62 |
|
|
63 |
FeatureTypeChanged featureTypeChanged = new FeatureTypeChanged() { |
|
64 |
@Override |
|
65 |
public FeatureType getSource() { |
|
66 |
EditableFeatureType ft = DALLocator.getDataManager().createFeatureType(); |
|
67 |
EditableFeatureAttributeDescriptor id = ft.add("ID", DataTypes.INT); |
|
68 |
id.copyFrom(featureType.getAttributeDescriptor("ID")); |
|
69 |
return ft; |
|
70 |
} |
|
71 |
|
|
72 |
@Override |
|
73 |
public FeatureType getTarget() { |
|
74 |
return featureType; |
|
75 |
} |
|
76 |
}; |
|
77 |
List<FeatureTypeChanged> featureTypesChangeds = Collections.singletonList(featureTypeChanged); |
|
78 |
|
|
79 |
PerformChangesOperation performChanges = operations.createPerformChanges( |
|
80 |
table, |
|
81 |
sourceStore.getDefaultFeatureType(), |
|
82 |
null, |
|
83 |
null, |
|
84 |
null, |
|
85 |
featureTypesChangeds.iterator() |
|
86 |
); |
|
87 |
String insertSQL = performChanges.getInsertSQL(); |
|
88 |
String deleteSQL = performChanges.getDeleteSQL(); |
|
89 |
String updateSQL = performChanges.getUpdateSQL(); |
|
90 |
List<String> updateTableSQLs = performChanges.getUpdateTableSQLs(); |
|
91 |
|
|
92 |
assertEquals("Insert SQL", expectedSQLs.get(0), insertSQL); |
|
93 |
assertEquals("Delete SQL", expectedSQLs.get(1), deleteSQL); |
|
94 |
assertEquals("Update SQL", expectedSQLs.get(2), updateSQL); |
|
95 |
assertEquals("UpdateTable num. SQLs", expectedSQLs.size()-3, updateTableSQLs.size()); |
|
96 |
for (int i = 0; i < updateTableSQLs.size(); i++) { |
|
97 |
assertEquals("UpdateTable SQL "+i, expectedSQLs.get(i+3), updateTableSQLs.get(i)); |
|
98 |
} |
|
99 |
|
|
100 |
|
|
101 |
} |
|
102 |
|
|
103 |
} |
org.gvsig.oracle/tags/org.gvsig.oracle-2.0.118/org.gvsig.oracle.provider/src/test/java/org/gvsig/oracle/dal/operations/sql/TestUpdateTableStatistics.java | ||
---|---|---|
1 |
package org.gvsig.oracle.dal.operations.sql; |
|
2 |
|
|
3 |
import java.util.List; |
|
4 |
import junit.framework.TestCase; |
|
5 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
6 |
import org.gvsig.fmap.dal.feature.FeatureType; |
|
7 |
import org.gvsig.fmap.dal.store.jdbc2.JDBCHelper; |
|
8 |
import org.gvsig.fmap.dal.store.jdbc2.OperationsFactory; |
|
9 |
import org.gvsig.fmap.dal.store.jdbc2.OperationsFactory.TableReference; |
|
10 |
import org.gvsig.fmap.dal.store.jdbc2.spi.JDBCSQLBuilderBase; |
|
11 |
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.UpdateTableStatisticsOperation; |
|
12 |
import org.gvsig.oracle.dal.TestUtils; |
|
13 |
import org.gvsig.tools.library.impl.DefaultLibrariesInitializer; |
|
14 |
import org.slf4j.Logger; |
|
15 |
import org.slf4j.LoggerFactory; |
|
16 |
|
|
17 |
public class TestUpdateTableStatistics extends TestCase { |
|
18 |
|
|
19 |
private static final Logger LOGGER = LoggerFactory.getLogger(TestUpdateTableStatistics.class); |
|
20 |
|
|
21 |
public TestUpdateTableStatistics(String testName) { |
|
22 |
super(testName); |
|
23 |
} |
|
24 |
|
|
25 |
@Override |
|
26 |
protected void setUp() throws Exception { |
|
27 |
super.setUp(); |
|
28 |
new DefaultLibrariesInitializer().fullInitialize(); |
|
29 |
} |
|
30 |
|
|
31 |
@Override |
|
32 |
protected void tearDown() throws Exception { |
|
33 |
super.tearDown(); |
|
34 |
} |
|
35 |
|
|
36 |
// TODO add test methods here. The name must begin with 'test'. For example: |
|
37 |
// public void testHello() {} |
|
38 |
|
|
39 |
public void testUpdateTableStatistics() throws Exception { |
|
40 |
JDBCHelper helper = TestUtils.getJDBCHelper(); |
|
41 |
JDBCSQLBuilderBase sqlbuilder = helper.createSQLBuilder(); |
|
42 |
OperationsFactory operations = helper.getOperations(); |
|
43 |
|
|
44 |
List<String> expectedSQLs = TestUtils.getSQLs("updateTableStatistics.sql"); |
|
45 |
|
|
46 |
FeatureStore sourceStore = TestUtils.openSourceStore1(); |
|
47 |
|
|
48 |
TableReference table = operations.createTableReference( |
|
49 |
"dbtest", |
|
50 |
sqlbuilder.default_schema(), |
|
51 |
"test", |
|
52 |
null |
|
53 |
); |
|
54 |
FeatureType featureType = sourceStore.getDefaultFeatureType(); |
|
55 |
UpdateTableStatisticsOperation updateTableStatistics = operations.createUpdateTableStatistics( |
|
56 |
table |
|
57 |
); |
|
58 |
|
|
59 |
List<String> SQLs = updateTableStatistics.getSQLs(); |
|
60 |
assertEquals("UpdateTableStatistics num. SQLs", expectedSQLs.size(), SQLs.size()); |
|
61 |
for (int i = 0; i < expectedSQLs.size(); i++) { |
|
62 |
assertEquals("UpdateTableStatistics SQL "+i, expectedSQLs.get(i), SQLs.get(i)); |
|
63 |
} |
|
64 |
} |
|
65 |
|
|
66 |
} |
org.gvsig.oracle/tags/org.gvsig.oracle-2.0.118/org.gvsig.oracle.provider/src/test/java/org/gvsig/oracle/dal/operations/sql/TestAppend.java | ||
---|---|---|
1 |
package org.gvsig.oracle.dal.operations.sql; |
|
2 |
|
|
3 |
import java.util.ArrayList; |
|
4 |
import java.util.List; |
|
5 |
import junit.framework.TestCase; |
|
6 |
import org.gvsig.fmap.dal.DataTypes; |
|
7 |
import org.gvsig.fmap.dal.feature.Feature; |
|
8 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
|
9 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
10 |
import org.gvsig.fmap.dal.feature.FeatureType; |
|
11 |
import org.gvsig.fmap.dal.store.jdbc2.JDBCHelper; |
|
12 |
import org.gvsig.fmap.dal.store.jdbc2.OperationsFactory; |
|
13 |
import org.gvsig.fmap.dal.store.jdbc2.OperationsFactory.TableReference; |
|
14 |
import org.gvsig.fmap.dal.store.jdbc2.spi.JDBCSQLBuilderBase; |
|
15 |
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.AppendOperation; |
|
16 |
import org.gvsig.fmap.geom.GeometryUtils; |
|
17 |
import org.gvsig.oracle.dal.TestUtils; |
|
18 |
import org.gvsig.tools.library.impl.DefaultLibrariesInitializer; |
|
19 |
import org.slf4j.Logger; |
|
20 |
import org.slf4j.LoggerFactory; |
|
21 |
|
|
22 |
public class TestAppend extends TestCase { |
|
23 |
|
|
24 |
private static final Logger LOGGER = LoggerFactory.getLogger(TestAppend.class); |
|
25 |
|
|
26 |
public TestAppend(String testName) { |
|
27 |
super(testName); |
|
28 |
} |
|
29 |
|
|
30 |
@Override |
|
31 |
protected void setUp() throws Exception { |
|
32 |
super.setUp(); |
|
33 |
new DefaultLibrariesInitializer().fullInitialize(); |
|
34 |
} |
|
35 |
|
|
36 |
@Override |
|
37 |
protected void tearDown() throws Exception { |
|
38 |
super.tearDown(); |
|
39 |
} |
|
40 |
|
|
41 |
// TODO add test methods here. The name must begin with 'test'. For example: |
|
42 |
// public void testHello() {} |
|
43 |
|
|
44 |
public void testAppend() throws Exception { |
|
45 |
JDBCHelper helper = TestUtils.getJDBCHelper(); |
|
46 |
JDBCSQLBuilderBase sqlbuilder = helper.createSQLBuilder(); |
|
47 |
OperationsFactory operations = helper.getOperations(); |
|
48 |
|
|
49 |
List<String> expectedSQLs = TestUtils.getSQLs("append.sql"); |
|
50 |
|
|
51 |
FeatureStore sourceStore = TestUtils.openSourceStore1(); |
|
52 |
|
|
53 |
TableReference table = operations.createTableReference( |
|
54 |
"dbtest", |
|
55 |
sqlbuilder.default_schema(), |
|
56 |
"test", |
|
57 |
null |
|
58 |
); |
|
59 |
FeatureType featureType = sourceStore.getDefaultFeatureType(); |
|
60 |
AppendOperation append = operations.createAppend( |
|
61 |
table, |
|
62 |
featureType |
|
63 |
); |
|
64 |
append.begin(); |
|
65 |
List<String> SQLs = new ArrayList<>(); |
|
66 |
SQLs.addAll(append.getPreviousSQLs()); |
|
67 |
SQLs.add( append.getSQL()); |
|
68 |
SQLs.addAll(append.getPostSQLs()); |
|
69 |
assertEquals("Append num SQLs", expectedSQLs.size(), SQLs.size()); |
|
70 |
for (int i = 0; i < expectedSQLs.size(); i++) { |
|
71 |
assertEquals("Append SQL "+i, expectedSQLs.get(i), SQLs.get(i)); |
|
72 |
} |
|
73 |
|
|
74 |
for (Feature sourceFeature : sourceStore.getFeatureSet()) { |
|
75 |
List<Object> parametersSQL = append.getSQLParameters(TestUtils.getFeatureProvider(sourceFeature)); |
|
76 |
List<Object> expectedParameters = this.getExpectedParameters(sourceFeature); |
|
77 |
assertEquals("Append num. parameters", expectedParameters.size(), parametersSQL.size() ); |
|
78 |
for (int i = 0; i < expectedParameters.size(); i++) { |
|
79 |
assertEquals("Append parameter "+i, expectedParameters.get(i), parametersSQL.get(i)); |
|
80 |
} |
|
81 |
} |
|
82 |
append.end(); |
|
83 |
} |
|
84 |
|
|
85 |
private List<Object> getExpectedParameters(Feature sourceFeature) { |
|
86 |
FeatureType ft = sourceFeature.getType(); |
|
87 |
List<Object> values = new ArrayList<>(); |
|
88 |
for (FeatureAttributeDescriptor attr : ft) { |
|
89 |
Object v = sourceFeature.get(attr.getIndex()); |
|
90 |
if( attr.getType()==DataTypes.GEOMETRY ) { |
|
91 |
//NVL2 need two times the geometry parameter |
|
92 |
if(v==null){ |
|
93 |
//If geometry is null, SDO_GEOMETRY need a not null geometry |
|
94 |
values.add(null); |
|
95 |
values.add(GeometryUtils.createPoint(0, 0)); |
|
96 |
} else { |
|
97 |
values.add(1); |
|
98 |
values.add(v); |
|
99 |
} |
|
100 |
String srs = attr.getSRS().getAbrev(); |
|
101 |
values.add(Integer.parseInt(srs.split(":")[1])); |
|
102 |
} else { |
|
103 |
values.add(v); |
|
104 |
} |
|
105 |
} |
|
106 |
return values; |
|
107 |
} |
|
108 |
|
|
109 |
} |
org.gvsig.oracle/tags/org.gvsig.oracle-2.0.118/org.gvsig.oracle.provider/src/test/java/org/gvsig/oracle/dal/operations/sql/TestFetchFeatureType.java | ||
---|---|---|
1 |
package org.gvsig.oracle.dal.operations.sql; |
|
2 |
|
|
3 |
import java.util.Collections; |
|
4 |
import java.util.List; |
|
5 |
import junit.framework.TestCase; |
|
6 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
7 |
import org.gvsig.fmap.dal.feature.FeatureType; |
|
8 |
import org.gvsig.fmap.dal.store.jdbc2.JDBCHelper; |
|
9 |
import org.gvsig.fmap.dal.store.jdbc2.OperationsFactory; |
|
10 |
import org.gvsig.fmap.dal.store.jdbc2.OperationsFactory.TableReference; |
|
11 |
import org.gvsig.fmap.dal.store.jdbc2.spi.JDBCSQLBuilderBase; |
|
12 |
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.FetchFeatureTypeOperation; |
|
13 |
import org.gvsig.oracle.dal.TestUtils; |
|
14 |
import org.gvsig.tools.library.impl.DefaultLibrariesInitializer; |
|
15 |
import org.slf4j.Logger; |
|
16 |
import org.slf4j.LoggerFactory; |
|
17 |
|
|
18 |
public class TestFetchFeatureType extends TestCase { |
|
19 |
|
|
20 |
private static final Logger LOGGER = LoggerFactory.getLogger(TestFetchFeatureType.class); |
|
21 |
|
|
22 |
public TestFetchFeatureType(String testName) { |
|
23 |
super(testName); |
|
24 |
} |
|
25 |
|
|
26 |
@Override |
|
27 |
protected void setUp() throws Exception { |
|
28 |
super.setUp(); |
|
29 |
new DefaultLibrariesInitializer().fullInitialize(); |
|
30 |
} |
|
31 |
|
|
32 |
@Override |
|
33 |
protected void tearDown() throws Exception { |
|
34 |
super.tearDown(); |
|
35 |
} |
|
36 |
|
|
37 |
// TODO add test methods here. The name must begin with 'test'. For example: |
|
38 |
// public void testHello() {} |
|
39 |
|
|
40 |
public void testFetchFeatureType() throws Exception { |
|
41 |
JDBCHelper helper = TestUtils.getJDBCHelper(); |
|
42 |
JDBCSQLBuilderBase sqlbuilder = helper.createSQLBuilder(); |
|
43 |
OperationsFactory operations = helper.getOperations(); |
|
44 |
|
|
45 |
List<String> expectedSQLs = TestUtils.getSQLs("fetchFeatureType.sql"); |
|
46 |
|
|
47 |
FeatureStore sourceStore = TestUtils.openSourceStore1(); |
|
48 |
|
|
49 |
TableReference table = operations.createTableReference( |
|
50 |
"dbtest", |
|
51 |
sqlbuilder.default_schema(), |
|
52 |
"test", |
|
53 |
null |
|
54 |
); |
|
55 |
FeatureType featureType = sourceStore.getDefaultFeatureType(); |
|
56 |
FetchFeatureTypeOperation fetchFeatureType = operations.createFetchFeatureType( |
|
57 |
featureType.getEditable(), |
|
58 |
table, |
|
59 |
Collections.EMPTY_LIST, |
|
60 |
null, // "Geometry" |
|
61 |
featureType.getDefaultSRS() |
|
62 |
); |
|
63 |
|
|
64 |
|
|
65 |
String retrieveFirstRowOfTableSQL = fetchFeatureType.getSQLToRetrieveMetadataOfTable(); |
|
66 |
String retrievePrimaryKeysFromInformationSchemaSQL = fetchFeatureType.getSQLToRetrievePrimaryKeysFromInformationSchema(); |
|
67 |
|
|
68 |
assertEquals("FetchFeatureType first row SQL", expectedSQLs.get(0), retrieveFirstRowOfTableSQL); |
|
69 |
assertEquals("FetchFeatureType get primery keys SQL", expectedSQLs.get(1), retrievePrimaryKeysFromInformationSchemaSQL); |
|
70 |
} |
|
71 |
|
|
72 |
} |
org.gvsig.oracle/tags/org.gvsig.oracle-2.0.118/org.gvsig.oracle.provider/src/test/java/org/gvsig/oracle/dal/operations/sql/TestCount.java | ||
---|---|---|
1 |
package org.gvsig.oracle.dal.operations.sql; |
|
2 |
|
|
3 |
import java.util.List; |
|
4 |
import junit.framework.TestCase; |
|
5 |
import static junit.framework.TestCase.assertEquals; |
|
6 |
import org.gvsig.fmap.dal.feature.FeatureQuery; |
|
7 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
8 |
import org.gvsig.fmap.dal.feature.FeatureType; |
|
9 |
import org.gvsig.fmap.dal.store.jdbc2.AbstractTestUtils; |
|
10 |
import org.gvsig.fmap.dal.store.jdbc2.JDBCHelper; |
|
11 |
import org.gvsig.fmap.dal.store.jdbc2.OperationsFactory; |
|
12 |
import org.gvsig.fmap.dal.store.jdbc2.OperationsFactory.TableReference; |
|
13 |
import org.gvsig.fmap.dal.store.jdbc2.operations.sql.AbstractTestCount; |
|
14 |
import org.gvsig.fmap.dal.store.jdbc2.spi.JDBCSQLBuilderBase; |
|
15 |
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.CountOperation; |
|
16 |
import org.gvsig.oracle.dal.TestUtils; |
|
17 |
import org.gvsig.oracle.dal.TestUtilsOracle; |
|
18 |
import org.gvsig.tools.library.impl.DefaultLibrariesInitializer; |
|
19 |
import org.slf4j.Logger; |
|
20 |
import org.slf4j.LoggerFactory; |
|
21 |
|
|
22 |
public class TestCount extends AbstractTestCount { |
|
23 |
|
|
24 |
private static final Logger LOGGER = LoggerFactory.getLogger(TestCount.class); |
|
25 |
|
|
26 |
public TestCount(String testName) { |
|
27 |
super(testName); |
|
28 |
} |
|
29 |
|
|
30 |
@Override |
|
31 |
protected AbstractTestUtils createUtils() { |
|
32 |
return new TestUtilsOracle(); |
|
33 |
} |
|
34 |
|
|
35 |
@Override |
|
36 |
public void testCount() throws Exception { |
|
37 |
super.testCount(); |
|
38 |
} |
|
39 |
|
|
40 |
@Override |
|
41 |
public void testAggregates() throws Exception { |
|
42 |
super.testAggregates(); |
|
43 |
} |
|
44 |
|
|
45 |
@Override |
|
46 |
public void testGroup() throws Exception { |
|
47 |
super.testGroup(); |
|
48 |
} |
|
49 |
|
|
50 |
@Override |
|
51 |
public void testAggregatesAndGroup() throws Exception { |
|
52 |
super.testAggregatesAndGroup(); |
|
53 |
} |
|
54 |
} |
org.gvsig.oracle/tags/org.gvsig.oracle-2.0.118/org.gvsig.oracle.provider/src/test/java/org/gvsig/oracle/dal/operations/sql/TestResultSetForSetProvider.java | ||
---|---|---|
1 |
package org.gvsig.oracle.dal.operations.sql; |
|
2 |
|
|
3 |
import java.util.List; |
|
4 |
import junit.framework.TestCase; |
|
5 |
import org.gvsig.fmap.dal.feature.EditableFeatureType; |
|
6 |
import org.gvsig.fmap.dal.feature.FeatureQuery; |
|
7 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
8 |
import org.gvsig.fmap.dal.feature.FeatureType; |
|
9 |
import org.gvsig.fmap.dal.store.jdbc2.JDBCHelper; |
|
10 |
import org.gvsig.fmap.dal.store.jdbc2.OperationsFactory; |
|
11 |
import org.gvsig.fmap.dal.store.jdbc2.OperationsFactory.TableReference; |
|
12 |
import org.gvsig.fmap.dal.store.jdbc2.spi.JDBCSQLBuilderBase; |
|
13 |
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.ResultSetForSetProviderOperation; |
|
14 |
import org.gvsig.oracle.dal.TestUtils; |
|
15 |
import org.gvsig.tools.library.impl.DefaultLibrariesInitializer; |
|
16 |
import org.slf4j.Logger; |
|
17 |
import org.slf4j.LoggerFactory; |
|
18 |
|
|
19 |
public class TestResultSetForSetProvider extends TestCase { |
|
20 |
|
|
21 |
private static final Logger LOGGER = LoggerFactory.getLogger(TestResultSetForSetProvider.class); |
|
22 |
|
|
23 |
public TestResultSetForSetProvider(String testName) { |
|
24 |
super(testName); |
|
25 |
} |
|
26 |
|
|
27 |
@Override |
|
28 |
protected void setUp() throws Exception { |
|
29 |
super.setUp(); |
|
30 |
new DefaultLibrariesInitializer().fullInitialize(); |
|
31 |
} |
|
32 |
|
Also available in: Unified diff