root / trunk / libraries / geotools-2.1.1-epsg-hsql / test / org / geotools / referencing / factory / epsg / HSQLDataSourceTest.java @ 28854
History | View | Annotate | Download (2.87 KB)
1 |
/*
|
---|---|
2 |
* Geotools 2 - OpenSource mapping toolkit
|
3 |
* (C) 2005, Geotools Project Management Committee (PMC)
|
4 |
*
|
5 |
* This library is free software; you can redistribute it and/or
|
6 |
* modify it under the terms of the GNU Lesser General Public
|
7 |
* License as published by the Free Software Foundation; either
|
8 |
* version 2.1 of the License, or (at your option) any later version.
|
9 |
*
|
10 |
* This library is distributed in the hope that it will be useful,
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13 |
* Lesser General Public License for more details.
|
14 |
*
|
15 |
* You should have received a copy of the GNU Lesser General Public
|
16 |
* License along with this library; if not, write to the Free Software
|
17 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
18 |
*/
|
19 |
package org.geotools.referencing.factory.epsg; |
20 |
|
21 |
// J2SE dependencies
|
22 |
import java.util.logging.Level; |
23 |
import java.sql.SQLException; |
24 |
|
25 |
// JUnit dependencies
|
26 |
import junit.framework.Test; |
27 |
import junit.framework.TestSuite; |
28 |
|
29 |
// Geotools dependencies
|
30 |
import org.geotools.util.MonolineFormatter; |
31 |
import org.geotools.resources.Arguments; |
32 |
|
33 |
|
34 |
|
35 |
/**
|
36 |
* Tests transformations from CRS and/or operations created from the EPSG factory, using HSQL
|
37 |
* plugin. This class performs exactly the same tests than {@link DefaultDataSourceTest}, but
|
38 |
* on the HSQL plugin instead of the default (MS-Access if available) one.
|
39 |
*
|
40 |
* @version $Id: HSQLDataSourceTest.java 14624 2005-06-29 02:19:08Z desruisseaux $
|
41 |
* @author Martin Desruisseaux
|
42 |
* @author Vadim Semenov
|
43 |
*/
|
44 |
public class HSQLDataSourceTest extends DefaultDataSourceTest { |
45 |
/**
|
46 |
* Run the suite from the command line. If {@code "-log"} flag is specified on the
|
47 |
* command-line, then the logger will be set to {@link Level#CONFIG}. This is usefull
|
48 |
* for tracking down which data source is actually used.
|
49 |
*/
|
50 |
public static void main(final String[] args) { |
51 |
final Arguments arguments = new Arguments(args); |
52 |
final boolean log = arguments.getFlag("-log"); |
53 |
arguments.getRemainingArguments(0);
|
54 |
MonolineFormatter.initGeotools(log ? Level.CONFIG : null); |
55 |
junit.textui.TestRunner.run(suite()); |
56 |
} |
57 |
|
58 |
/**
|
59 |
* Returns the test suite.
|
60 |
*/
|
61 |
public static Test suite() { |
62 |
return new TestSuite(HSQLDataSourceTest.class); |
63 |
} |
64 |
|
65 |
/**
|
66 |
* Constructs a test case with the given name.
|
67 |
*/
|
68 |
public HSQLDataSourceTest(final String name) { |
69 |
super(name);
|
70 |
} |
71 |
|
72 |
/**
|
73 |
* Sets up the authority factory. This setup process does not rely on FactoryFinder.
|
74 |
* We rely want to test the HSQL implementation, not an arbitrary implementation.
|
75 |
*/
|
76 |
protected void setUp() throws SQLException { |
77 |
// Do not call super.setUp()
|
78 |
factory = new DefaultFactory();
|
79 |
factory.setDataSource(new HSQLDataSource());
|
80 |
} |
81 |
} |