From 9ccd3318312c8a365fea516eb4ca8a3d042f3386 Mon Sep 17 00:00:00 2001 From: Karel Maesen Date: Sun, 12 Apr 2015 13:29:46 +0200 Subject: [PATCH] HHH-6509 - Using jboss message logger for logging --- .../{Log.java => HSMessageLogger.java} | 17 +- .../HibernateSpatialConfiguration.java | 7 +- .../org/hibernate/spatial/LogFactory.java | 50 ----- .../spatial/dialect/h2geodb/GeoDbWkb.java | 10 +- .../oracle/SDOGeometryValueBinder.java | 9 +- .../spatial/helper/FinderException.java | 42 ---- .../spatial/helper/FinderStrategy.java | 48 ----- .../spatial/helper/PropertyFileReader.java | 80 -------- .../org/hibernate/spatial/helper/package.html | 30 --- .../integration/TestSpatialFunctions.java | 183 +++++++++++------- .../integration/TestSpatialRestrictions.java | 12 +- .../TestStoreRetrieveUsingGeolatte.java | 13 +- .../jts/TestStoreRetrieveUsingJTS.java | 14 +- .../testing/AbstractExpectationsFactory.java | 10 +- .../spatial/testing/DataSourceUtils.java | 10 +- .../testing/SpatialFunctionalTestCase.java | 34 ++-- .../postgis/PostgisExpectationsFactory.java | 10 +- 17 files changed, 210 insertions(+), 369 deletions(-) rename hibernate-spatial/src/main/java/org/hibernate/spatial/{Log.java => HSMessageLogger.java} (67%) delete mode 100644 hibernate-spatial/src/main/java/org/hibernate/spatial/LogFactory.java delete mode 100644 hibernate-spatial/src/main/java/org/hibernate/spatial/helper/FinderException.java delete mode 100644 hibernate-spatial/src/main/java/org/hibernate/spatial/helper/FinderStrategy.java delete mode 100644 hibernate-spatial/src/main/java/org/hibernate/spatial/helper/PropertyFileReader.java delete mode 100644 hibernate-spatial/src/main/java/org/hibernate/spatial/helper/package.html diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/Log.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/HSMessageLogger.java similarity index 67% rename from hibernate-spatial/src/main/java/org/hibernate/spatial/Log.java rename to hibernate-spatial/src/main/java/org/hibernate/spatial/HSMessageLogger.java index d078c94141..76625b87a4 100644 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/Log.java +++ b/hibernate-spatial/src/main/java/org/hibernate/spatial/HSMessageLogger.java @@ -21,15 +21,26 @@ package org.hibernate.spatial; +import org.jboss.logging.BasicLogger; +import org.jboss.logging.annotations.LogMessage; +import org.jboss.logging.annotations.Message; import org.jboss.logging.annotations.MessageLogger; import org.hibernate.internal.CoreMessageLogger; +import static org.jboss.logging.Logger.Level.WARN; + /** * The logger interface for the Hibernate Spatial module. * * @author Karel Maesen, Geovise BVBA */ -@MessageLogger(projectCode = "HS") -public interface Log extends CoreMessageLogger { +@MessageLogger(projectCode = "HHH") +public interface HSMessageLogger extends BasicLogger { + /** + * Message indicating that user attempted to use the deprecated ValidTimeAuditStrategy + */ +// @LogMessage(level = WARN) +// @Message(value = "ValidTimeAuditStrategy is deprecated, please use ValidityAuditStrategy instead", id = 25001) +// void voidvalidTimeAuditStrategyDeprecated(); -} +} \ No newline at end of file diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/HibernateSpatialConfiguration.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/HibernateSpatialConfiguration.java index f5583871ac..bb56c8b592 100644 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/HibernateSpatialConfiguration.java +++ b/hibernate-spatial/src/main/java/org/hibernate/spatial/HibernateSpatialConfiguration.java @@ -4,6 +4,8 @@ import org.geolatte.geom.codec.db.oracle.ConnectionFinder; import java.io.Serializable; +import org.jboss.logging.Logger; + /** * A global configuration object that is is used by * some Dialects during construction. @@ -13,7 +15,10 @@ import java.io.Serializable; */ public class HibernateSpatialConfiguration implements Serializable { - private static final Log LOG = LogFactory.make(); + private static final HSMessageLogger LOG = Logger.getMessageLogger( + HSMessageLogger.class, + HibernateSpatialConfiguration.class.getName() + ); private Boolean isOgcStrict = Boolean.TRUE; private ConnectionFinder connectionFinder; diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/LogFactory.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/LogFactory.java deleted file mode 100644 index 761e0ef856..0000000000 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/LogFactory.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * This file is part of Hibernate Spatial, an extension to the - * hibernate ORM solution for spatial (geographic) data. - * - * Copyright © 2007-2013 Geovise BVBA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.hibernate.spatial; - -import org.jboss.logging.Logger; - -/** - * A static factory for Logs. - * - * The implementation is based on the hibernate-ogm LoggerFactory class. - * - * @author Karel Maesen, Geovise BVBA - * creation-date: 1/14/12 - */ -public class LogFactory { - - private LogFactory(){} - - /** - * Creates a new logger for the class that invokes this method. - * - * @return A new logger for the invoking class. - */ - public static Log make() { - final Throwable t = new Throwable(); - final StackTraceElement directCaller = t.getStackTrace()[1]; - return Logger.getMessageLogger( Log.class, directCaller.getClassName() ); - } - - -} diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/h2geodb/GeoDbWkb.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/h2geodb/GeoDbWkb.java index 407b3a9c0f..225779ab9a 100644 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/h2geodb/GeoDbWkb.java +++ b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/h2geodb/GeoDbWkb.java @@ -41,9 +41,10 @@ import org.geolatte.geom.codec.WkbEncoder; import org.geolatte.geom.crs.CoordinateReferenceSystems; import org.geolatte.geom.jts.JTS; +import org.jboss.logging.Logger; + import org.hibernate.HibernateException; -import org.hibernate.spatial.Log; -import org.hibernate.spatial.LogFactory; +import org.hibernate.spatial.HSMessageLogger; /** * A utility class to serialize from/to GeoDB WKB's. @@ -55,7 +56,10 @@ import org.hibernate.spatial.LogFactory; */ public class GeoDbWkb { - private static final Log LOGGER = LogFactory.make(); + private static final HSMessageLogger LOGGER = Logger.getMessageLogger( + HSMessageLogger.class, + GeoDbWkb.class.getName() + ); private GeoDbWkb() { } diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/SDOGeometryValueBinder.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/SDOGeometryValueBinder.java index f8edd95138..27609053d0 100644 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/SDOGeometryValueBinder.java +++ b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/SDOGeometryValueBinder.java @@ -27,7 +27,6 @@ import org.geolatte.geom.codec.db.oracle.OracleJDBCTypeFactory; import org.geolatte.geom.codec.db.oracle.SDOGeometry; import org.hibernate.HibernateException; -import org.hibernate.spatial.helper.FinderException; import org.hibernate.type.descriptor.ValueBinder; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; @@ -69,7 +68,7 @@ class SDOGeometryValueBinder implements ValueBinder { } } - public Object store(SDOGeometry geom, Connection conn) throws SQLException, FinderException { + public Object store(SDOGeometry geom, Connection conn) throws SQLException { return typeFactory.createStruct( geom, conn ); } @@ -81,12 +80,6 @@ class SDOGeometryValueBinder implements ValueBinder { catch (SQLException e) { throw new HibernateException( "Problem during conversion from JTS to SDOGeometry", e ); } - catch (FinderException e) { - throw new HibernateException( - "OracleConnection could not be retrieved for creating SDOGeometry " + - "STRUCT", e - ); - } catch (IllegalArgumentException e) { //we get here if the type of geometry is unsupported by geolatte encoders throw new HibernateException( e.getMessage() ); diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/helper/FinderException.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/helper/FinderException.java deleted file mode 100644 index 85d7d67e66..0000000000 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/helper/FinderException.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * This file is part of Hibernate Spatial, an extension to the - * hibernate ORM solution for spatial (geographic) data. - * - * Copyright © 2007-2012 Geovise BVBA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -package org.hibernate.spatial.helper; - -/** - * This exception is thrown when Hibernate Spatial fails to find a required - * resource. - * - * @author Karel Maesen, Geovise BVBA - */ -public class FinderException extends Exception { - - private static final long serialVersionUID = 1L; - - /** - * Creates an instance with the specified message - * - * @param msg the error message for this exception - */ - public FinderException(String msg) { - super( msg ); - } - -} diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/helper/FinderStrategy.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/helper/FinderStrategy.java deleted file mode 100644 index 9b70d75241..0000000000 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/helper/FinderStrategy.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * This file is part of Hibernate Spatial, an extension to the - * hibernate ORM solution for spatial (geographic) data. - * - * Copyright © 2007-2012 Geovise BVBA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -package org.hibernate.spatial.helper; - -import java.io.Serializable; - -/** - * A FinderStrategy is used to find a specific feature. It is - * useful in cases where reflection is used to determine some property of a - * class. - * - * @param the return type of the find method - * @param the type of subject - * - * @author Karel Maesen - */ -public interface FinderStrategy extends Serializable { - - /** - * Find a feature or property of a subject - * - * @param subject the object that is being searched - * - * @return the object sought - * - * @throws FinderException thrown when the feature can be found; - */ - public T find(S subject) throws FinderException; - -} diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/helper/PropertyFileReader.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/helper/PropertyFileReader.java deleted file mode 100644 index 0af4f0db3c..0000000000 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/helper/PropertyFileReader.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * This file is part of Hibernate Spatial, an extension to the - * hibernate ORM solution for spatial (geographic) data. - * - * Copyright © 2007-2012 Geovise BVBA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -package org.hibernate.spatial.helper; - -import java.io.IOException; -import java.io.InputStream; -import java.util.Properties; -import java.util.regex.Pattern; - -import org.hibernate.spatial.Log; -import org.hibernate.spatial.LogFactory; - -/** - * Helper class to read settings and properties files. - * - * @author Karel Maesen - */ -public class PropertyFileReader { - - private static final Log LOG = LogFactory.make(); - /** - * pattern for comment lines. If it matches, it is a comment. - */ - private static final Pattern NON_COMMENT_PATTERN = Pattern.compile( "^([^#]+)" ); - - private InputStream is; - - /** - * Constructs an instance from the specified {@code InputStream} - * @param is The inputstream - */ - public PropertyFileReader(InputStream is) { - this.is = is; - } - - /** - * Returns the properties - * @return {@code Properties} - * @throws IOException if an error occurs when reading from the {@code InputStream} - */ - public Properties getProperties() throws IOException { - if ( is == null ) { - return null; - } - final Properties props = new Properties(); - props.load( is ); - return props; - } - - /** - * Closes this instance, and closes the underlying {@code InputStream} - */ - public void close() { - try { - this.is.close(); - } - catch ( IOException e ) { - LOG.warn( "Exception when closing PropertyFileReader: " + e ); - } - } - -} diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/helper/package.html b/hibernate-spatial/src/main/java/org/hibernate/spatial/helper/package.html deleted file mode 100644 index 134d8a78ce..0000000000 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/helper/package.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - -

- This package contains general helper classes. -

- - diff --git a/hibernate-spatial/src/test/java/org/hibernate/spatial/integration/TestSpatialFunctions.java b/hibernate-spatial/src/test/java/org/hibernate/spatial/integration/TestSpatialFunctions.java index 71a636cfaf..d2fd757f61 100644 --- a/hibernate-spatial/src/test/java/org/hibernate/spatial/integration/TestSpatialFunctions.java +++ b/hibernate-spatial/src/test/java/org/hibernate/spatial/integration/TestSpatialFunctions.java @@ -26,18 +26,21 @@ import java.util.HashMap; import java.util.Map; import com.vividsolutions.jts.geom.Geometry; -import org.junit.Test; + +import org.jboss.logging.Logger; import org.hibernate.Query; import org.hibernate.Session; import org.hibernate.Transaction; -import org.hibernate.spatial.Log; -import org.hibernate.spatial.LogFactory; +import org.hibernate.spatial.HSMessageLogger; import org.hibernate.spatial.SpatialFunction; import org.hibernate.spatial.dialect.h2geodb.GeoDBDialect; import org.hibernate.spatial.dialect.oracle.OracleSpatial10gDialect; import org.hibernate.spatial.testing.SpatialDialectMatcher; import org.hibernate.spatial.testing.SpatialFunctionalTestCase; + +import org.junit.Test; + import org.hibernate.testing.Skip; import org.hibernate.testing.SkipForDialect; @@ -49,10 +52,12 @@ import static java.lang.String.format; @Skip(condition = SpatialDialectMatcher.class, message = "No Spatial Dialect") public class TestSpatialFunctions extends SpatialFunctionalTestCase { - private static Log LOG = LogFactory.make(); + private static final HSMessageLogger LOG = Logger.getMessageLogger( + HSMessageLogger.class, + TestSpatialFunctions.class.getName() + ); - - protected Log getLogger() { + protected HSMessageLogger getLogger() { return LOG; } @@ -91,7 +96,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase { } Map dbexpected = expectationsFactory.getAsText(); String hql = format( "SELECT id, astext(geom) from org.hibernate.spatial.integration.%s.GeomEntity", pckg ); - retrieveHQLResultsAndCompare( dbexpected, hql, pckg); + retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); } @Test @@ -227,7 +232,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase { return; } Map dbexpected = expectationsFactory.getEnvelope(); - String hql = format("SELECT id, envelope(geom) from org.hibernate.spatial.integration.%s.GeomEntity", pckg); + String hql = format( "SELECT id, envelope(geom) from org.hibernate.spatial.integration.%s.GeomEntity", pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); } @@ -246,8 +251,10 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase { return; } Map dbexpected = expectationsFactory.getWithin( expectationsFactory.getTestPolygon() ); - String hql = format("SELECT id, within(geom, :filter) from org.hibernate.spatial.integration.%s.GeomEntity " + - "where within(geom, :filter) = true and srid(geom) = 4326", pckg); + String hql = format( + "SELECT id, within(geom, :filter) from org.hibernate.spatial.integration.%s.GeomEntity " + + "where within(geom, :filter) = true and srid(geom) = 4326", pckg + ); Map params = createQueryParams( "filter", expectationsFactory.getTestPolygon() ); retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg ); } @@ -267,8 +274,10 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase { return; } Map dbexpected = expectationsFactory.getEquals( expectationsFactory.getTestPolygon() ); - String hql = format("SELECT id, equals(geom, :filter) from org.hibernate.spatial.integration.%s.GeomEntity " + - "where equals(geom, :filter) = true and srid(geom) = 4326", pckg); + String hql = format( + "SELECT id, equals(geom, :filter) from org.hibernate.spatial.integration.%s.GeomEntity " + + "where equals(geom, :filter) = true and srid(geom) = 4326", pckg + ); Map params = createQueryParams( "filter", expectationsFactory.getTestPolygon() ); retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg ); } @@ -288,8 +297,10 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase { return; } Map dbexpected = expectationsFactory.getCrosses( expectationsFactory.getTestPolygon() ); - String hql = format("SELECT id, crosses(geom, :filter) from org.hibernate.spatial.integration.%s.GeomEntity " + - "where crosses(geom, :filter) = true and srid(geom) = 4326", pckg); + String hql = format( + "SELECT id, crosses(geom, :filter) from org.hibernate.spatial.integration.%s.GeomEntity " + + "where crosses(geom, :filter) = true and srid(geom) = 4326", pckg + ); Map params = createQueryParams( "filter", expectationsFactory.getTestPolygon() ); retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg ); @@ -302,7 +313,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase { @Test public void test_contains_on_geolatte() throws SQLException { - contains( GEOLATTE); + contains( GEOLATTE ); } public void contains(String pckg) throws SQLException { @@ -310,8 +321,10 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase { return; } Map dbexpected = expectationsFactory.getContains( expectationsFactory.getTestPolygon() ); - String hql = format("SELECT id, contains(geom, :filter) from org.hibernate.spatial.integration.%s.GeomEntity " + - "where contains(geom, :filter) = true and srid(geom) = 4326", pckg); + String hql = format( + "SELECT id, contains(geom, :filter) from org.hibernate.spatial.integration.%s.GeomEntity " + + "where contains(geom, :filter) = true and srid(geom) = 4326", pckg + ); Map params = createQueryParams( "filter", expectationsFactory.getTestPolygon() ); retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg ); } @@ -323,7 +336,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase { @Test public void test_disjoint_on_geolatte() throws SQLException { - disjoint( GEOLATTE); + disjoint( GEOLATTE ); } public void disjoint(String pckg) throws SQLException { @@ -331,8 +344,10 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase { return; } Map dbexpected = expectationsFactory.getDisjoint( expectationsFactory.getTestPolygon() ); - String hql = format("SELECT id, disjoint(geom, :filter) from org.hibernate.spatial.integration.%s.GeomEntity " + - "where disjoint(geom, :filter) = true and srid(geom) = 4326", pckg); + String hql = format( + "SELECT id, disjoint(geom, :filter) from org.hibernate.spatial.integration.%s.GeomEntity " + + "where disjoint(geom, :filter) = true and srid(geom) = 4326", pckg + ); Map params = createQueryParams( "filter", expectationsFactory.getTestPolygon() ); retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg ); } @@ -344,7 +359,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase { @Test public void test_intersects_on_geolatte() throws SQLException { - intersects( GEOLATTE); + intersects( GEOLATTE ); } public void intersects(String pckg) throws SQLException { @@ -352,8 +367,10 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase { return; } Map dbexpected = expectationsFactory.getIntersects( expectationsFactory.getTestPolygon() ); - String hql = format("SELECT id, intersects(geom, :filter) from org.hibernate.spatial.integration.%s.GeomEntity " + - "where intersects(geom, :filter) = true and srid(geom) = 4326", pckg); + String hql = format( + "SELECT id, intersects(geom, :filter) from org.hibernate.spatial.integration.%s.GeomEntity " + + "where intersects(geom, :filter) = true and srid(geom) = 4326", pckg + ); Map params = createQueryParams( "filter", expectationsFactory.getTestPolygon() ); retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg ); } @@ -365,7 +382,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase { @Test public void test_overlaps_on_geolatte() throws SQLException { - overlaps( GEOLATTE); + overlaps( GEOLATTE ); } public void overlaps(String pckg) throws SQLException { @@ -373,8 +390,10 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase { return; } Map dbexpected = expectationsFactory.getOverlaps( expectationsFactory.getTestPolygon() ); - String hql = format("SELECT id, overlaps(geom, :filter) from org.hibernate.spatial.integration.%s.GeomEntity " + - "where overlaps(geom, :filter) = true and srid(geom) = 4326", pckg); + String hql = format( + "SELECT id, overlaps(geom, :filter) from org.hibernate.spatial.integration.%s.GeomEntity " + + "where overlaps(geom, :filter) = true and srid(geom) = 4326", pckg + ); Map params = createQueryParams( "filter", expectationsFactory.getTestPolygon() ); retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg ); } @@ -386,15 +405,17 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase { @Test public void test_touches_on_geolatte() throws SQLException { - touches( GEOLATTE); + touches( GEOLATTE ); } public void touches(String pckg) throws SQLException { if ( !isSupportedByDialect( SpatialFunction.touches ) ) { return; } - String hql = format("SELECT id, touches(geom, :filter) from org.hibernate.spatial.integration.%s.GeomEntity " + - "where touches(geom, :filter) = true and srid(geom) = 4326", pckg); + String hql = format( + "SELECT id, touches(geom, :filter) from org.hibernate.spatial.integration.%s.GeomEntity " + + "where touches(geom, :filter) = true and srid(geom) = 4326", pckg + ); Map dbexpected = expectationsFactory.getTouches( expectationsFactory.getTestPolygon() ); Map params = createQueryParams( "filter", expectationsFactory.getTestPolygon() ); retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg ); @@ -407,7 +428,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase { @Test public void test_relate_on_geolatte() throws SQLException { - relate( GEOLATTE); + relate( GEOLATTE ); } public void relate(String pckg) throws SQLException { @@ -419,8 +440,10 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase { expectationsFactory.getTestPolygon(), matrix ); - String hql = format("SELECT id, relate(geom, :filter, :matrix) from org.hibernate.spatial.integration.%s.GeomEntity " + - "where relate(geom, :filter, :matrix) = true and srid(geom) = 4326", pckg); + String hql = format( + "SELECT id, relate(geom, :filter, :matrix) from org.hibernate.spatial.integration.%s.GeomEntity " + + "where relate(geom, :filter, :matrix) = true and srid(geom) = 4326", pckg + ); Map params = createQueryParams( "filter", expectationsFactory.getTestPolygon() ); params.put( "matrix", matrix ); retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg ); @@ -439,7 +462,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase { @Test public void test_distance_on_geolatte() throws SQLException { - distance( GEOLATTE); + distance( GEOLATTE ); } public void distance(String pckg) throws SQLException { @@ -447,8 +470,10 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase { return; } Map dbexpected = expectationsFactory.getDistance( expectationsFactory.getTestPolygon() ); - String hql = format("SELECT id, distance(geom, :filter) from org.hibernate.spatial.integration.%s.GeomEntity " + - "where srid(geom) = 4326", pckg); + String hql = format( + "SELECT id, distance(geom, :filter) from org.hibernate.spatial.integration.%s.GeomEntity " + + "where srid(geom) = 4326", pckg + ); Map params = createQueryParams( "filter", expectationsFactory.getTestPolygon() ); retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg ); } @@ -460,7 +485,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase { @Test public void test_buffer_on_geolatte() throws SQLException { - buffer( GEOLATTE); + buffer( GEOLATTE ); } public void buffer(String pckg) throws SQLException { @@ -468,8 +493,10 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase { return; } Map dbexpected = expectationsFactory.getBuffer( Double.valueOf( 1.0 ) ); - String hql = format("SELECT id, buffer(geom, :distance) from org.hibernate.spatial.integration.%s.GeomEntity " + - "where srid(geom) = 4326", pckg); + String hql = format( + "SELECT id, buffer(geom, :distance) from org.hibernate.spatial.integration.%s.GeomEntity " + + "where srid(geom) = 4326", pckg + ); Map params = createQueryParams( "distance", Double.valueOf( 1.0 ) ); retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg ); @@ -482,7 +509,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase { @Test public void test_convexhull_on_geolatte() throws SQLException { - convexhull( GEOLATTE); + convexhull( GEOLATTE ); } public void convexhull(String pckg) throws SQLException { @@ -490,21 +517,25 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase { return; } Map dbexpected = expectationsFactory.getConvexHull( expectationsFactory.getTestPolygon() ); - String hql = format("SELECT id, convexhull(geomunion(geom, :polygon)) from org.hibernate.spatial.integration" + - ".%s.GeomEntity where srid(geom) = 4326", pckg); + String hql = format( + "SELECT id, convexhull(geomunion(geom, :polygon)) from org.hibernate.spatial.integration" + + ".%s.GeomEntity where srid(geom) = 4326", pckg + ); Map params = createQueryParams( "polygon", expectationsFactory.getTestPolygon() ); retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg ); } - @Test @SkipForDialect( value = GeoDBDialect.class) - public void test_intersection_on_jts()throws SQLException { + @Test + @SkipForDialect(value = GeoDBDialect.class) + public void test_intersection_on_jts() throws SQLException { intersection( JTS ); } - @Test @SkipForDialect( value = GeoDBDialect.class) - public void test_intersection_on_geolatte()throws SQLException { - intersection( GEOLATTE); + @Test + @SkipForDialect(value = GeoDBDialect.class) + public void test_intersection_on_geolatte() throws SQLException { + intersection( GEOLATTE ); } //skipped for GeoDBDialect because GeoDB throws exceptions in case the intersection is empty. @@ -514,8 +545,10 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase { return; } Map dbexpected = expectationsFactory.getIntersection( expectationsFactory.getTestPolygon() ); - String hql = format("SELECT id, intersection(geom, :polygon) from org.hibernate.spatial.integration.%s.GeomEntity " + - "where srid(geom) = 4326", pckg); + String hql = format( + "SELECT id, intersection(geom, :polygon) from org.hibernate.spatial.integration.%s.GeomEntity " + + "where srid(geom) = 4326", pckg + ); Map params = createQueryParams( "polygon", expectationsFactory.getTestPolygon() ); retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg ); } @@ -527,7 +560,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase { @Test public void test_difference_on_geolatte() throws SQLException { - difference( GEOLATTE); + difference( GEOLATTE ); } public void difference(String pckg) throws SQLException { @@ -535,8 +568,10 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase { return; } Map dbexpected = expectationsFactory.getDifference( expectationsFactory.getTestPolygon() ); - String hql = format("SELECT id, difference(geom, :polygon) from org.hibernate.spatial.integration.%s.GeomEntity " + - "where srid(geom) = 4326", pckg); + String hql = format( + "SELECT id, difference(geom, :polygon) from org.hibernate.spatial.integration.%s.GeomEntity " + + "where srid(geom) = 4326", pckg + ); Map params = createQueryParams( "polygon", expectationsFactory.getTestPolygon() ); retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg ); } @@ -548,7 +583,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase { @Test public void test_symdifference_on_geolatte() throws SQLException { - symdifference( GEOLATTE); + symdifference( GEOLATTE ); } public void symdifference(String pckg) throws SQLException { @@ -556,8 +591,10 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase { return; } Map dbexpected = expectationsFactory.getSymDifference( expectationsFactory.getTestPolygon() ); - String hql = format("SELECT id, symdifference(geom, :polygon) from " + - "org.hibernate.spatial.integration.%s.GeomEntity where srid(geom) = 4326", pckg); + String hql = format( + "SELECT id, symdifference(geom, :polygon) from " + + "org.hibernate.spatial.integration.%s.GeomEntity where srid(geom) = 4326", pckg + ); Map params = createQueryParams( "polygon", expectationsFactory.getTestPolygon() ); retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg ); } @@ -569,7 +606,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase { @Test public void test_geomunion_on_geolatte() throws SQLException { - geomunion( GEOLATTE); + geomunion( GEOLATTE ); } public void geomunion(String pckg) throws SQLException { @@ -577,10 +614,12 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase { return; } Map dbexpected = expectationsFactory.getGeomUnion( expectationsFactory.getTestPolygon() ); - String hql = format("SELECT id, geomunion(geom, :polygon) from org.hibernate.spatial.integration.%s.GeomEntity " + - "where srid(geom) = 4326", pckg); + String hql = format( + "SELECT id, geomunion(geom, :polygon) from org.hibernate.spatial.integration.%s.GeomEntity " + + "where srid(geom) = 4326", pckg + ); Map params = createQueryParams( "polygon", expectationsFactory.getTestPolygon() ); - retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg); + retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg ); } @Test @@ -590,7 +629,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase { @Test public void test_dwithin_on_geolatte() throws SQLException { - dwithin( GEOLATTE); + dwithin( GEOLATTE ); } public void dwithin(String pckg) throws SQLException { @@ -602,9 +641,11 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase { expectationsFactory.getTestPoint(), distance ); - String hql = format("SELECT id, dwithin(geom, :filter, :distance) from " + - "org.hibernate.spatial.integration.%s.GeomEntity where dwithin(geom, :filter, :distance) = true " + - "and srid(geom) = 4326", pckg); + String hql = format( + "SELECT id, dwithin(geom, :filter, :distance) from " + + "org.hibernate.spatial.integration.%s.GeomEntity where dwithin(geom, :filter, :distance) = true " + + "and srid(geom) = 4326", pckg + ); Map params = createQueryParams( "filter", expectationsFactory.getTestPoint() ); if ( getDialect() instanceof OracleSpatial10gDialect ) { //because this uses the weird syntax and conventions of SDO_WITHIN_DISTANCE which returns a string (really) @@ -625,7 +666,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase { @Test public void test_transform_on_geolatte() throws SQLException { - transform( GEOLATTE); + transform( GEOLATTE ); } public void transform(String pckg) throws SQLException { @@ -634,18 +675,24 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase { } int epsg = 4324; Map dbexpected = expectationsFactory.getTransform( epsg ); - String hql = format("SELECT id, transform(geom, :epsg) from org.hibernate.spatial.integration.%s.GeomEntity " + - "where srid(geom) = 4326", pckg); + String hql = format( + "SELECT id, transform(geom, :epsg) from org.hibernate.spatial.integration.%s.GeomEntity " + + "where srid(geom) = 4326", pckg + ); Map params = createQueryParams( "epsg", Integer.valueOf( epsg ) ); retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg ); } public void retrieveHQLResultsAndCompare(Map dbexpected, String hql, String geometryType) { - retrieveHQLResultsAndCompare( dbexpected, hql, null, geometryType); + retrieveHQLResultsAndCompare( dbexpected, hql, null, geometryType ); } - protected void retrieveHQLResultsAndCompare(Map dbexpected, String hql, Map params, String geometryType) { + protected void retrieveHQLResultsAndCompare( + Map dbexpected, + String hql, + Map params, + String geometryType) { Map hsreceived = new HashMap(); doInSession( hql, hsreceived, params ); compare( dbexpected, hsreceived, geometryType ); @@ -681,7 +728,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase { if ( params == null ) { return; } - for ( Map.Entry entry: params.entrySet() ) { + for ( Map.Entry entry : params.entrySet() ) { query.setParameter( entry.getKey(), entry.getValue() ); } } diff --git a/hibernate-spatial/src/test/java/org/hibernate/spatial/integration/TestSpatialRestrictions.java b/hibernate-spatial/src/test/java/org/hibernate/spatial/integration/TestSpatialRestrictions.java index cda2ffc03f..9000f7ee7e 100644 --- a/hibernate-spatial/src/test/java/org/hibernate/spatial/integration/TestSpatialRestrictions.java +++ b/hibernate-spatial/src/test/java/org/hibernate/spatial/integration/TestSpatialRestrictions.java @@ -25,14 +25,15 @@ import java.sql.SQLException; import java.util.List; import java.util.Map; +import org.jboss.logging.Logger; + import org.junit.Test; import org.hibernate.Criteria; import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.criterion.Criterion; -import org.hibernate.spatial.Log; -import org.hibernate.spatial.LogFactory; +import org.hibernate.spatial.HSMessageLogger; import org.hibernate.spatial.SpatialFunction; import org.hibernate.spatial.criterion.SpatialRestrictions; import org.hibernate.spatial.integration.jts.GeomEntity; @@ -46,9 +47,12 @@ import static org.junit.Assert.fail; @Skip(condition = SpatialDialectMatcher.class, message = "No Spatial Dialect") public class TestSpatialRestrictions extends SpatialFunctionalTestCase { - private static Log LOG = LogFactory.make(); + private static HSMessageLogger LOG = Logger.getMessageLogger( + HSMessageLogger.class, + TestSpatialRestrictions.class.getName() + ); - protected Log getLogger() { + protected HSMessageLogger getLogger() { return LOG; } diff --git a/hibernate-spatial/src/test/java/org/hibernate/spatial/integration/geolatte/TestStoreRetrieveUsingGeolatte.java b/hibernate-spatial/src/test/java/org/hibernate/spatial/integration/geolatte/TestStoreRetrieveUsingGeolatte.java index 4378fe490c..658004ce19 100644 --- a/hibernate-spatial/src/test/java/org/hibernate/spatial/integration/geolatte/TestStoreRetrieveUsingGeolatte.java +++ b/hibernate-spatial/src/test/java/org/hibernate/spatial/integration/geolatte/TestStoreRetrieveUsingGeolatte.java @@ -9,13 +9,15 @@ import org.geolatte.geom.Geometry; import org.geolatte.geom.GeometryEquality; import org.geolatte.geom.GeometryPointEquality; import org.geolatte.geom.codec.WktDecodeException; + +import org.jboss.logging.Logger; + import org.junit.Test; import org.hibernate.Criteria; import org.hibernate.Session; import org.hibernate.Transaction; -import org.hibernate.spatial.Log; -import org.hibernate.spatial.LogFactory; +import org.hibernate.spatial.HSMessageLogger; import org.hibernate.spatial.testing.SpatialDialectMatcher; import org.hibernate.spatial.testing.SpatialFunctionalTestCase; import org.hibernate.spatial.testing.TestDataElement; @@ -32,9 +34,12 @@ import static org.junit.Assert.assertTrue; @Skip(condition = SpatialDialectMatcher.class, message = "No Spatial Dialect") public class TestStoreRetrieveUsingGeolatte extends SpatialFunctionalTestCase { - private static Log LOG = LogFactory.make(); + private static HSMessageLogger LOG = Logger.getMessageLogger( + HSMessageLogger.class, + TestStoreRetrieveUsingGeolatte.class.getName() + ); - protected Log getLogger() { + protected HSMessageLogger getLogger() { return LOG; } diff --git a/hibernate-spatial/src/test/java/org/hibernate/spatial/integration/jts/TestStoreRetrieveUsingJTS.java b/hibernate-spatial/src/test/java/org/hibernate/spatial/integration/jts/TestStoreRetrieveUsingJTS.java index daf1d9e5a1..c1214677e5 100644 --- a/hibernate-spatial/src/test/java/org/hibernate/spatial/integration/jts/TestStoreRetrieveUsingJTS.java +++ b/hibernate-spatial/src/test/java/org/hibernate/spatial/integration/jts/TestStoreRetrieveUsingJTS.java @@ -6,13 +6,15 @@ import java.util.Map; import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.io.ParseException; + +import org.jboss.logging.Logger; + import org.junit.Test; import org.hibernate.Criteria; import org.hibernate.Session; import org.hibernate.Transaction; -import org.hibernate.spatial.Log; -import org.hibernate.spatial.LogFactory; +import org.hibernate.spatial.HSMessageLogger; import org.hibernate.spatial.testing.SpatialDialectMatcher; import org.hibernate.spatial.testing.SpatialFunctionalTestCase; import org.hibernate.spatial.testing.TestDataElement; @@ -29,9 +31,13 @@ import static org.junit.Assert.assertTrue; @Skip(condition = SpatialDialectMatcher.class, message = "No Spatial Dialect") public class TestStoreRetrieveUsingJTS extends SpatialFunctionalTestCase { - private static Log LOG = LogFactory.make(); + private static final HSMessageLogger LOG = Logger.getMessageLogger( + HSMessageLogger.class, + TestStoreRetrieveUsingJTS.class.getName() + ); - protected Log getLogger() { + + protected HSMessageLogger getLogger() { return LOG; } diff --git a/hibernate-spatial/src/test/java/org/hibernate/spatial/testing/AbstractExpectationsFactory.java b/hibernate-spatial/src/test/java/org/hibernate/spatial/testing/AbstractExpectationsFactory.java index 2521913800..57464e0371 100644 --- a/hibernate-spatial/src/test/java/org/hibernate/spatial/testing/AbstractExpectationsFactory.java +++ b/hibernate-spatial/src/test/java/org/hibernate/spatial/testing/AbstractExpectationsFactory.java @@ -35,8 +35,9 @@ import com.vividsolutions.jts.geom.Polygon; import com.vividsolutions.jts.io.ParseException; import com.vividsolutions.jts.io.WKTReader; -import org.hibernate.spatial.Log; -import org.hibernate.spatial.LogFactory; +import org.jboss.logging.Logger; + +import org.hibernate.spatial.HSMessageLogger; /** * An AbstractExpectationsFactory provides the expected @@ -49,7 +50,10 @@ import org.hibernate.spatial.LogFactory; */ public abstract class AbstractExpectationsFactory { - private static final Log LOG = LogFactory.make(); + private static final HSMessageLogger LOG = Logger.getMessageLogger( + HSMessageLogger.class, + AbstractExpectationsFactory.class.getName() + ); public final static String TEST_POLYGON_WKT = "POLYGON((0 0, 50 0, 100 100, 0 100, 0 0))"; public final static String TEST_POINT_WKT = "POINT(0 0)"; diff --git a/hibernate-spatial/src/test/java/org/hibernate/spatial/testing/DataSourceUtils.java b/hibernate-spatial/src/test/java/org/hibernate/spatial/testing/DataSourceUtils.java index 9aa2690c91..8ef02c4d24 100644 --- a/hibernate-spatial/src/test/java/org/hibernate/spatial/testing/DataSourceUtils.java +++ b/hibernate-spatial/src/test/java/org/hibernate/spatial/testing/DataSourceUtils.java @@ -44,8 +44,9 @@ import org.geolatte.geom.codec.Wkt; import org.geolatte.geom.codec.WktDecodeException; import org.geolatte.geom.codec.WktDecoder; -import org.hibernate.spatial.Log; -import org.hibernate.spatial.LogFactory; +import org.jboss.logging.Logger; + +import org.hibernate.spatial.HSMessageLogger; /** *

Unit testsuite-suite support class.

@@ -55,7 +56,10 @@ import org.hibernate.spatial.LogFactory; public class DataSourceUtils { - private static Log LOG = LogFactory.make(); + private static HSMessageLogger LOG = Logger.getMessageLogger( + HSMessageLogger.class, + DataSourceUtils.class.getName() + ); private final SQLExpressionTemplate sqlExpressionTemplate; diff --git a/hibernate-spatial/src/test/java/org/hibernate/spatial/testing/SpatialFunctionalTestCase.java b/hibernate-spatial/src/test/java/org/hibernate/spatial/testing/SpatialFunctionalTestCase.java index 4fe08202d3..6e3983f059 100644 --- a/hibernate-spatial/src/test/java/org/hibernate/spatial/testing/SpatialFunctionalTestCase.java +++ b/hibernate-spatial/src/test/java/org/hibernate/spatial/testing/SpatialFunctionalTestCase.java @@ -21,25 +21,29 @@ package org.hibernate.spatial.testing; -import com.vividsolutions.jts.geom.Geometry; -import org.hibernate.Query; -import org.hibernate.Session; -import org.hibernate.Transaction; -import org.hibernate.boot.registry.internal.StandardServiceRegistryImpl; -import org.hibernate.cfg.Configuration; -import org.hibernate.service.ServiceRegistry; -import org.hibernate.spatial.Log; -import org.hibernate.spatial.SpatialDialect; -import org.hibernate.spatial.SpatialFunction; -import org.hibernate.testing.AfterClassOnce; -import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; - import java.sql.BatchUpdateException; import java.sql.SQLException; import java.util.List; import java.util.Map; -import static org.junit.Assert.*; +import com.vividsolutions.jts.geom.Geometry; + +import org.hibernate.Query; +import org.hibernate.Session; +import org.hibernate.Transaction; +import org.hibernate.cfg.Configuration; +import org.hibernate.service.ServiceRegistry; +import org.hibernate.spatial.HSMessageLogger; +import org.hibernate.spatial.SpatialDialect; +import org.hibernate.spatial.SpatialFunction; + +import org.hibernate.testing.AfterClassOnce; +import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; + +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; /** * @author Karel Maesen, Geovise BVBA @@ -182,7 +186,7 @@ public abstract class SpatialFunctionalTestCase extends BaseCoreFunctionalTestCa return dialect.supportsFiltering(); } - abstract protected Log getLogger(); + abstract protected HSMessageLogger getLogger(); /** * Adds the query results to a Map. diff --git a/hibernate-spatial/src/test/java/org/hibernate/spatial/testing/dialects/postgis/PostgisExpectationsFactory.java b/hibernate-spatial/src/test/java/org/hibernate/spatial/testing/dialects/postgis/PostgisExpectationsFactory.java index 4033578d7e..98bc79f783 100644 --- a/hibernate-spatial/src/test/java/org/hibernate/spatial/testing/dialects/postgis/PostgisExpectationsFactory.java +++ b/hibernate-spatial/src/test/java/org/hibernate/spatial/testing/dialects/postgis/PostgisExpectationsFactory.java @@ -29,8 +29,9 @@ import org.geolatte.geom.codec.WkbDecoder; import org.geolatte.geom.jts.JTS; import org.postgresql.util.PGobject; -import org.hibernate.spatial.Log; -import org.hibernate.spatial.LogFactory; +import org.jboss.logging.Logger; + +import org.hibernate.spatial.HSMessageLogger; import org.hibernate.spatial.testing.AbstractExpectationsFactory; import org.hibernate.spatial.testing.DataSourceUtils; import org.hibernate.spatial.testing.NativeSQLStatement; @@ -42,7 +43,10 @@ import org.hibernate.spatial.testing.NativeSQLStatement; */ public class PostgisExpectationsFactory extends AbstractExpectationsFactory { - private static final Log LOG = LogFactory.make(); + private static final HSMessageLogger LOG = Logger.getMessageLogger( + HSMessageLogger.class, + PostgisExpectationsFactory.class.getName() + ); public PostgisExpectationsFactory(DataSourceUtils utils) {