HHH-6511 Refactors spatial integration tests.

Spatial integration tests are now more in line with the Hibernate Core
integration tests.
This commit is contained in:
Karel Maesen 2012-01-14 16:13:19 +01:00 committed by Steve Ebersole
parent f114ca2944
commit 50a648ed32
43 changed files with 384 additions and 483 deletions

View File

@ -27,11 +27,13 @@ package org.hibernate.spatial.integration;
import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.io.ParseException;
import org.hibernate.spatial.testing.EWKTReader;
import org.hibernate.spatial.testing.TestDataElement;
/**
* Test class used in unit testing.
*/
public class GeomEntity implements TestFeature {
public class GeomEntity {
private Integer id;

View File

@ -1,22 +0,0 @@
package org.hibernate.spatial.integration;
import com.vividsolutions.jts.geom.Geometry;
/**
* Interface for persistent entities in
* integration tests.
*
* @author Karel Maesen, Geovise BVBA
* creation-date: Oct 2, 2010
*/
public interface TestFeature {
public Integer getId();
public void setId(Integer id);
public Geometry getGeom();
public void setGeom(Geometry geom);
}

View File

@ -29,8 +29,9 @@ import com.vividsolutions.jts.geom.Geometry;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.spatial.SpatialDialect;
import org.hibernate.spatial.SpatialFunction;
import org.hibernate.spatial.testing.SpatialDialectMatcher;
import org.hibernate.spatial.testing.SpatialFunctionalTestCase;
import org.hibernate.testing.Skip;
import org.junit.Test;
import org.slf4j.Logger;
@ -48,49 +49,11 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
private static Logger LOGGER = LoggerFactory.getLogger( TestSpatialFunctions.class );
public void prepareTest() {
super.prepareTest();
insertTestData();
}
protected Logger getLogger() {
return LOGGER;
}
@Test
public void testSpatialFunctions() throws Exception {
if (! (getDialect() instanceof SpatialDialect)) return;
dimension();
astext();
asbinary();
geometrytype();
srid();
issimple();
isempty();
boundary();
envelope();
within();
equals();
crosses();
contains();
disjoint();
intersects();
overlaps();
touches();
relate();
distance();
buffer();
convexhull();
intersection();
difference();
symdifference();
geomunion();
dwithin();
transform();
}
@Test
public void dimension() throws SQLException {
if ( !isSupportedByDialect( SpatialFunction.dimension ) ) {
return;
@ -100,6 +63,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
retrieveHQLResultsAndCompare( dbexpected, hql );
}
@Test
public void astext() throws SQLException {
if ( !isSupportedByDialect( SpatialFunction.astext ) ) {
return;
@ -109,6 +73,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
retrieveHQLResultsAndCompare( dbexpected, hql );
}
@Test
public void asbinary() throws SQLException {
if ( !isSupportedByDialect( SpatialFunction.asbinary ) ) {
return;
@ -118,7 +83,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
retrieveHQLResultsAndCompare( dbexpected, hql );
}
@Test
public void geometrytype() throws SQLException {
if ( !isSupportedByDialect( SpatialFunction.geometrytype ) ) {
return;
@ -128,6 +93,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
retrieveHQLResultsAndCompare( dbexpected, hql );
}
@Test
public void srid() throws SQLException {
if ( !isSupportedByDialect( SpatialFunction.srid ) ) {
return;
@ -137,6 +103,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
retrieveHQLResultsAndCompare( dbexpected, hql );
}
@Test
public void issimple() throws SQLException {
if ( !isSupportedByDialect( SpatialFunction.issimple ) ) {
return;
@ -146,6 +113,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
retrieveHQLResultsAndCompare( dbexpected, hql );
}
@Test
public void isempty() throws SQLException {
if ( !isSupportedByDialect( SpatialFunction.isempty ) ) {
return;
@ -155,7 +123,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
retrieveHQLResultsAndCompare( dbexpected, hql );
}
@Test
public void boundary() throws SQLException {
if ( !isSupportedByDialect( SpatialFunction.boundary ) ) {
return;
@ -165,7 +133,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
retrieveHQLResultsAndCompare( dbexpected, hql );
}
@Test
public void envelope() throws SQLException {
if ( !isSupportedByDialect( SpatialFunction.envelope ) ) {
return;
@ -175,6 +143,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
retrieveHQLResultsAndCompare( dbexpected, hql );
}
@Test
public void within() throws SQLException {
if ( !isSupportedByDialect( SpatialFunction.within ) ) {
return;
@ -185,6 +154,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
retrieveHQLResultsAndCompare( dbexpected, hql, params );
}
@Test
public void equals() throws SQLException {
if ( !isSupportedByDialect( SpatialFunction.equals ) ) {
return;
@ -195,6 +165,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
retrieveHQLResultsAndCompare( dbexpected, hql, params );
}
@Test
public void crosses() throws SQLException {
if ( !isSupportedByDialect( SpatialFunction.crosses ) ) {
return;
@ -206,6 +177,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
}
@Test
public void contains() throws SQLException {
if ( !isSupportedByDialect( SpatialFunction.contains ) ) {
return;
@ -217,6 +189,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
}
@Test
public void disjoint() throws SQLException {
if ( !isSupportedByDialect( SpatialFunction.disjoint ) ) {
return;
@ -227,6 +200,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
retrieveHQLResultsAndCompare( dbexpected, hql, params );
}
@Test
public void intersects() throws SQLException {
if ( !isSupportedByDialect( SpatialFunction.intersects ) ) {
return;
@ -237,6 +211,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
retrieveHQLResultsAndCompare( dbexpected, hql, params );
}
@Test
public void overlaps() throws SQLException {
if ( !isSupportedByDialect( SpatialFunction.overlaps ) ) {
return;
@ -247,6 +222,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
retrieveHQLResultsAndCompare( dbexpected, hql, params );
}
@Test
public void touches() throws SQLException {
if ( !isSupportedByDialect( SpatialFunction.touches ) ) {
return;
@ -257,6 +233,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
retrieveHQLResultsAndCompare( dbexpected, hql, params );
}
@Test
public void relate() throws SQLException {
if ( !isSupportedByDialect( SpatialFunction.relate ) ) {
return;
@ -278,6 +255,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
}
@Test
public void distance() throws SQLException {
if ( !isSupportedByDialect( SpatialFunction.distance ) ) {
return;
@ -288,6 +266,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
retrieveHQLResultsAndCompare( dbexpected, hql, params );
}
@Test
public void buffer() throws SQLException {
if ( !isSupportedByDialect( SpatialFunction.buffer ) ) {
return;
@ -299,6 +278,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
}
@Test
public void convexhull() throws SQLException {
if ( !isSupportedByDialect( SpatialFunction.convexhull ) ) {
return;
@ -310,6 +290,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
}
@Test
public void intersection() throws SQLException {
if ( !isSupportedByDialect( SpatialFunction.intersection ) ) {
return;
@ -320,6 +301,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
retrieveHQLResultsAndCompare( dbexpected, hql, params );
}
@Test
public void difference() throws SQLException {
if ( !isSupportedByDialect( SpatialFunction.difference ) ) {
return;
@ -330,6 +312,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
retrieveHQLResultsAndCompare( dbexpected, hql, params );
}
@Test
public void symdifference() throws SQLException {
if ( !isSupportedByDialect( SpatialFunction.symdifference ) ) {
return;
@ -340,6 +323,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
retrieveHQLResultsAndCompare( dbexpected, hql, params );
}
@Test
public void geomunion() throws SQLException {
if ( !isSupportedByDialect( SpatialFunction.geomunion ) ) {
return;
@ -350,6 +334,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
retrieveHQLResultsAndCompare( dbexpected, hql, params );
}
@Test
public void dwithin() throws SQLException {
if ( !isSupportedByDialect( SpatialFunction.dwithin ) ) {
return;
@ -365,6 +350,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
retrieveHQLResultsAndCompare( dbexpected, hql, params );
}
@Test
public void transform() throws SQLException {
if ( !isSupportedByDialect( SpatialFunction.transform ) ) {
return;

View File

@ -29,9 +29,10 @@ import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.criterion.Criterion;
import org.hibernate.spatial.SpatialDialect;
import org.hibernate.spatial.SpatialFunction;
import org.hibernate.spatial.criterion.SpatialRestrictions;
import org.hibernate.spatial.testing.SpatialDialectMatcher;
import org.hibernate.spatial.testing.SpatialFunctionalTestCase;
import org.hibernate.testing.Skip;
import org.junit.Test;
import org.slf4j.Logger;
@ -49,39 +50,11 @@ public class TestSpatialRestrictions extends SpatialFunctionalTestCase {
private static Logger LOGGER = LoggerFactory.getLogger( TestSpatialRestrictions.class );
public void prepareTest() {
super.prepareTest();
try {
dataSourceUtils.insertTestData( testData );
}
catch ( SQLException e ) {
throw new RuntimeException( e );
}
}
protected Logger getLogger() {
return LOGGER;
}
@Test
public void testRestrictions() throws Exception {
if (! (getDialect() instanceof SpatialDialect)) return;
within();
filter();
contains();
crosses();
touches();
disjoint();
eq();
intersects();
overlaps();
dwithin();
havingSRID();
isEmpty();
isNotEmpty();
}
@Test
public void within() throws SQLException {
if ( !isSupportedByDialect( SpatialFunction.within ) ) {
return;
@ -91,6 +64,7 @@ public class TestSpatialRestrictions extends SpatialFunctionalTestCase {
retrieveAndCompare( dbexpected, spatialCriterion );
}
@Test
public void filter() throws SQLException {
if ( !dialectSupportsFiltering() ) {
return;
@ -100,6 +74,7 @@ public class TestSpatialRestrictions extends SpatialFunctionalTestCase {
retrieveAndCompare( dbexpected, spatialCriterion );
}
@Test
public void contains() throws SQLException {
if ( !isSupportedByDialect( SpatialFunction.contains ) ) {
return;
@ -109,6 +84,7 @@ public class TestSpatialRestrictions extends SpatialFunctionalTestCase {
retrieveAndCompare( dbexpected, spatialCriterion );
}
@Test
public void crosses() throws SQLException {
if ( !isSupportedByDialect( SpatialFunction.crosses ) ) {
return;
@ -118,6 +94,7 @@ public class TestSpatialRestrictions extends SpatialFunctionalTestCase {
retrieveAndCompare( dbexpected, spatialCriterion );
}
@Test
public void touches() throws SQLException {
if ( !isSupportedByDialect( SpatialFunction.touches ) ) {
return;
@ -127,6 +104,7 @@ public class TestSpatialRestrictions extends SpatialFunctionalTestCase {
retrieveAndCompare( dbexpected, spatialCriterion );
}
@Test
public void disjoint() throws SQLException {
if ( !isSupportedByDialect( SpatialFunction.disjoint ) ) {
return;
@ -136,6 +114,7 @@ public class TestSpatialRestrictions extends SpatialFunctionalTestCase {
retrieveAndCompare( dbexpected, spatialCriterion );
}
@Test
public void eq() throws SQLException {
if ( !isSupportedByDialect( SpatialFunction.equals ) ) {
return;
@ -145,6 +124,7 @@ public class TestSpatialRestrictions extends SpatialFunctionalTestCase {
retrieveAndCompare( dbexpected, spatialCriterion );
}
@Test
public void intersects() throws SQLException {
if ( !isSupportedByDialect( SpatialFunction.intersects ) ) {
return;
@ -154,6 +134,7 @@ public class TestSpatialRestrictions extends SpatialFunctionalTestCase {
retrieveAndCompare( dbexpected, spatialCriterion );
}
@Test
public void overlaps() throws SQLException {
if ( !isSupportedByDialect( SpatialFunction.overlaps ) ) {
return;
@ -163,6 +144,7 @@ public class TestSpatialRestrictions extends SpatialFunctionalTestCase {
retrieveAndCompare( dbexpected, spatialCriterion );
}
@Test
public void dwithin() throws SQLException {
if ( !isSupportedByDialect( SpatialFunction.dwithin ) ) {
return;
@ -176,6 +158,7 @@ public class TestSpatialRestrictions extends SpatialFunctionalTestCase {
retrieveAndCompare( dbexpected, spatialCriterion );
}
@Test
public void isEmpty() throws SQLException {
if ( !isSupportedByDialect( SpatialFunction.isempty ) ) {
return;
@ -185,6 +168,7 @@ public class TestSpatialRestrictions extends SpatialFunctionalTestCase {
retrieveAndCompare( dbexpected, spatialCriterion );
}
@Test
public void isNotEmpty() throws SQLException {
if ( !isSupportedByDialect( SpatialFunction.isempty ) ) {
return;
@ -194,7 +178,7 @@ public class TestSpatialRestrictions extends SpatialFunctionalTestCase {
retrieveAndCompare( dbexpected, spatialCriterion );
}
@Test
public void havingSRID() throws SQLException {
if ( !isSupportedByDialect( SpatialFunction.srid ) ) {
return;

View File

@ -30,7 +30,9 @@ import com.vividsolutions.jts.io.ParseException;
import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.spatial.SpatialDialect;
import org.hibernate.spatial.testing.SpatialDialectMatcher;
import org.hibernate.spatial.testing.SpatialFunctionalTestCase;
import org.hibernate.spatial.testing.TestDataElement;
import org.hibernate.testing.Skip;
import org.junit.Test;
import org.slf4j.Logger;
@ -48,156 +50,145 @@ import static org.junit.Assert.assertTrue;
* This testsuite-suite class verifies whether the <code>Geometry</code>s retrieved
* are equal to the <code>Geometry</code>s stored.
*/
@Skip(condition = SpatialDialectMatcher.class,message = "No Spatial Dialect")
@Skip(condition = SpatialDialectMatcher.class, message = "No Spatial Dialect")
public class TestStoreRetrieve extends SpatialFunctionalTestCase {
private static Logger LOGGER = LoggerFactory.getLogger( TestStoreRetrieve.class );
private static Logger LOGGER = LoggerFactory.getLogger(TestStoreRetrieve.class);
protected Logger getLogger() {
return LOGGER;
}
protected Logger getLogger() {
return LOGGER;
}
public void prepareTest(){
}
@Test
public void testStoreRetrieve() throws ParseException {
if (! (getDialect() instanceof SpatialDialect)) return;
Map<Integer, GeomEntity> stored = new HashMap<Integer, GeomEntity>();
//check whether we retrieve exactly what we store
storeTestObjects( stored );
retrieveAndCompare( stored );
@Test
public void testAfterStoreRetrievingEqualObject() throws ParseException {
Map<Integer, GeomEntity> stored = new HashMap<Integer, GeomEntity>();
//check whether we retrieve exactly what we store
storeTestObjects(stored);
retrieveAndCompare(stored);
}
deleteAllTestEntities();
@Test
public void testStoringNullGeometries() {
storeNullGeometry();
retrieveNullGeometry();
}
//check if we can store null-geometries
storeNullGeometry();
//check if we can retrieve null-geometries
retrieveNullGeometry();
}
private void retrieveAndCompare(Map<Integer, GeomEntity> stored) {
int id = -1;
Transaction tx = null;
Session session = null;
try {
session = openSession();
tx = session.beginTransaction();
for (GeomEntity storedEntity : stored.values()) {
id = storedEntity.getId();
GeomEntity retrievedEntity = (GeomEntity) session.get(GeomEntity.class, id);
Geometry retrievedGeometry = retrievedEntity.getGeom();
Geometry storedGeometry = storedEntity.getGeom();
String msg = createFailureMessage(storedEntity.getId(), storedGeometry, retrievedGeometry);
assertTrue(msg, geometryEquality.test(storedGeometry, retrievedGeometry));
}
tx.commit();
} catch (Exception e) {
if (tx != null) {
tx.rollback();
}
throw new RuntimeException(String.format("Failure on case: %d", id), e);
} finally {
if (session != null) {
session.close();
}
}
}
private void retrieveAndCompare(Map<Integer, GeomEntity> stored) {
int id = -1;
Transaction tx = null;
Session session = null;
try {
session = openSession();
tx = session.beginTransaction();
for ( GeomEntity storedEntity : stored.values() ) {
id = storedEntity.getId();
GeomEntity retrievedEntity = (GeomEntity) session.get( GeomEntity.class, id );
Geometry retrievedGeometry = retrievedEntity.getGeom();
Geometry storedGeometry = storedEntity.getGeom();
String msg = createFailureMessage( storedEntity.getId(), storedGeometry, retrievedGeometry );
assertTrue( msg, geometryEquality.test( storedGeometry, retrievedGeometry ) );
}
tx.commit();
}
catch ( Exception e ) {
if ( tx != null ) {
tx.rollback();
}
throw new RuntimeException( String.format( "Failure on case: %d", id ), e );
}
finally {
if ( session != null ) {
session.close();
}
}
}
private String createFailureMessage(int id, Geometry storedGeometry, Geometry retrievedGeometry) {
String expectedText = (storedGeometry != null ? storedGeometry.toText() : "NULL");
String retrievedText = (retrievedGeometry != null ? retrievedGeometry.toText() : "NULL");
return String.format(
"Equality testsuite-suite failed for %d.\nExpected: %s\nReceived:%s",
id,
expectedText,
retrievedText
);
}
private String createFailureMessage(int id, Geometry storedGeometry, Geometry retrievedGeometry) {
String expectedText = ( storedGeometry != null ? storedGeometry.toText() : "NULL" );
String retrievedText = ( retrievedGeometry != null ? retrievedGeometry.toText() : "NULL" );
return String.format(
"Equality testsuite-suite failed for %d.\nExpected: %s\nReceived:%s",
id,
expectedText,
retrievedText
);
}
private void storeTestObjects(Map<Integer, GeomEntity> stored) {
Session session = null;
Transaction tx = null;
int id = -1;
try {
session = openSession();
// Every testsuite-suite instance is committed seperately
// to improve feedback in case of failure
for ( TestDataElement element : testData ) {
id = element.id;
tx = session.beginTransaction();
GeomEntity entity = GeomEntity.createFrom( element );
stored.put( entity.getId(), entity );
session.save( entity );
tx.commit();
}
}
catch ( Exception e ) {
if ( tx != null ) {
tx.rollback();
}
throw new RuntimeException( "Failed storing testsuite-suite object with id:" + id, e );
}
finally {
if ( session != null ) {
session.close();
}
}
}
private void storeNullGeometry() {
GeomEntity entity = null;
Session session = null;
Transaction tx = null;
try {
session = openSession();
tx = session.beginTransaction();
entity = new GeomEntity();
entity.setId( 1 );
entity.setType( "NULL OBJECT" );
session.save( entity );
tx.commit();
}
catch ( Exception e ) {
if ( tx != null ) {
tx.rollback();
}
throw new RuntimeException( "Failed storing testsuite-suite object with id:" + entity.getId(), e );
}
finally {
if ( session != null ) {
session.close();
}
}
}
private void retrieveNullGeometry() {
Transaction tx = null;
Session session = null;
try {
session = openSession();
tx = session.beginTransaction();
Criteria criteria = session.createCriteria( GeomEntity.class );
List<GeomEntity> retrieved = criteria.list();
assertEquals( "Expected exactly one result", 1, retrieved.size() );
GeomEntity entity = retrieved.get( 0 );
assertNull( entity.getGeom() );
tx.commit();
}
catch ( Exception e ) {
if ( tx != null ) {
tx.rollback();
}
throw new RuntimeException( e );
}
finally {
if ( session != null ) {
session.close();
}
}
}
private void storeTestObjects(Map<Integer, GeomEntity> stored) {
Session session = null;
Transaction tx = null;
int id = -1;
try {
session = openSession();
// Every testsuite-suite instance is committed seperately
// to improve feedback in case of failure
for (TestDataElement element : testData) {
id = element.id;
tx = session.beginTransaction();
GeomEntity entity = GeomEntity.createFrom(element);
stored.put(entity.getId(), entity);
session.save(entity);
tx.commit();
}
} catch (Exception e) {
if (tx != null) {
tx.rollback();
}
throw new RuntimeException("Failed storing testsuite-suite object with id:" + id, e);
} finally {
if (session != null) {
session.close();
}
}
}
private void storeNullGeometry() {
GeomEntity entity = null;
Session session = null;
Transaction tx = null;
try {
session = openSession();
tx = session.beginTransaction();
entity = new GeomEntity();
entity.setId(1);
entity.setType("NULL OBJECT");
session.save(entity);
tx.commit();
} catch (Exception e) {
if (tx != null) {
tx.rollback();
}
throw new RuntimeException("Failed storing testsuite-suite object with id:" + entity.getId(), e);
} finally {
if (session != null) {
session.close();
}
}
}
private void retrieveNullGeometry() {
Transaction tx = null;
Session session = null;
try {
session = openSession();
tx = session.beginTransaction();
Criteria criteria = session.createCriteria(GeomEntity.class);
List<GeomEntity> retrieved = criteria.list();
assertEquals("Expected exactly one result", 1, retrieved.size());
GeomEntity entity = retrieved.get(0);
assertNull(entity.getGeom());
tx.commit();
} catch (Exception e) {
if (tx != null) {
tx.rollback();
}
throw new RuntimeException(e);
} finally {
if (session != null) {
session.close();
}
}
}
}

View File

@ -1,65 +0,0 @@
package org.hibernate.spatial.integration;
import org.hibernate.dialect.Dialect;
/**
* @author Karel Maesen, Geovise BVBA
* creation-date: Sep 30, 2010
*/
public class TestSupportFactories {
private static TestSupportFactories instance = new TestSupportFactories();
public static TestSupportFactories instance() {
return instance;
}
private TestSupportFactories() {
}
public TestSupport getTestSupportFactory(Dialect dialect)
throws ClassNotFoundException, InstantiationException, IllegalAccessException {
if ( dialect == null ) {
throw new IllegalArgumentException( "Dialect argument is required." );
}
String testSupportFactoryClassName = getSupportFactoryClassName( dialect );
return instantiate( testSupportFactoryClassName );
}
private TestSupport instantiate(String testSupportFactoryClassName)
throws ClassNotFoundException, IllegalAccessException, InstantiationException {
ClassLoader cloader = getClassLoader();
Class<TestSupport> cl = (Class<TestSupport>) ( cloader.loadClass( testSupportFactoryClassName ) );
return cl.newInstance();
}
private ClassLoader getClassLoader() {
return this.getClass().getClassLoader();
}
private static String getSupportFactoryClassName(Dialect dialect) {
String canonicalName = dialect.getClass().getCanonicalName();
if ( "org.hibernate.spatial.dialect.postgis.PostgisDialect".equals( canonicalName ) ) {
return "org.hibernate.spatial.integration.dialects.postgis.PostgisTestSupport";
}
// if ("org.hibernate.spatial.geodb.GeoDBDialect".equals(canonicalName)) {
// return "org.hibernate.spatial.geodb.GeoDBSupport";
// }
if ("org.hibernate.spatial.dialect.sqlserver.SqlServer2008SpatialDialect".equals(canonicalName)) {
return "org.hibernate.spatial.integration.dialects.sqlserver.SQLServerTestSupport";
}
// if ("org.hibernatespatial.mysql.MySQLSpatialDialect".equals(canonicalName) ||
// "org.hibernatespatial.mysql.MySQLSpatialInnoDBDialect".equals(canonicalName)) {
// return "org.hibernatespatial.mysql.MySQLTestSupport";
// }
if ( "org.hibernate.spatial.dialect.oracle.OracleSpatial10gDialect".equals( canonicalName ) ) {
return "org.hibernate.spatial.integration.dialects.oracle.OracleSDOTestSupport";
}
throw new IllegalArgumentException( "Dialect not known in test suite" );
}
}

View File

@ -23,15 +23,7 @@
* For more information, visit: http://www.hibernatespatial.org/
*/
package org.hibernate.spatial.integration;
import java.sql.Blob;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;
package org.hibernate.spatial.testing;
import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.geom.Point;
@ -41,9 +33,13 @@ import com.vividsolutions.jts.io.WKTReader;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.sql.*;
import java.util.HashMap;
import java.util.Map;
/**
* An <code>AbstractExpectationsFactory</code> provides the expected
* values to be used in the unit tests of the spatial functions
* values to be used in the integration tests of the spatial functions
* provided by specific providers.
* <p/>
* The expected values are returned as a map of (identifier, expected value) pairs.

View File

@ -23,7 +23,7 @@
* For more information, visit: http://www.hibernate.spatial.org/
*/
package org.hibernate.spatial.integration;
package org.hibernate.spatial.testing;
import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.io.ParseException;

View File

@ -39,7 +39,7 @@
*/
package org.hibernate.spatial.integration;
package org.hibernate.spatial.testing;
import java.io.IOException;
import java.io.Reader;

View File

@ -23,7 +23,7 @@
* For more information, visit: http://www.hibernatespatial.org/
*/
package org.hibernate.spatial.integration;
package org.hibernate.spatial.testing;
import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.Geometry;

View File

@ -23,7 +23,7 @@
* For more information, visit: http://www.hibernatespatial.org/
*/
package org.hibernate.spatial.integration;
package org.hibernate.spatial.testing;
import java.sql.Connection;
import java.sql.PreparedStatement;

View File

@ -23,7 +23,7 @@
* For more information, visit: http://www.hibernatespatial.org/
*/
package org.hibernate.spatial.integration;
package org.hibernate.spatial.testing;
/**
* <code>SQLExpressoinTemplate</code>s generate database-specific

View File

@ -1,4 +1,4 @@
package org.hibernate.spatial.integration;
package org.hibernate.spatial.testing;
import org.hibernate.dialect.Dialect;
import org.hibernate.spatial.SpatialDialect;

View File

@ -1,4 +1,4 @@
package org.hibernate.spatial.integration;
package org.hibernate.spatial.testing;
import com.vividsolutions.jts.geom.Geometry;
import org.hibernate.Query;
@ -7,10 +7,10 @@ import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;
import org.hibernate.spatial.SpatialDialect;
import org.hibernate.spatial.SpatialFunction;
import org.hibernate.testing.AfterClassOnce;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import org.slf4j.Logger;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;
@ -28,16 +28,22 @@ public abstract class SpatialFunctionalTestCase extends BaseCoreFunctionalTestCa
protected GeometryEquality geometryEquality;
protected AbstractExpectationsFactory expectationsFactory;
public void insertTestData() {
try {
/**
* Inserts the test data via a direct route (JDBC).
*/
public void prepareTest() {
try {
dataSourceUtils.insertTestData( testData );
}
catch ( SQLException e ) {
throw new RuntimeException( e );
}
}
}
public void deleteAllTestEntities() {
/**
* Removes the test data.
*/
public void cleanupTest() {
Session session = null;
Transaction tx = null;
try {
@ -60,29 +66,40 @@ public abstract class SpatialFunctionalTestCase extends BaseCoreFunctionalTestCa
}
}
public void prepareTest() {
try {
TestSupport tsFactory = TestSupportFactories.instance().getTestSupportFactory( getDialect() );
Configuration cfg = configuration();
dataSourceUtils = tsFactory.createDataSourceUtil( cfg );
expectationsFactory = tsFactory.createExpectationsFactory( dataSourceUtils );
testData = tsFactory.createTestData( this );
geometryEquality = tsFactory.createGeometryEquality();
dataSourceUtils.afterCreateSchema();
}
catch ( Exception e ) {
throw new RuntimeException( e );
}
}
/**
* Override to also ensure that the SpatialTestSupport utility is
* initialised together with the Hibernate <code>Configuration</code>.
* @return
*/
protected Configuration constructConfiguration() {
Configuration cfg = super.constructConfiguration();
initializeSpatialTestSupport(cfg);
return cfg;
}
public void cleanupTest() throws SQLException {
private void initializeSpatialTestSupport(Configuration cfg) {
try {
TestSupport support = TestSupportFactories.instance().getTestSupportFactory( getDialect() );
dataSourceUtils = support.createDataSourceUtil( cfg );
expectationsFactory = support.createExpectationsFactory( dataSourceUtils );
testData = support.createTestData( this );
geometryEquality = support.createGeometryEquality();
dataSourceUtils.afterCreateSchema();
}
catch ( Exception e ) {
throw new RuntimeException( e );
}
}
/**
* Cleans up the dataSourceUtils
* @throws SQLException
*/
@AfterClassOnce
public void closeDataSourceUtils() throws SQLException {
dataSourceUtils.close();
}
public Connection getConnection() throws SQLException {
return dataSourceUtils.getConnection();
}
public String getBaseForMappings() {
return "";
}
@ -174,5 +191,4 @@ public abstract class SpatialFunctionalTestCase extends BaseCoreFunctionalTestCa
}
}
}

View File

@ -23,7 +23,7 @@
* For more information, visit: http://www.hibernatespatial.org/
*/
package org.hibernate.spatial.integration;
package org.hibernate.spatial.testing;
import java.io.InputStream;
import java.util.Collection;

View File

@ -23,7 +23,7 @@
* For more information, visit: http://www.hibernatespatial.org/
*/
package org.hibernate.spatial.integration;
package org.hibernate.spatial.testing;
/**
* A <code>TestDataElement</code> captures the information necessary to build a testsuite-suite geometry.

View File

@ -23,7 +23,7 @@
* For more information, visit: http://www.hibernatespatial.org/
*/
package org.hibernate.spatial.integration;
package org.hibernate.spatial.testing;
import java.io.InputStream;
import java.util.ArrayList;

View File

@ -1,4 +1,4 @@
package org.hibernate.spatial.integration;
package org.hibernate.spatial.testing;
import org.hibernate.cfg.Configuration;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;

View File

@ -0,0 +1,64 @@
package org.hibernate.spatial.testing;
import org.hibernate.dialect.Dialect;
import org.hibernate.spatial.testing.dialects.oracle.OracleSDOTestSupport;
import org.hibernate.spatial.testing.dialects.postgis.PostgisTestSupport;
import org.hibernate.spatial.testing.dialects.sqlserver.SQLServerTestSupport;
/**
* @author Karel Maesen, Geovise BVBA
* creation-date: Sep 30, 2010
*/
public class TestSupportFactories {
private static TestSupportFactories instance = new TestSupportFactories();
public static TestSupportFactories instance() {
return instance;
}
private TestSupportFactories() {
}
public TestSupport getTestSupportFactory(Dialect dialect) throws InstantiationException, IllegalAccessException {
if (dialect == null) {
throw new IllegalArgumentException("Dialect argument is required.");
}
Class testSupportFactoryClass = getSupportFactoryClass(dialect);
return instantiate(testSupportFactoryClass);
}
private TestSupport instantiate(Class<? extends TestSupport> testSupportFactoryClass) throws IllegalAccessException, InstantiationException {
return testSupportFactoryClass.newInstance();
}
private ClassLoader getClassLoader() {
return this.getClass().getClassLoader();
}
private static Class<? extends TestSupport> getSupportFactoryClass(Dialect dialect) {
String canonicalName = dialect.getClass().getCanonicalName();
if ("org.hibernate.spatial.dialect.postgis.PostgisDialect".equals(canonicalName)) {
return PostgisTestSupport.class;
}
// if ("org.hibernate.spatial.geodb.GeoDBDialect".equals(canonicalName)) {
// return "org.hibernate.spatial.geodb.GeoDBSupport";
// }
if ("org.hibernate.spatial.dialect.sqlserver.SqlServer2008SpatialDialect".equals(canonicalName)) {
return SQLServerTestSupport.class;
}
// if ("org.hibernatespatial.mysql.MySQLSpatialDialect".equals(canonicalName) ||
// "org.hibernatespatial.mysql.MySQLSpatialInnoDBDialect".equals(canonicalName)) {
// return "org.hibernatespatial.mysql.MySQLTestSupport";
// }
if ("org.hibernate.spatial.dialect.oracle.OracleSpatial10gDialect".equals(canonicalName)) {
return OracleSDOTestSupport.class;
}
throw new IllegalArgumentException("Dialect not known in test suite");
}
}

View File

@ -1,4 +1,4 @@
package org.hibernate.spatial.integration.dialects.oracle;
package org.hibernate.spatial.testing.dialects.oracle;
import java.sql.Array;
import java.sql.Blob;

View File

@ -1,11 +1,11 @@
package org.hibernate.spatial.integration.dialects.oracle;
package org.hibernate.spatial.testing.dialects.oracle;
import org.hibernate.cfg.Configuration;
import org.hibernate.spatial.integration.AbstractExpectationsFactory;
import org.hibernate.spatial.integration.DataSourceUtils;
import org.hibernate.spatial.integration.SQLExpressionTemplate;
import org.hibernate.spatial.integration.TestData;
import org.hibernate.spatial.integration.TestSupport;
import org.hibernate.spatial.testing.DataSourceUtils;
import org.hibernate.spatial.testing.SQLExpressionTemplate;
import org.hibernate.spatial.testing.TestData;
import org.hibernate.spatial.testing.AbstractExpectationsFactory;
import org.hibernate.spatial.testing.TestSupport;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
/**

View File

@ -23,12 +23,12 @@
* For more information, visit: http://www.hibernatespatial.org/
*/
package org.hibernate.spatial.integration.dialects.oracle;
package org.hibernate.spatial.testing.dialects.oracle;
import java.sql.SQLException;
import org.hibernate.spatial.integration.DataSourceUtils;
import org.hibernate.spatial.integration.SQLExpressionTemplate;
import org.hibernate.spatial.testing.DataSourceUtils;
import org.hibernate.spatial.testing.SQLExpressionTemplate;
public class SDODataSourceUtils extends DataSourceUtils {

View File

@ -23,15 +23,15 @@
* For more information, visit: http://www.hibernatespatial.org/
*/
package org.hibernate.spatial.integration.dialects.oracle;
package org.hibernate.spatial.testing.dialects.oracle;
import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.geom.Point;
import org.hibernate.spatial.dialect.oracle.SDOGeometryValueExtractor;
import org.hibernate.spatial.integration.AbstractExpectationsFactory;
import org.hibernate.spatial.integration.DataSourceUtils;
import org.hibernate.spatial.integration.NativeSQLStatement;
import org.hibernate.spatial.testing.NativeSQLStatement;
import org.hibernate.spatial.testing.AbstractExpectationsFactory;
import org.hibernate.spatial.testing.DataSourceUtils;
/**
* Expectations factory for Oracle 10g (SDOGeometry).

View File

@ -23,10 +23,10 @@
* For more information, visit: http://www.hibernatespatial.org/
*/
package org.hibernate.spatial.integration.dialects.oracle;
package org.hibernate.spatial.testing.dialects.oracle;
import org.hibernate.spatial.integration.SQLExpressionTemplate;
import org.hibernate.spatial.integration.TestDataElement;
import org.hibernate.spatial.testing.SQLExpressionTemplate;
import org.hibernate.spatial.testing.TestDataElement;
public class SDOGeometryExpressionTemplate implements SQLExpressionTemplate {

View File

@ -23,10 +23,10 @@
* For more information, visit: http://www.hibernatespatial.org/
*/
package org.hibernate.spatial.integration.dialects.oracle;
package org.hibernate.spatial.testing.dialects.oracle;
import org.hibernate.spatial.integration.TestDataElement;
import org.hibernate.spatial.testing.TestDataElement;
/**
* A specialised subclass for SDOGeometry test objects

View File

@ -23,14 +23,14 @@
* For more information, visit: http://www.hibernatespatial.org/
*/
package org.hibernate.spatial.integration.dialects.oracle;
package org.hibernate.spatial.testing.dialects.oracle;
import java.util.List;
import org.dom4j.Element;
import org.hibernate.spatial.integration.TestDataElement;
import org.hibernate.spatial.integration.TestDataReader;
import org.hibernate.spatial.testing.TestDataElement;
import org.hibernate.spatial.testing.TestDataReader;
public class SDOTestDataReader extends TestDataReader {

View File

@ -23,15 +23,15 @@
* For more information, visit: http://www.hibernatespatial.org/
*/
package org.hibernate.spatial.integration.dialects.postgis;
package org.hibernate.spatial.testing.dialects.postgis;
import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.geom.Point;
import org.hibernate.spatial.dialect.postgis.PGGeometryValueExtractor;
import org.hibernate.spatial.integration.AbstractExpectationsFactory;
import org.hibernate.spatial.integration.DataSourceUtils;
import org.hibernate.spatial.integration.NativeSQLStatement;
import org.hibernate.spatial.testing.NativeSQLStatement;
import org.hibernate.spatial.testing.AbstractExpectationsFactory;
import org.hibernate.spatial.testing.DataSourceUtils;
/**
* This class provides the expected return values to the testsuite-suite classes in this package.

View File

@ -23,10 +23,10 @@
* For more information, visit: http://www.hibernatespatial.org/
*/
package org.hibernate.spatial.integration.dialects.postgis;
package org.hibernate.spatial.testing.dialects.postgis;
import org.hibernate.spatial.integration.SQLExpressionTemplate;
import org.hibernate.spatial.integration.TestDataElement;
import org.hibernate.spatial.testing.SQLExpressionTemplate;
import org.hibernate.spatial.testing.TestDataElement;
/**
* The template for postgis insert SQL

View File

@ -1,11 +1,11 @@
package org.hibernate.spatial.integration.dialects.postgis;
package org.hibernate.spatial.testing.dialects.postgis;
import org.hibernate.spatial.integration.AbstractExpectationsFactory;
import org.hibernate.spatial.integration.DataSourceUtils;
import org.hibernate.spatial.integration.SQLExpressionTemplate;
import org.hibernate.spatial.integration.TestData;
import org.hibernate.spatial.integration.TestSupport;
import org.hibernate.spatial.testing.DataSourceUtils;
import org.hibernate.spatial.testing.SQLExpressionTemplate;
import org.hibernate.spatial.testing.TestData;
import org.hibernate.spatial.testing.AbstractExpectationsFactory;
import org.hibernate.spatial.testing.TestSupport;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
/**

View File

@ -23,10 +23,10 @@
* For more information, visit: http://www.hibernatespatial.org/
*/
package org.hibernate.spatial.integration.dialects.sqlserver;
package org.hibernate.spatial.testing.dialects.sqlserver;
import org.hibernate.spatial.integration.SQLExpressionTemplate;
import org.hibernate.spatial.integration.TestDataElement;
import org.hibernate.spatial.testing.SQLExpressionTemplate;
import org.hibernate.spatial.testing.TestDataElement;
/**
* @author Karel Maesen, Geovise BVBA

View File

@ -1,9 +1,9 @@
package org.hibernate.spatial.integration.dialects.sqlserver;
package org.hibernate.spatial.testing.dialects.sqlserver;
import org.hibernate.spatial.integration.DataSourceUtils;
import org.hibernate.spatial.integration.SQLExpressionTemplate;
import org.hibernate.spatial.integration.TestData;
import org.hibernate.spatial.integration.TestSupport;
import org.hibernate.spatial.testing.SQLExpressionTemplate;
import org.hibernate.spatial.testing.TestData;
import org.hibernate.spatial.testing.DataSourceUtils;
import org.hibernate.spatial.testing.TestSupport;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
/**

View File

@ -23,15 +23,15 @@
* For more information, visit: http://www.hibernatespatial.org/
*/
package org.hibernate.spatial.integration.dialects.sqlserver;
package org.hibernate.spatial.testing.dialects.sqlserver;
import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.geom.Point;
import org.hibernate.spatial.dialect.sqlserver.convertors.Decoders;
import org.hibernate.spatial.integration.AbstractExpectationsFactory;
import org.hibernate.spatial.integration.DataSourceUtils;
import org.hibernate.spatial.integration.NativeSQLStatement;
import org.hibernate.spatial.testing.NativeSQLStatement;
import org.hibernate.spatial.testing.AbstractExpectationsFactory;
import org.hibernate.spatial.testing.DataSourceUtils;
/**

View File

@ -22,7 +22,7 @@
*
* For more information, visit: http://www.hibernatespatial.org/
*/
package org.hibernate.spatial.integration.dialects.sqlserver.convertors;
package org.hibernate.spatial.testing.dialects.sqlserver.convertors;
/**
* @author Karel Maesen, Geovise BVBA.
@ -33,12 +33,12 @@ import com.vividsolutions.jts.geom.Geometry;
import org.hibernate.spatial.dialect.sqlserver.convertors.Decoders;
import org.hibernate.spatial.dialect.sqlserver.convertors.Encoders;
import org.hibernate.spatial.dialect.sqlserver.convertors.OpenGisType;
import org.hibernate.spatial.integration.DataSourceUtils;
import org.hibernate.spatial.integration.SpatialFunctionalTestCase;
import org.hibernate.spatial.integration.TestData;
import org.hibernate.spatial.integration.TestSupport;
import org.hibernate.spatial.integration.dialects.sqlserver.SQLServerExpressionTemplate;
import org.hibernate.spatial.integration.dialects.sqlserver.SQLServerTestSupport;
import org.hibernate.spatial.testing.DataSourceUtils;
import org.hibernate.spatial.testing.TestData;
import org.hibernate.spatial.testing.dialects.sqlserver.SQLServerExpressionTemplate;
import org.hibernate.spatial.testing.dialects.sqlserver.SQLServerTestSupport;
import org.hibernate.spatial.testing.SpatialFunctionalTestCase;
import org.hibernate.spatial.testing.TestSupport;
import org.slf4j.Logger;
import java.io.IOException;

View File

@ -23,7 +23,7 @@
* For more information, visit: http://www.hibernatespatial.org/
*/
package org.hibernate.spatial.integration.dialects.sqlserver.convertors;
package org.hibernate.spatial.testing.dialects.sqlserver.convertors;
import org.hibernate.spatial.dialect.sqlserver.SqlServer2008SpatialDialect;
import org.hibernate.spatial.dialect.sqlserver.convertors.OpenGisType;

View File

@ -23,7 +23,7 @@
* For more information, visit: http://www.hibernatespatial.org/
*/
package org.hibernate.spatial.integration.dialects.sqlserver.convertors;
package org.hibernate.spatial.testing.dialects.sqlserver.convertors;
import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.LineString;

View File

@ -23,7 +23,7 @@
* For more information, visit: http://www.hibernatespatial.org/
*/
package org.hibernate.spatial.integration.dialects.sqlserver.convertors;
package org.hibernate.spatial.testing.dialects.sqlserver.convertors;
import org.hibernate.spatial.dialect.sqlserver.SqlServer2008SpatialDialect;
import org.hibernate.spatial.dialect.sqlserver.convertors.OpenGisType;

View File

@ -23,7 +23,7 @@
* For more information, visit: http://www.hibernatespatial.org/
*/
package org.hibernate.spatial.integration.dialects.sqlserver.convertors;
package org.hibernate.spatial.testing.dialects.sqlserver.convertors;
import org.hibernate.spatial.dialect.sqlserver.SqlServer2008SpatialDialect;
import org.hibernate.spatial.dialect.sqlserver.convertors.OpenGisType;

View File

@ -23,7 +23,7 @@
* For more information, visit: http://www.hibernatespatial.org/
*/
package org.hibernate.spatial.integration.dialects.sqlserver.convertors;
package org.hibernate.spatial.testing.dialects.sqlserver.convertors;
import org.hibernate.spatial.dialect.sqlserver.SqlServer2008SpatialDialect;
import org.hibernate.spatial.dialect.sqlserver.convertors.OpenGisType;

View File

@ -23,7 +23,7 @@
* For more information, visit: http://www.hibernatespatial.org/
*/
package org.hibernate.spatial.integration.dialects.sqlserver.convertors;
package org.hibernate.spatial.testing.dialects.sqlserver.convertors;
import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.Point;

View File

@ -23,7 +23,7 @@
* For more information, visit: http://www.hibernatespatial.org/
*/
package org.hibernate.spatial.integration.dialects.sqlserver.convertors;
package org.hibernate.spatial.testing.dialects.sqlserver.convertors;
import org.hibernate.spatial.dialect.sqlserver.SqlServer2008SpatialDialect;
import org.hibernate.spatial.dialect.sqlserver.convertors.OpenGisType;

View File

@ -1,42 +0,0 @@
<?xml version="1.0"?>
<!--
~ $Id: GeomEntity.hbm.xml 242 2010-09-22 20:40:07Z maesenka $
~
~ This file is part of Hibernate Spatial, an extension to the
~ hibernate ORM solution for geographic data.
~
~ Copyright © 2007-2010 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
~
~ For more information, visit: http://www.hibernatespatial.org/
-->
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
" http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="org.hibernate.spatial.integration.GeomEntity" table="GEOMTEST">
<id name="id" type="integer">
<generator class="assigned"/>
</id>
<property name="type" type="string">
<column name="type" length="50"/>
</property>
<property name="geom" type="org.hibernate.spatial.GeometryType">
<column name="geom"/>
</property>
</class>
</hibernate-mapping>

View File

@ -1,9 +0,0 @@
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
log4j.rootLogger=info, stdout
log4j.logger.org.hibernate.spatial=debug

View File

@ -24,31 +24,31 @@
# Default unit/integration test config.
hibernate.dialect org.hibernate.dialect.H2Dialect
hibernate.connection.driver_class org.h2.Driver
hibernate.connection.url jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1;MVCC=TRUE
hibernate.connection.username sa
hibernate.connection.pool_size 5
hibernate.show_sql false
hibernate.max_fetch_depth 5
hibernate.cache.region_prefix hibernate.test
hibernate.cache.region.factory_class org.hibernate.testing.cache.CachingRegionFactory
# NOTE: hibernate.jdbc.batch_versioned_data should be set to false when testing with Oracle
hibernate.jdbc.batch_versioned_data true
#hibernate.dialect org.hibernate.dialect.H2Dialect
#hibernate.connection.driver_class org.h2.Driver
#hibernate.connection.url jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1;MVCC=TRUE
#hibernate.connection.username sa
#
#hibernate.connection.pool_size 5
#
#hibernate.show_sql false
#
#hibernate.max_fetch_depth 5
#
#hibernate.cache.region_prefix hibernate.test
#hibernate.cache.region.factory_class org.hibernate.testing.cache.CachingRegionFactory
#
## NOTE: hibernate.jdbc.batch_versioned_data should be set to false when testing with Oracle
#hibernate.jdbc.batch_versioned_data true
## Configs for spatial databases (used during testin on local dev environment).
## Configs for spatial databases (used during testing on local dev environment).
#hibernate.dialect org.hibernate.spatial.dialect.postgis.PostgisDialect
#hibernate.connection.driver_class org.postgresql.Driver
#hibernate.connection.url jdbc:postgresql://localhost:5432:hibbrtru
#hibernate.connection.username hibbrtru
#hibernate.connection.password hibbrtru
hibernate.dialect org.hibernate.spatial.dialect.postgis.PostgisDialect
hibernate.connection.driver_class org.postgresql.Driver
hibernate.connection.url jdbc:postgresql://localhost:5432:hibbrtru
hibernate.connection.username hibbrtru
hibernate.connection.password hibbrtru
#hibernate.dialect org.hibernate.spatial.dialect.oracle.OracleSpatial10gDialect
#hibernate.connection.driver_class oracle.jdbc.driver.OracleDriver