01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2003-2006, Geotools Project Managment Committee (PMC)
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * version 2.1 of the License, or (at your option) any later version.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: * Created on 20/10/2003
17: */
18: package org.geotools.data.jdbc;
19:
20: import java.io.IOException;
21:
22: import javax.sql.DataSource;
23:
24: import org.geotools.data.AttributeReader;
25: import org.geotools.data.AttributeWriter;
26: import org.geotools.data.DataSourceException;
27: import org.geotools.data.jdbc.attributeio.AttributeIO;
28: import org.geotools.data.jdbc.fidmapper.BasicFIDMapper;
29: import org.geotools.data.jdbc.fidmapper.TypedFIDMapper;
30: import org.geotools.feature.AttributeType;
31:
32: /** Provides a Mock JDBC DataStore for testing the abstract DataStore implementation.
33: *
34: * @author Sean Geoghegan, Defence Science and Technology Organisation.
35: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/jdbc/src/test/java/org/geotools/data/jdbc/MockJDBCDataStore.java $
36: */
37: public class MockJDBCDataStore extends JDBCDataStore {
38:
39: /**
40: * @param connectionPool
41: * @throws DataSourceException
42: */
43: public MockJDBCDataStore(DataSource dataSource) throws IOException {
44: super (dataSource, new JDBCDataStoreConfig(
45: "www.refractions.net", "test", 10000));
46: typeHandler.setFIDMapper("FEATURE_TYPE1", new TypedFIDMapper(
47: new BasicFIDMapper("ID", 255), "FEATURE_TYPE1"));
48: typeHandler.setFIDMapper("FEATURE_TYPE2", new TypedFIDMapper(
49: new BasicFIDMapper("ID", 255), "FEATURE_TYPE2"));
50: }
51:
52: /* (non-Javadoc)
53: * @see org.geotools.data.jdbc.JDBCDataStore#createGeometryReader(org.geotools.feature.AttributeType, org.geotools.data.jdbc.JDBCDataStore.QueryData, int)
54: */
55: protected AttributeReader createGeometryReader(
56: AttributeType attrType, QueryData queryData, int index)
57: throws DataSourceException {
58: return null;
59: }
60:
61: /* (non-Javadoc)
62: * @see org.geotools.data.jdbc.JDBCDataStore#createGeometryWriter(org.geotools.feature.AttributeType, org.geotools.data.jdbc.JDBCDataStore.QueryData, int)
63: */
64: protected AttributeWriter createGeometryWriter(
65: AttributeType attrType, QueryData queryData, int index)
66: throws DataSourceException {
67: return null;
68: }
69:
70: /**
71: * @see org.geotools.data.jdbc.JDBCDataStore#getGeometryAttributeIO(org.geotools.feature.AttributeType)
72: */
73: protected AttributeIO getGeometryAttributeIO(AttributeType type,
74: QueryData queryData) {
75: return null;
76: }
77: }
|