Revision 45649
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.h2spatial/org.gvsig.h2spatial.h2gis132/org.gvsig.h2spatial.h2gis132.provider/src/test/java/org/gvsig/fmap/dal/store/h2/H2SpatialSQLBuilderTest.java | ||
---|---|---|
10 | 10 |
import org.gvsig.fmap.dal.SQLBuilder.Privilege; |
11 | 11 |
import org.gvsig.fmap.dal.feature.spi.SQLBuilderBase; |
12 | 12 |
import org.gvsig.fmap.dal.store.jdbc2.OperationsFactory.TableReference; |
13 |
import org.gvsig.fmap.dal.store.jdbc2.spi.FakeConnectionProvider; |
|
14 | 13 |
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.OperationsFactoryBase; |
15 | 14 |
import org.gvsig.fmap.geom.DataTypes; |
16 | 15 |
import org.gvsig.fmap.geom.Geometry; |
... | ... | |
36 | 35 |
super.tearDown(); |
37 | 36 |
} |
38 | 37 |
|
39 |
private SQLBuilder createSQLBuilder() { |
|
40 |
H2SpatialHelper helper = new H2SpatialHelper(null, new FakeConnectionProvider());
|
|
38 |
private SQLBuilder createSQLBuilder() throws Exception {
|
|
39 |
H2SpatialHelper helper = TestUtils.createJDBCHelper();
|
|
41 | 40 |
return new H2SpatialSQLBuilder(helper); |
42 | 41 |
} |
43 | 42 |
|
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.h2spatial/org.gvsig.h2spatial.h2gis132/org.gvsig.h2spatial.h2gis132.provider/src/test/java/org/gvsig/fmap/dal/store/h2/TestUtils.java | ||
---|---|---|
121 | 121 |
return ((DefaultFeature)feature).getData(); |
122 | 122 |
} |
123 | 123 |
|
124 |
public static JDBCHelper getJDBCHelper() throws Exception {
|
|
124 |
public static H2SpatialHelper createJDBCHelper() throws Exception {
|
|
125 | 125 |
H2SpatialConnectionParameters params = buildDBConnection("fake"); |
126 | 126 |
H2SpatialHelper helper = new H2SpatialHelper(params, new FakeConnectionProvider()); |
127 | 127 |
return helper; |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.h2spatial/org.gvsig.h2spatial.h2gis132/org.gvsig.h2spatial.h2gis132.provider/src/test/java/org/gvsig/fmap/dal/store/h2/operations/sql/TestTableIsEmpty.java | ||
---|---|---|
37 | 37 |
// public void testHello() {} |
38 | 38 |
|
39 | 39 |
public void testTableIsEmpty() throws Exception { |
40 |
JDBCHelper helper = TestUtils.getJDBCHelper();
|
|
40 |
JDBCHelper helper = TestUtils.createJDBCHelper();
|
|
41 | 41 |
JDBCSQLBuilderBase sqlbuilder = helper.createSQLBuilder(); |
42 | 42 |
OperationsFactory operations = helper.getOperations(); |
43 | 43 |
|
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.h2spatial/org.gvsig.h2spatial.h2gis132/org.gvsig.h2spatial.h2gis132.provider/src/test/java/org/gvsig/fmap/dal/store/h2/operations/sql/TestPerformChanges.java | ||
---|---|---|
43 | 43 |
// public void testHello() {} |
44 | 44 |
|
45 | 45 |
public void testPerformChanges() throws Exception { |
46 |
JDBCHelper helper = TestUtils.getJDBCHelper();
|
|
46 |
JDBCHelper helper = TestUtils.createJDBCHelper();
|
|
47 | 47 |
JDBCSQLBuilderBase sqlbuilder = helper.createSQLBuilder(); |
48 | 48 |
OperationsFactory operations = helper.getOperations(); |
49 | 49 |
|
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.h2spatial/org.gvsig.h2spatial.h2gis132/org.gvsig.h2spatial.h2gis132.provider/src/test/java/org/gvsig/fmap/dal/store/h2/operations/sql/TestUpdateTableStatistics.java | ||
---|---|---|
37 | 37 |
// public void testHello() {} |
38 | 38 |
|
39 | 39 |
public void testUpdateTableStatistics() throws Exception { |
40 |
JDBCHelper helper = TestUtils.getJDBCHelper();
|
|
40 |
JDBCHelper helper = TestUtils.createJDBCHelper();
|
|
41 | 41 |
JDBCSQLBuilderBase sqlbuilder = helper.createSQLBuilder(); |
42 | 42 |
OperationsFactory operations = helper.getOperations(); |
43 | 43 |
|
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.h2spatial/org.gvsig.h2spatial.h2gis132/org.gvsig.h2spatial.h2gis132.provider/src/test/java/org/gvsig/fmap/dal/store/h2/operations/sql/TestAppend.java | ||
---|---|---|
41 | 41 |
// public void testHello() {} |
42 | 42 |
|
43 | 43 |
public void testAppend() throws Exception { |
44 |
JDBCHelper helper = TestUtils.getJDBCHelper();
|
|
44 |
JDBCHelper helper = TestUtils.createJDBCHelper();
|
|
45 | 45 |
JDBCSQLBuilderBase sqlbuilder = helper.createSQLBuilder(); |
46 | 46 |
OperationsFactory operations = helper.getOperations(); |
47 | 47 |
|
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.h2spatial/org.gvsig.h2spatial.h2gis132/org.gvsig.h2spatial.h2gis132.provider/src/test/java/org/gvsig/fmap/dal/store/h2/operations/sql/TestFetchFeatureType.java | ||
---|---|---|
38 | 38 |
// public void testHello() {} |
39 | 39 |
|
40 | 40 |
public void testFetchFeatureType() throws Exception { |
41 |
JDBCHelper helper = TestUtils.getJDBCHelper();
|
|
41 |
JDBCHelper helper = TestUtils.createJDBCHelper();
|
|
42 | 42 |
JDBCSQLBuilderBase sqlbuilder = helper.createSQLBuilder(); |
43 | 43 |
OperationsFactory operations = helper.getOperations(); |
44 | 44 |
|
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.h2spatial/org.gvsig.h2spatial.h2gis132/org.gvsig.h2spatial.h2gis132.provider/src/test/java/org/gvsig/fmap/dal/store/h2/operations/sql/TestCount.java | ||
---|---|---|
37 | 37 |
} |
38 | 38 |
|
39 | 39 |
public void testCount() throws Exception { |
40 |
JDBCHelper helper = TestUtils.getJDBCHelper();
|
|
40 |
JDBCHelper helper = TestUtils.createJDBCHelper();
|
|
41 | 41 |
JDBCSQLBuilderBase sqlbuilder = helper.createSQLBuilder(); |
42 | 42 |
OperationsFactory operations = helper.getOperations(); |
43 | 43 |
|
... | ... | |
64 | 64 |
} |
65 | 65 |
|
66 | 66 |
public void testSimpleGroup() throws Exception { |
67 |
JDBCHelper helper = TestUtils.getJDBCHelper();
|
|
67 |
JDBCHelper helper = TestUtils.createJDBCHelper();
|
|
68 | 68 |
JDBCSQLBuilderBase sqlbuilder = helper.createSQLBuilder(); |
69 | 69 |
OperationsFactory operations = helper.getOperations(); |
70 | 70 |
|
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.h2spatial/org.gvsig.h2spatial.h2gis132/org.gvsig.h2spatial.h2gis132.provider/src/test/java/org/gvsig/fmap/dal/store/h2/operations/sql/TestResultSetForSetProvider.java | ||
---|---|---|
36 | 36 |
} |
37 | 37 |
|
38 | 38 |
public void testSimple() throws Exception { |
39 |
JDBCHelper helper = TestUtils.getJDBCHelper();
|
|
39 |
JDBCHelper helper = TestUtils.createJDBCHelper();
|
|
40 | 40 |
JDBCSQLBuilderBase sqlbuilder = helper.createSQLBuilder(); |
41 | 41 |
OperationsFactory operations = helper.getOperations(); |
42 | 42 |
|
... | ... | |
67 | 67 |
} |
68 | 68 |
|
69 | 69 |
public void testSimpleGroup() throws Exception { |
70 |
JDBCHelper helper = TestUtils.getJDBCHelper();
|
|
70 |
JDBCHelper helper = TestUtils.createJDBCHelper();
|
|
71 | 71 |
JDBCSQLBuilderBase sqlbuilder = helper.createSQLBuilder(); |
72 | 72 |
OperationsFactory operations = helper.getOperations(); |
73 | 73 |
|
... | ... | |
106 | 106 |
} |
107 | 107 |
|
108 | 108 |
public void testSubselect() throws Exception { |
109 |
JDBCHelper helper = TestUtils.getJDBCHelper();
|
|
109 |
JDBCHelper helper = TestUtils.createJDBCHelper();
|
|
110 | 110 |
JDBCSQLBuilderBase sqlbuilder = helper.createSQLBuilder(); |
111 | 111 |
OperationsFactory operations = helper.getOperations(); |
112 | 112 |
|
... | ... | |
151 | 151 |
} |
152 | 152 |
|
153 | 153 |
public void testGroupAndSubselect() throws Exception { |
154 |
JDBCHelper helper = TestUtils.getJDBCHelper();
|
|
154 |
JDBCHelper helper = TestUtils.createJDBCHelper();
|
|
155 | 155 |
JDBCSQLBuilderBase sqlbuilder = helper.createSQLBuilder(); |
156 | 156 |
OperationsFactory operations = helper.getOperations(); |
157 | 157 |
|
... | ... | |
202 | 202 |
|
203 | 203 |
|
204 | 204 |
public void testConstantColumnPrimaryKey() throws Exception { |
205 |
JDBCHelper helper = TestUtils.getJDBCHelper();
|
|
205 |
JDBCHelper helper = TestUtils.createJDBCHelper();
|
|
206 | 206 |
JDBCSQLBuilderBase sqlbuilder = helper.createSQLBuilder(); |
207 | 207 |
OperationsFactory operations = helper.getOperations(); |
208 | 208 |
|
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.h2spatial/org.gvsig.h2spatial.h2gis132/org.gvsig.h2spatial.h2gis132.provider/src/test/java/org/gvsig/fmap/dal/store/h2/operations/sql/TestFetchFeatureProviderByReference.java | ||
---|---|---|
41 | 41 |
// public void testHello() {} |
42 | 42 |
|
43 | 43 |
public void testFetchFeatureProviderByReference() throws Exception { |
44 |
JDBCHelper helper = TestUtils.getJDBCHelper();
|
|
44 |
JDBCHelper helper = TestUtils.createJDBCHelper();
|
|
45 | 45 |
JDBCSQLBuilderBase sqlbuilder = helper.createSQLBuilder(); |
46 | 46 |
OperationsFactory operations = helper.getOperations(); |
47 | 47 |
|
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.h2spatial/org.gvsig.h2spatial.h2gis132/org.gvsig.h2spatial.h2gis132.provider/src/test/java/org/gvsig/fmap/dal/store/h2/operations/sql/TestCalculateEnvelope.java | ||
---|---|---|
37 | 37 |
// public void testHello() {} |
38 | 38 |
|
39 | 39 |
public void testCalculateEnvelope() throws Exception { |
40 |
JDBCHelper helper = TestUtils.getJDBCHelper();
|
|
40 |
JDBCHelper helper = TestUtils.createJDBCHelper();
|
|
41 | 41 |
JDBCSQLBuilderBase sqlbuilder = helper.createSQLBuilder(); |
42 | 42 |
OperationsFactory operations = helper.getOperations(); |
43 | 43 |
|
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.h2spatial/org.gvsig.h2spatial.h2gis132/org.gvsig.h2spatial.h2gis132.provider/src/test/java/org/gvsig/fmap/dal/store/h2/operations/sql/TestCreateTable.java | ||
---|---|---|
37 | 37 |
// public void testHello() {} |
38 | 38 |
|
39 | 39 |
public void testCreateTable() throws Exception { |
40 |
JDBCHelper helper = TestUtils.getJDBCHelper();
|
|
40 |
JDBCHelper helper = TestUtils.createJDBCHelper();
|
|
41 | 41 |
JDBCSQLBuilderBase sqlbuilder = helper.createSQLBuilder(); |
42 | 42 |
OperationsFactory operations = helper.getOperations(); |
43 | 43 |
|
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.h2spatial/org.gvsig.h2spatial.h2gis132/org.gvsig.h2spatial.h2gis132.provider/src/test/java/org/gvsig/fmap/dal/store/h2/operations/sql/TestDropTable.java | ||
---|---|---|
36 | 36 |
// public void testHello() {} |
37 | 37 |
|
38 | 38 |
public void testDropTable() throws Exception { |
39 |
JDBCHelper helper = TestUtils.getJDBCHelper();
|
|
39 |
JDBCHelper helper = TestUtils.createJDBCHelper();
|
|
40 | 40 |
JDBCSQLBuilderBase sqlbuilder = helper.createSQLBuilder(); |
41 | 41 |
OperationsFactory operations = helper.getOperations(); |
42 | 42 |
|
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.h2spatial/org.gvsig.h2spatial.h2gis132/org.gvsig.h2spatial.h2gis132.provider/src/test/java/org/gvsig/fmap/dal/store/h2/operations/sql/TestDate.java | ||
---|---|---|
59 | 59 |
} |
60 | 60 |
|
61 | 61 |
public void testDate1() throws Exception { |
62 |
JDBCHelper helper = TestUtils.getJDBCHelper();
|
|
62 |
JDBCHelper helper = TestUtils.createJDBCHelper();
|
|
63 | 63 |
JDBCSQLBuilderBase sqlbuilder = helper.createSQLBuilder(); |
64 | 64 |
OperationsFactory operations = helper.getOperations(); |
65 | 65 |
|
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.h2spatial/org.gvsig.h2spatial.h2gis132/org.gvsig.h2spatial.h2gis132.provider/src/test/java/org/gvsig/fmap/dal/store/h2/operations/sql/TestSTDistance.java | ||
---|---|---|
47 | 47 |
} |
48 | 48 |
|
49 | 49 |
public void testSTDistance() throws Exception { |
50 |
JDBCHelper helper = TestUtils.getJDBCHelper();
|
|
50 |
JDBCHelper helper = TestUtils.createJDBCHelper();
|
|
51 | 51 |
JDBCSQLBuilderBase sqlbuilder = helper.createSQLBuilder(); |
52 | 52 |
OperationsFactory operations = helper.getOperations(); |
53 | 53 |
|
Also available in: Unified diff