polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nic...@apache.org
Subject [2/3] polygene-java git commit: Unifying the clean up of SQL tests, as they caused a lot of problems. Removed a "throws Exception" in AbstractPolygeneBaseTest.tearDown(), which is effectively breaking test compatibility, but I think worth it in the long
Date Fri, 27 Oct 2017 07:37:27 GMT
Unifying the clean up of SQL tests, as they caused a lot of problems. Removed a "throws Exception" in AbstractPolygeneBaseTest.tearDown(), which is effectively breaking test compatibility, but I think worth it in the long run.


Project: http://git-wip-us.apache.org/repos/asf/polygene-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/polygene-java/commit/27dc60c4
Tree: http://git-wip-us.apache.org/repos/asf/polygene-java/tree/27dc60c4
Diff: http://git-wip-us.apache.org/repos/asf/polygene-java/diff/27dc60c4

Branch: refs/heads/develop
Commit: 27dc60c49ca888aebdac027c47217d9af012a280
Parents: f6a5b33
Author: niclas <niclas@hedhman.org>
Authored: Fri Oct 27 13:34:40 2017 +0800
Committer: niclas <niclas@hedhman.org>
Committed: Fri Oct 27 13:34:40 2017 +0800

----------------------------------------------------------------------
 .../CachingInjectionProviderDecorator.java      |   1 -
 .../polygene/test/AbstractPolygeneBaseTest.java |  10 +-
 .../polygene/test/AbstractPolygeneTest.java     |   1 -
 .../test/entity/AbstractEntityStoreTest.java    |   5 +-
 ...stractPolygeneMultiLayeredTestWithModel.java |  38 +++++--
 .../test/indexing/AbstractAnyQueryTest.java     |   1 -
 .../cassandra/CassandraEntityStoreTest.java     |   1 -
 .../CassandraEntityStoreTestSuite.java          |   1 -
 .../hazelcast/HazelcastEntityStoreTest.java     |   1 -
 .../HazelcastEntityStoreTestSuite.java          |   1 -
 .../mongodb/MongoDBEntityStoreTest.java         |   1 -
 .../mongodb/MongoDBEntityStoreTestSuite.java    |   1 -
 .../MongoDBEntityStoreWithCacheTest.java        |   1 -
 .../PreferencesEntityStoreTestSuite.java        |  10 +-
 .../entitystore/redis/RedisEntityStoreTest.java |   1 -
 .../redis/RedisEntityStoreTestSuite.java        |   1 -
 .../redis/RedisEntityStoreWithCacheTest.java    |   1 -
 .../entitystore/riak/RiakEntityStoreTest.java   |   2 +-
 .../riak/RiakEntityStoreTestSuite.java          |   1 -
 .../riak/RiakEntityStoreWithCacheTest.java      |   2 +-
 .../polygene/entitystore/riak/RiakFixture.java  |  20 ++--
 .../entitystore/sql/JooqDslContext.java         |  18 +---
 .../sql/SqlEntityStoreConfiguration.java        |  12 +--
 .../entitystore/sql/SqlEntityStoreMixin.java    |   1 -
 .../polygene/entitystore/sql/SqlTable.java      |  13 +--
 .../polygene/entitystore/sql/SqlType.java       |   1 -
 .../polygene/entitystore/sql/TypesTable.java    |   1 -
 .../sql/DerbySQLEntityStoreTest.java            |  34 +-----
 .../sql/DerbySQLEntityStoreTestSuite.java       |  25 +----
 .../entitystore/sql/H2SQLEntityStoreTest.java   |   9 +-
 .../sql/H2SQLEntityStoreTestSuite.java          |   8 +-
 .../entitystore/sql/MariaDbEntityStoreTest.java |  15 +--
 .../sql/MariaDbEntityStoreTestSuite.java        |  11 +-
 .../entitystore/sql/MySQLEntityStoreTest.java   |  14 +--
 .../sql/MySQLEntityStoreTestSuite.java          |   9 +-
 .../sql/PostgreSQLEntityStoreTest.java          |  14 +--
 .../sql/PostgreSQLEntityStoreTestSuite.java     |   9 +-
 .../entitystore/sql/SQLiteEntityStoreTest.java  |   8 +-
 .../sql/SQLiteEntityStoreTestSuite.java         |   9 +-
 .../entitystore/sql/SqlEntityStoreTest.java     |   9 +-
 .../polygene/entitystore/sql/TearDown.java      | 100 ++++++++++++++++++
 .../polygene/entitystore/sql/TearDownUtil.java  |  44 --------
 .../test/resources/maridb-datasource.properties |  25 +++++
 extensions/entitystore-sqlkv/build.gradle       |   2 -
 .../entitystore-sqlkv/src/docs/es-sqlkv.txt     |   2 -
 .../sqlkv/SQLEntityStoreConfiguration.java      |  12 +--
 .../entitystore/sqlkv/SQLEntityStoreMixin.java  | 102 ++++++------------
 .../AbstractSQLEntityStoreAssembler.java        |  21 +---
 .../assembly/DerbySQLEntityStoreAssembler.java  |   3 +-
 .../MariaDbSQLEntityStoreAssembler.java         |  35 +++++++
 .../polygene/entitystore/sql/changelog.xml      |  37 -------
 .../sqlkv/DerbySQLEntityStoreTest.java          |  37 +------
 .../sqlkv/DerbySQLEntityStoreTestSuite.java     |  36 +------
 .../entitystore/sqlkv/H2SQLEntityStoreTest.java |  12 ++-
 .../sqlkv/H2SQLEntityStoreTestSuite.java        |   9 ++
 .../sqlkv/MariaDbEntityStoreTest.java           | 103 +++++++++++++++++++
 .../sqlkv/MariaDbEntityStoreTestSuite.java      |  92 +++++++++++++++++
 .../entitystore/sqlkv/MySQLEntityStoreTest.java |  41 ++------
 .../sqlkv/MySQLEntityStoreTestSuite.java        |  43 ++------
 .../sqlkv/PostgreSQLEntityStoreTest.java        |  36 +------
 .../sqlkv/PostgreSQLEntityStoreTestSuite.java   |  39 +------
 .../sqlkv/SQLiteEntityStoreTest.java            |   9 ++
 .../sqlkv/SQLiteEntityStoreTestSuite.java       |   9 ++
 .../polygene/entitystore/sqlkv/TearDown.java    |  81 +++++++++++++++
 .../library/alarm/AlarmHistoryImplTest.java     |   1 -
 .../library/alarm/AlarmPointImplTest.java       |   1 -
 .../library/alarm/AlarmServiceTest.java         |   1 -
 .../library/alarm/ExtendedAlarmModelTest.java   |   1 -
 .../library/alarm/SimpleAlarmModelTest.java     |   1 -
 .../library/alarm/StandardAlarmModelTest.java   |   1 -
 .../sql/DerbySQLEntityStorePerformanceTest.java |   3 +-
 71 files changed, 681 insertions(+), 579 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/polygene-java/blob/27dc60c4/core/runtime/src/main/java/org/apache/polygene/runtime/injection/provider/CachingInjectionProviderDecorator.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/injection/provider/CachingInjectionProviderDecorator.java b/core/runtime/src/main/java/org/apache/polygene/runtime/injection/provider/CachingInjectionProviderDecorator.java
index 3339a48..c1e82b9 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/injection/provider/CachingInjectionProviderDecorator.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/injection/provider/CachingInjectionProviderDecorator.java
@@ -57,7 +57,6 @@ public final class CachingInjectionProviderDecorator
                 }
             }
         }
-
         return singletonInstance;
     }
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/27dc60c4/core/testsupport/src/main/java/org/apache/polygene/test/AbstractPolygeneBaseTest.java
----------------------------------------------------------------------
diff --git a/core/testsupport/src/main/java/org/apache/polygene/test/AbstractPolygeneBaseTest.java b/core/testsupport/src/main/java/org/apache/polygene/test/AbstractPolygeneBaseTest.java
index 6d7d6ba..177edb3 100644
--- a/core/testsupport/src/main/java/org/apache/polygene/test/AbstractPolygeneBaseTest.java
+++ b/core/testsupport/src/main/java/org/apache/polygene/test/AbstractPolygeneBaseTest.java
@@ -19,6 +19,7 @@
  */
 package org.apache.polygene.test;
 
+import org.apache.polygene.api.activation.PassivationException;
 import org.apache.polygene.test.util.NotYetImplemented;
 import org.junit.After;
 import org.junit.Before;
@@ -119,11 +120,16 @@ public abstract class AbstractPolygeneBaseTest
 
     @After
     public void tearDown()
-        throws Exception
     {
         if( application != null )
         {
-            application.passivate();
+            try
+            {
+                application.passivate();
+            } catch( Exception e )
+            {
+                throw new RuntimeException( "Unable to shut down test harness cleanly.", e );
+            }
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/27dc60c4/core/testsupport/src/main/java/org/apache/polygene/test/AbstractPolygeneTest.java
----------------------------------------------------------------------
diff --git a/core/testsupport/src/main/java/org/apache/polygene/test/AbstractPolygeneTest.java b/core/testsupport/src/main/java/org/apache/polygene/test/AbstractPolygeneTest.java
index 43193be..e1bad60 100644
--- a/core/testsupport/src/main/java/org/apache/polygene/test/AbstractPolygeneTest.java
+++ b/core/testsupport/src/main/java/org/apache/polygene/test/AbstractPolygeneTest.java
@@ -90,7 +90,6 @@ public abstract class AbstractPolygeneTest extends AbstractPolygeneBaseTest
     @After
     @Override
     public void tearDown()
-        throws Exception
     {
         if( unitOfWorkFactory != null && unitOfWorkFactory.isUnitOfWorkActive() )
         {

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/27dc60c4/core/testsupport/src/main/java/org/apache/polygene/test/entity/AbstractEntityStoreTest.java
----------------------------------------------------------------------
diff --git a/core/testsupport/src/main/java/org/apache/polygene/test/entity/AbstractEntityStoreTest.java b/core/testsupport/src/main/java/org/apache/polygene/test/entity/AbstractEntityStoreTest.java
index 7e0fd71..5e674e9 100644
--- a/core/testsupport/src/main/java/org/apache/polygene/test/entity/AbstractEntityStoreTest.java
+++ b/core/testsupport/src/main/java/org/apache/polygene/test/entity/AbstractEntityStoreTest.java
@@ -55,7 +55,6 @@ import org.apache.polygene.spi.entity.EntityState;
 import org.apache.polygene.spi.entitystore.EntityStore;
 import org.apache.polygene.test.AbstractPolygeneTest;
 import org.junit.After;
-import org.junit.Ignore;
 import org.junit.Test;
 
 import static java.time.ZoneOffset.UTC;
@@ -77,7 +76,8 @@ public abstract class AbstractEntityStoreTest
     private EntityStore store;
 
     @Structure
-    private Module moduleInstance;
+    protected Module moduleInstance;
+
     private ZonedDateTime refDate = ZonedDateTime.of( 2020, 3, 4, 13, 24, 35, 0, UTC );
 
     @Override
@@ -91,7 +91,6 @@ public abstract class AbstractEntityStoreTest
     @Override
     @After
     public void tearDown()
-        throws Exception
     {
         super.tearDown();
     }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/27dc60c4/core/testsupport/src/main/java/org/apache/polygene/test/entity/model/AbstractPolygeneMultiLayeredTestWithModel.java
----------------------------------------------------------------------
diff --git a/core/testsupport/src/main/java/org/apache/polygene/test/entity/model/AbstractPolygeneMultiLayeredTestWithModel.java b/core/testsupport/src/main/java/org/apache/polygene/test/entity/model/AbstractPolygeneMultiLayeredTestWithModel.java
index 0c0500d..aa8abf9 100644
--- a/core/testsupport/src/main/java/org/apache/polygene/test/entity/model/AbstractPolygeneMultiLayeredTestWithModel.java
+++ b/core/testsupport/src/main/java/org/apache/polygene/test/entity/model/AbstractPolygeneMultiLayeredTestWithModel.java
@@ -30,6 +30,7 @@ import org.apache.polygene.api.identity.Identity;
 import org.apache.polygene.api.injection.scope.Service;
 import org.apache.polygene.api.injection.scope.Structure;
 import org.apache.polygene.api.object.ObjectFactory;
+import org.apache.polygene.api.service.ServiceFinder;
 import org.apache.polygene.api.structure.Application;
 import org.apache.polygene.api.structure.ApplicationDescriptor;
 import org.apache.polygene.api.structure.Module;
@@ -71,9 +72,24 @@ public abstract class AbstractPolygeneMultiLayeredTestWithModel extends Abstract
     private static final String FRIEND = "Friend";
     private static final String COLLEAGUE = "Colleague";
 
+    protected static final String ACCESS_LAYER = "Access Layer";
+    protected static final String DOMAIN_LAYER = "Domain Layer";
+    protected static final String INFRASTRUCTURE_LAYER = "Infrastructure Layer";
+    protected static final String CONFIGURATION_LAYER = "Configuration Layer";
+    protected static final String CONFIGURATION_MODULE = "Configuration Module";
+    protected static final String SERIALIZATION_MODULE = "Serialization Module";
+    protected static final String STORAGE_MODULE = "Storage Module";
+    protected static final String MONETARY_MODULE = "Monetary Module";
+    protected static final String PEOPLE_MODULE = "People Module";
+    protected static final String LEGAL_MODULE = "Legal Module";
+    protected static final String TEST_CASE_MODULE = "TestCase Module";
+
     protected ModuleAssembly configModule;
 
     @Structure
+    protected Module configurationModule;
+
+    @Structure
     protected ValueBuilderFactory valueBuilderFactory;
 
     @Structure
@@ -89,18 +105,18 @@ public abstract class AbstractPolygeneMultiLayeredTestWithModel extends Abstract
     protected void defineApplication( ApplicationAssembly applicationAssembly )
         throws AssemblyException
     {
-        LayerAssembly accessLayer = applicationAssembly.layer( "Access Layer" );
-        LayerAssembly domainLayer = applicationAssembly.layer( "Domain Layer" );
-        LayerAssembly infrastructureLayer = applicationAssembly.layer( "Infrastructure Layer" );
-        LayerAssembly configLayer = applicationAssembly.layer( "Configuration Layer" );
+        LayerAssembly accessLayer = applicationAssembly.layer( ACCESS_LAYER );
+        LayerAssembly domainLayer = applicationAssembly.layer( DOMAIN_LAYER );
+        LayerAssembly infrastructureLayer = applicationAssembly.layer( INFRASTRUCTURE_LAYER );
+        LayerAssembly configLayer = applicationAssembly.layer( CONFIGURATION_LAYER );
         accessLayer.uses( domainLayer.uses( infrastructureLayer.uses( configLayer ) ) );
-        defineConfigModule( configLayer.module( "Configuration Module" ) );
-        defineSerializationModule( configLayer.module( "Serialization Module" ) );
-        defineStorageModule( infrastructureLayer.module( "Storage Module" ) );
-        defineMonetaryModule( domainLayer.module( "Monetary Module" ) );
-        definePeopleModule( domainLayer.module( "People Module" ) );
-        defineLegalModule( domainLayer.module( "Legal Module" ) );
-        defineTestModule( accessLayer.module( "TestCase Module" ) );
+        defineConfigModule( configLayer.module( CONFIGURATION_MODULE ) );
+        defineSerializationModule( configLayer.module( SERIALIZATION_MODULE ) );
+        defineStorageModule( infrastructureLayer.module( STORAGE_MODULE ) );
+        defineMonetaryModule( domainLayer.module( MONETARY_MODULE ) );
+        definePeopleModule( domainLayer.module( PEOPLE_MODULE ) );
+        defineLegalModule( domainLayer.module( LEGAL_MODULE ) );
+        defineTestModule( accessLayer.module( TEST_CASE_MODULE ) );
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/27dc60c4/core/testsupport/src/main/java/org/apache/polygene/test/indexing/AbstractAnyQueryTest.java
----------------------------------------------------------------------
diff --git a/core/testsupport/src/main/java/org/apache/polygene/test/indexing/AbstractAnyQueryTest.java b/core/testsupport/src/main/java/org/apache/polygene/test/indexing/AbstractAnyQueryTest.java
index eb3ffa0..120772b 100644
--- a/core/testsupport/src/main/java/org/apache/polygene/test/indexing/AbstractAnyQueryTest.java
+++ b/core/testsupport/src/main/java/org/apache/polygene/test/indexing/AbstractAnyQueryTest.java
@@ -88,7 +88,6 @@ public class AbstractAnyQueryTest
 
     @Override
     public void tearDown()
-        throws Exception
     {
         if( this.unitOfWork != null )
         {

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/27dc60c4/extensions/entitystore-cassandra/src/test/java/org/apache/polygene/entitystore/cassandra/CassandraEntityStoreTest.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-cassandra/src/test/java/org/apache/polygene/entitystore/cassandra/CassandraEntityStoreTest.java b/extensions/entitystore-cassandra/src/test/java/org/apache/polygene/entitystore/cassandra/CassandraEntityStoreTest.java
index 0e0084b..9d7e83d 100644
--- a/extensions/entitystore-cassandra/src/test/java/org/apache/polygene/entitystore/cassandra/CassandraEntityStoreTest.java
+++ b/extensions/entitystore-cassandra/src/test/java/org/apache/polygene/entitystore/cassandra/CassandraEntityStoreTest.java
@@ -76,7 +76,6 @@ public class CassandraEntityStoreTest
 
     @Override
     public void tearDown()
-        throws Exception
     {
         CanRemoveAll cleaner = serviceFinder.findService( CanRemoveAll.class ).get();
         cleaner.removeAll();

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/27dc60c4/extensions/entitystore-cassandra/src/test/java/org/apache/polygene/entitystore/cassandra/CassandraEntityStoreTestSuite.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-cassandra/src/test/java/org/apache/polygene/entitystore/cassandra/CassandraEntityStoreTestSuite.java b/extensions/entitystore-cassandra/src/test/java/org/apache/polygene/entitystore/cassandra/CassandraEntityStoreTestSuite.java
index 3908a73..9841d7d 100644
--- a/extensions/entitystore-cassandra/src/test/java/org/apache/polygene/entitystore/cassandra/CassandraEntityStoreTestSuite.java
+++ b/extensions/entitystore-cassandra/src/test/java/org/apache/polygene/entitystore/cassandra/CassandraEntityStoreTestSuite.java
@@ -63,7 +63,6 @@ public class CassandraEntityStoreTestSuite extends EntityStoreTestSuite
 
     @Override
     public void tearDown()
-        throws Exception
     {
         Module module = application.findModule( "Infrastructure Layer", "Storage Module" );
         ServiceReference<CanRemoveAll> cleaner = module.serviceFinder().findService( CanRemoveAll.class );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/27dc60c4/extensions/entitystore-hazelcast/src/test/java/org/apache/polygene/entitystore/hazelcast/HazelcastEntityStoreTest.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-hazelcast/src/test/java/org/apache/polygene/entitystore/hazelcast/HazelcastEntityStoreTest.java b/extensions/entitystore-hazelcast/src/test/java/org/apache/polygene/entitystore/hazelcast/HazelcastEntityStoreTest.java
index 37ee7f5..c159995 100644
--- a/extensions/entitystore-hazelcast/src/test/java/org/apache/polygene/entitystore/hazelcast/HazelcastEntityStoreTest.java
+++ b/extensions/entitystore-hazelcast/src/test/java/org/apache/polygene/entitystore/hazelcast/HazelcastEntityStoreTest.java
@@ -58,7 +58,6 @@ public class HazelcastEntityStoreTest
     @After
     @Override
     public void tearDown()
-        throws Exception
     {
         super.tearDown();
         // TODO : delete test data

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/27dc60c4/extensions/entitystore-hazelcast/src/test/java/org/apache/polygene/entitystore/hazelcast/HazelcastEntityStoreTestSuite.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-hazelcast/src/test/java/org/apache/polygene/entitystore/hazelcast/HazelcastEntityStoreTestSuite.java b/extensions/entitystore-hazelcast/src/test/java/org/apache/polygene/entitystore/hazelcast/HazelcastEntityStoreTestSuite.java
index 346f0ea..e1334b1 100644
--- a/extensions/entitystore-hazelcast/src/test/java/org/apache/polygene/entitystore/hazelcast/HazelcastEntityStoreTestSuite.java
+++ b/extensions/entitystore-hazelcast/src/test/java/org/apache/polygene/entitystore/hazelcast/HazelcastEntityStoreTestSuite.java
@@ -40,7 +40,6 @@ public class HazelcastEntityStoreTestSuite extends EntityStoreTestSuite
     @After
     @Override
     public void tearDown()
-        throws Exception
     {
         super.tearDown();
         // TODO : delete test data

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/27dc60c4/extensions/entitystore-mongodb/src/test/java/org/apache/polygene/entitystore/mongodb/MongoDBEntityStoreTest.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-mongodb/src/test/java/org/apache/polygene/entitystore/mongodb/MongoDBEntityStoreTest.java b/extensions/entitystore-mongodb/src/test/java/org/apache/polygene/entitystore/mongodb/MongoDBEntityStoreTest.java
index 8a7876a..d4194da 100644
--- a/extensions/entitystore-mongodb/src/test/java/org/apache/polygene/entitystore/mongodb/MongoDBEntityStoreTest.java
+++ b/extensions/entitystore-mongodb/src/test/java/org/apache/polygene/entitystore/mongodb/MongoDBEntityStoreTest.java
@@ -77,7 +77,6 @@ public class MongoDBEntityStoreTest extends AbstractEntityStoreTest
 
     @Override
     public void tearDown()
-        throws Exception
     {
         mongo.dropDatabase( dbName );
         super.tearDown();

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/27dc60c4/extensions/entitystore-mongodb/src/test/java/org/apache/polygene/entitystore/mongodb/MongoDBEntityStoreTestSuite.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-mongodb/src/test/java/org/apache/polygene/entitystore/mongodb/MongoDBEntityStoreTestSuite.java b/extensions/entitystore-mongodb/src/test/java/org/apache/polygene/entitystore/mongodb/MongoDBEntityStoreTestSuite.java
index 109ff43..64852ca 100644
--- a/extensions/entitystore-mongodb/src/test/java/org/apache/polygene/entitystore/mongodb/MongoDBEntityStoreTestSuite.java
+++ b/extensions/entitystore-mongodb/src/test/java/org/apache/polygene/entitystore/mongodb/MongoDBEntityStoreTestSuite.java
@@ -69,7 +69,6 @@ public class MongoDBEntityStoreTestSuite extends EntityStoreTestSuite
 
     @Override
     public void tearDown()
-        throws Exception
     {
         mongo.dropDatabase( dbName );
         super.tearDown();

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/27dc60c4/extensions/entitystore-mongodb/src/test/java/org/apache/polygene/entitystore/mongodb/MongoDBEntityStoreWithCacheTest.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-mongodb/src/test/java/org/apache/polygene/entitystore/mongodb/MongoDBEntityStoreWithCacheTest.java b/extensions/entitystore-mongodb/src/test/java/org/apache/polygene/entitystore/mongodb/MongoDBEntityStoreWithCacheTest.java
index 8fab686..b334ead 100644
--- a/extensions/entitystore-mongodb/src/test/java/org/apache/polygene/entitystore/mongodb/MongoDBEntityStoreWithCacheTest.java
+++ b/extensions/entitystore-mongodb/src/test/java/org/apache/polygene/entitystore/mongodb/MongoDBEntityStoreWithCacheTest.java
@@ -73,7 +73,6 @@ public class MongoDBEntityStoreWithCacheTest
 
     @Override
     public void tearDown()
-        throws Exception
     {
         mongo.dropDatabase( dbName );
         super.tearDown();

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/27dc60c4/extensions/entitystore-preferences/src/test/java/org/apache/polygene/entitystore/preferences/PreferencesEntityStoreTestSuite.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-preferences/src/test/java/org/apache/polygene/entitystore/preferences/PreferencesEntityStoreTestSuite.java b/extensions/entitystore-preferences/src/test/java/org/apache/polygene/entitystore/preferences/PreferencesEntityStoreTestSuite.java
index 4ca18b4..6aaa6fa 100644
--- a/extensions/entitystore-preferences/src/test/java/org/apache/polygene/entitystore/preferences/PreferencesEntityStoreTestSuite.java
+++ b/extensions/entitystore-preferences/src/test/java/org/apache/polygene/entitystore/preferences/PreferencesEntityStoreTestSuite.java
@@ -49,8 +49,14 @@ public class PreferencesEntityStoreTestSuite extends EntityStoreTestSuite
 
     @After
     public void tearDown()
-        throws BackingStoreException
     {
-        rootNode.removeNode();
+        try
+        {
+            rootNode.removeNode();
+        }
+        catch( BackingStoreException e )
+        {
+            throw new RuntimeException( e );
+        }
     }
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/27dc60c4/extensions/entitystore-redis/src/test/java/org/apache/polygene/entitystore/redis/RedisEntityStoreTest.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-redis/src/test/java/org/apache/polygene/entitystore/redis/RedisEntityStoreTest.java b/extensions/entitystore-redis/src/test/java/org/apache/polygene/entitystore/redis/RedisEntityStoreTest.java
index 401f703..f678b72 100644
--- a/extensions/entitystore-redis/src/test/java/org/apache/polygene/entitystore/redis/RedisEntityStoreTest.java
+++ b/extensions/entitystore-redis/src/test/java/org/apache/polygene/entitystore/redis/RedisEntityStoreTest.java
@@ -69,7 +69,6 @@ public class RedisEntityStoreTest
 
     @Override
     public void tearDown()
-        throws Exception
     {
         try( Jedis jedis = jedisPool.getResource() )
         {

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/27dc60c4/extensions/entitystore-redis/src/test/java/org/apache/polygene/entitystore/redis/RedisEntityStoreTestSuite.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-redis/src/test/java/org/apache/polygene/entitystore/redis/RedisEntityStoreTestSuite.java b/extensions/entitystore-redis/src/test/java/org/apache/polygene/entitystore/redis/RedisEntityStoreTestSuite.java
index 6ae99a1..bcc9249 100644
--- a/extensions/entitystore-redis/src/test/java/org/apache/polygene/entitystore/redis/RedisEntityStoreTestSuite.java
+++ b/extensions/entitystore-redis/src/test/java/org/apache/polygene/entitystore/redis/RedisEntityStoreTestSuite.java
@@ -63,7 +63,6 @@ public class RedisEntityStoreTestSuite extends EntityStoreTestSuite
 
     @Override
     public void tearDown()
-        throws Exception
     {
         try( Jedis jedis = jedisPool.getResource() )
         {

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/27dc60c4/extensions/entitystore-redis/src/test/java/org/apache/polygene/entitystore/redis/RedisEntityStoreWithCacheTest.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-redis/src/test/java/org/apache/polygene/entitystore/redis/RedisEntityStoreWithCacheTest.java b/extensions/entitystore-redis/src/test/java/org/apache/polygene/entitystore/redis/RedisEntityStoreWithCacheTest.java
index c51909c..a229be2 100644
--- a/extensions/entitystore-redis/src/test/java/org/apache/polygene/entitystore/redis/RedisEntityStoreWithCacheTest.java
+++ b/extensions/entitystore-redis/src/test/java/org/apache/polygene/entitystore/redis/RedisEntityStoreWithCacheTest.java
@@ -63,7 +63,6 @@ public class RedisEntityStoreWithCacheTest
 
     @Override
     public void tearDown()
-        throws Exception
     {
         try( Jedis jedis = jedisPool.getResource() )
         {

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/27dc60c4/extensions/entitystore-riak/src/test/java/org/apache/polygene/entitystore/riak/RiakEntityStoreTest.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-riak/src/test/java/org/apache/polygene/entitystore/riak/RiakEntityStoreTest.java b/extensions/entitystore-riak/src/test/java/org/apache/polygene/entitystore/riak/RiakEntityStoreTest.java
index 9a52e30..145f7a8 100644
--- a/extensions/entitystore-riak/src/test/java/org/apache/polygene/entitystore/riak/RiakEntityStoreTest.java
+++ b/extensions/entitystore-riak/src/test/java/org/apache/polygene/entitystore/riak/RiakEntityStoreTest.java
@@ -43,7 +43,7 @@ public class RiakEntityStoreTest extends AbstractEntityStoreTest
     }
 
     @Override
-    public void tearDown() throws Exception
+    public void tearDown()
     {
         riakFixture.deleteTestData();
         super.tearDown();

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/27dc60c4/extensions/entitystore-riak/src/test/java/org/apache/polygene/entitystore/riak/RiakEntityStoreTestSuite.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-riak/src/test/java/org/apache/polygene/entitystore/riak/RiakEntityStoreTestSuite.java b/extensions/entitystore-riak/src/test/java/org/apache/polygene/entitystore/riak/RiakEntityStoreTestSuite.java
index 14828ff..0974da7 100644
--- a/extensions/entitystore-riak/src/test/java/org/apache/polygene/entitystore/riak/RiakEntityStoreTestSuite.java
+++ b/extensions/entitystore-riak/src/test/java/org/apache/polygene/entitystore/riak/RiakEntityStoreTestSuite.java
@@ -51,7 +51,6 @@ public class RiakEntityStoreTestSuite extends EntityStoreTestSuite
 
     @Override
     public void tearDown()
-        throws Exception
     {
         riakFixture.deleteTestData();
         super.tearDown();

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/27dc60c4/extensions/entitystore-riak/src/test/java/org/apache/polygene/entitystore/riak/RiakEntityStoreWithCacheTest.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-riak/src/test/java/org/apache/polygene/entitystore/riak/RiakEntityStoreWithCacheTest.java b/extensions/entitystore-riak/src/test/java/org/apache/polygene/entitystore/riak/RiakEntityStoreWithCacheTest.java
index 13f5b36..7e20235 100644
--- a/extensions/entitystore-riak/src/test/java/org/apache/polygene/entitystore/riak/RiakEntityStoreWithCacheTest.java
+++ b/extensions/entitystore-riak/src/test/java/org/apache/polygene/entitystore/riak/RiakEntityStoreWithCacheTest.java
@@ -46,7 +46,7 @@ public class RiakEntityStoreWithCacheTest extends AbstractEntityStoreWithCacheTe
     }
 
     @Override
-    public void tearDown() throws Exception
+    public void tearDown()
     {
         riakFixture.deleteTestData();
         super.tearDown();

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/27dc60c4/extensions/entitystore-riak/src/test/java/org/apache/polygene/entitystore/riak/RiakFixture.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-riak/src/test/java/org/apache/polygene/entitystore/riak/RiakFixture.java b/extensions/entitystore-riak/src/test/java/org/apache/polygene/entitystore/riak/RiakFixture.java
index 4e05602..e932fb9 100644
--- a/extensions/entitystore-riak/src/test/java/org/apache/polygene/entitystore/riak/RiakFixture.java
+++ b/extensions/entitystore-riak/src/test/java/org/apache/polygene/entitystore/riak/RiakFixture.java
@@ -52,17 +52,25 @@ class RiakFixture
         System.out.println( ">> Riak HealthCheck END, took " + java.time.Duration.between( start, Instant.now() ) );
     }
 
-    void deleteTestData() throws ExecutionException, InterruptedException
+    void deleteTestData()
     {
         // Riak doesn't expose bucket deletion in its API so we empty it
         if( namespace != null )
         {
-            ListKeys listKeys = new ListKeys.Builder( namespace ).build();
-            ListKeys.Response listKeysResponse = client.execute( listKeys );
-            for( Location location : listKeysResponse )
+            try
+            {
+                ListKeys listKeys = new ListKeys.Builder( namespace ).build();
+                ListKeys.Response listKeysResponse = client.execute( listKeys );
+                for( Location location : listKeysResponse )
+                {
+                    DeleteValue delete = new DeleteValue.Builder( location ).build();
+                    client.execute( delete );
+                }
+            }
+            catch(Exception e )
             {
-                DeleteValue delete = new DeleteValue.Builder( location ).build();
-                client.execute( delete );
+                System.err.println("WARNING: Unable to clean up test data in RiakFixture" );
+                e.printStackTrace();
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/27dc60c4/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/JooqDslContext.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/JooqDslContext.java b/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/JooqDslContext.java
index b73978f..47e01ad 100644
--- a/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/JooqDslContext.java
+++ b/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/JooqDslContext.java
@@ -29,7 +29,6 @@ import org.jooq.DSLContext;
 import org.jooq.Name;
 import org.jooq.Record;
 import org.jooq.SQLDialect;
-import org.jooq.Schema;
 import org.jooq.Table;
 import org.jooq.TransactionProvider;
 import org.jooq.conf.Settings;
@@ -41,8 +40,6 @@ import org.jooq.impl.ThreadLocalTransactionProvider;
 @Mixins( JooqDslContext.Mixin.class )
 public interface JooqDslContext extends DSLContext
 {
-    boolean isSchemaCapable();
-
     Name tableNameOf( String tableName );
 
     Table<Record> tableOf( String tableName );
@@ -50,12 +47,10 @@ public interface JooqDslContext extends DSLContext
     class Mixin
         implements InvocationHandler
     {
-        private final Schema schema;
         private final DSLContext dsl;
 
-        public Mixin( @Service DataSource dataSource, @Uses Settings settings, @Uses SQLDialect dialect, @Uses Schema schema )
+        public Mixin( @Service DataSource dataSource, @Uses Settings settings, @Uses SQLDialect dialect )
         {
-            this.schema = schema;
             ConnectionProvider connectionProvider = new DataSourceConnectionProvider( dataSource );
             TransactionProvider transactionProvider = new ThreadLocalTransactionProvider( connectionProvider, false );
             Configuration configuration = new DefaultConfiguration()
@@ -79,21 +74,12 @@ public interface JooqDslContext extends DSLContext
                 return tableNameOf( (String) args[ 0 ] );
             }
 
-            if( method.getName().equals( "isSchemaCapable" ) )
-            {
-                return isSchemaCapable();
-            }
             return method.invoke( dsl, args );       // delegate all
         }
 
         private Name tableNameOf( String name )
         {
-            return this.isSchemaCapable() ? DSL.name( schema.getName(), name ) : DSL.name( name );
-        }
-
-        private boolean isSchemaCapable()
-        {
-            return !dsl.dialect().equals( SQLDialect.SQLITE ) && !dsl.dialect().equals( SQLDialect.MYSQL ) && !dsl.dialect().equals( SQLDialect.DERBY );
+            return DSL.name( name );
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/27dc60c4/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/SqlEntityStoreConfiguration.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/SqlEntityStoreConfiguration.java b/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/SqlEntityStoreConfiguration.java
index e93d7a3..6c01231 100644
--- a/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/SqlEntityStoreConfiguration.java
+++ b/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/SqlEntityStoreConfiguration.java
@@ -22,17 +22,9 @@ import org.apache.polygene.api.property.Property;
 import org.apache.polygene.library.sql.common.SQLConfiguration;
 
 // START SNIPPET: config
-public interface SqlEntityStoreConfiguration extends SQLConfiguration
+public interface SqlEntityStoreConfiguration
 {
     /**
-     * Name of the database schema to use.
-     * Ignored on SQL databases that don't support schemas.
-     */
-    @UseDefaults( "POLYGENE" )
-    @Override
-    Property<String> schemaName();
-
-    /**
      * Name of the entities table.
      * <p>
      * This table contains the Identity and other metadata about each entity instance
@@ -54,7 +46,7 @@ public interface SqlEntityStoreConfiguration extends SQLConfiguration
     Property<String> typesTableName();
 
     /**
-     * Defines whether the database schema and table should be created if not already present.
+     * Defines whether the database table should be created if not already present.
      */
     @UseDefaults( "true" )
     Property<Boolean> createIfMissing();

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/27dc60c4/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/SqlEntityStoreMixin.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/SqlEntityStoreMixin.java b/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/SqlEntityStoreMixin.java
index b2715ce..c1e7985 100644
--- a/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/SqlEntityStoreMixin.java
+++ b/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/SqlEntityStoreMixin.java
@@ -17,7 +17,6 @@
  */
 package org.apache.polygene.entitystore.sql;
 
-import java.math.BigInteger;
 import java.time.Instant;
 import java.util.ArrayList;
 import java.util.HashMap;

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/27dc60c4/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/SqlTable.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/SqlTable.java b/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/SqlTable.java
index 1d8018e..3652ada 100644
--- a/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/SqlTable.java
+++ b/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/SqlTable.java
@@ -37,7 +37,6 @@ import org.apache.polygene.spi.entitystore.EntityStoreUnitOfWork;
 import org.apache.polygene.spi.entitystore.helpers.DefaultEntityState;
 import org.jooq.Record;
 import org.jooq.SQLDialect;
-import org.jooq.Schema;
 import org.jooq.SelectQuery;
 import org.jooq.conf.Settings;
 import org.jooq.impl.DSL;
@@ -197,12 +196,10 @@ public interface SqlTable extends ServiceActivation
             Settings settings = serviceDescriptor
                 .metaInfo( Settings.class );
 
-            String schemaName = config.schemaName().get();
             String typesTableName = config.typesTableName().get();
             String entitiesTableName = config.entitiesTableName().get();
-            Schema schema = DSL.schema( DSL.name( schemaName ) );
 
-            dsl = tbf.newTransient( JooqDslContext.class, settings, dialect, schema );
+            dsl = tbf.newTransient( JooqDslContext.class, settings, dialect );
 
             types = new TypesTable( dsl, dialect, typesTableName );
             entitiesTable = new EntitiesTable( dsl, types, application.version(), entitiesTableName, serialization );
@@ -210,14 +207,6 @@ public interface SqlTable extends ServiceActivation
             if( config.createIfMissing().get() )
             {
                 dsl.transaction( t -> {
-                    if( dsl.isSchemaCapable()
-                        && dsl.meta().getSchemas().stream().noneMatch( s -> schema.getName().equalsIgnoreCase( s.getName() ) ) )
-                    {
-                        dsl.createSchema( schemaName ).execute();
-                    }
-                } );
-
-                dsl.transaction( t -> {
 
                     dsl.createTableIfNotExists( dsl.tableNameOf( typesTableName ) )
                        .column( identityColumn )

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/27dc60c4/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/SqlType.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/SqlType.java b/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/SqlType.java
index 982b3f5..c522d90 100644
--- a/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/SqlType.java
+++ b/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/SqlType.java
@@ -27,7 +27,6 @@ import java.time.OffsetDateTime;
 import java.time.Period;
 import java.time.ZonedDateTime;
 import org.jooq.DataType;
-import org.jooq.impl.DefaultDataType;
 import org.jooq.impl.SQLDataType;
 import org.jooq.types.Interval;
 

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/27dc60c4/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/TypesTable.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/TypesTable.java b/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/TypesTable.java
index 9082302..c2546f1 100644
--- a/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/TypesTable.java
+++ b/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/TypesTable.java
@@ -36,7 +36,6 @@ import org.jooq.Result;
 import org.jooq.SQLDialect;
 import org.jooq.Table;
 import org.jooq.impl.DSL;
-import org.jooq.impl.DefaultDataType;
 
 public class TypesTable
     implements TableFields

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/27dc60c4/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/DerbySQLEntityStoreTest.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/DerbySQLEntityStoreTest.java b/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/DerbySQLEntityStoreTest.java
index 0cff573..aa3833b 100644
--- a/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/DerbySQLEntityStoreTest.java
+++ b/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/DerbySQLEntityStoreTest.java
@@ -19,14 +19,7 @@
  */
 package org.apache.polygene.entitystore.sql;
 
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.SQLException;
-import org.apache.derby.jdbc.AutoloadedDriver;
-import org.apache.derby.jdbc.Driver42;
-import org.apache.derby.jdbc.EmbeddedDriver;
 import org.apache.polygene.api.common.Visibility;
-import org.apache.polygene.api.structure.Module;
 import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.entitystore.sql.assembly.DerbySQLEntityStoreAssembler;
@@ -34,13 +27,12 @@ import org.apache.polygene.library.sql.assembly.DataSourceAssembler;
 import org.apache.polygene.library.sql.dbcp.DBCPDataSourceServiceAssembler;
 import org.apache.polygene.test.EntityTestAssembler;
 import org.apache.polygene.test.entity.AbstractEntityStoreTest;
+import org.jooq.SQLDialect;
+import org.junit.After;
 
 public class DerbySQLEntityStoreTest
     extends AbstractEntityStoreTest
 {
-    private String storageModuleName;
-    private String storageLayerName;
-
     @Override
     // START SNIPPET: assembly
     public void assemble( ModuleAssembly module )
@@ -48,8 +40,6 @@ public class DerbySQLEntityStoreTest
     {
         // END SNIPPET: assembly
         super.assemble( module );
-        storageModuleName = module.name();
-        storageLayerName = module.layer().name();
         ModuleAssembly config = module.layer().module( "config" );
         new EntityTestAssembler().defaultServicesVisibleIn( Visibility.layer ).assemble( config );
 
@@ -78,25 +68,9 @@ public class DerbySQLEntityStoreTest
     // END SNIPPET: assembly
 
     @Override
+    @After
     public void tearDown()
-        throws Exception
     {
-        super.tearDown();
-        try
-        {
-            DriverManager.getConnection( "jdbc:derby:memory:testdb;drop=true" );
-        }
-        catch( SQLException e )
-        {
-            // ignore, it is EXPECTED to get an exception when the database shuts down. No idea why.
-        }
-        try
-        {
-            DriverManager.getConnection( "jdbc:derby:memory:testdb;shutdown=true" );
-        }
-        catch( SQLException e )
-        {
-            // ignore, it is EXPECTED to get an exception when the database shuts down. No idea why.
-        }
+        TearDown.dropTables( moduleInstance, SQLDialect.DERBY, super::tearDown );
     }
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/27dc60c4/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/DerbySQLEntityStoreTestSuite.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/DerbySQLEntityStoreTestSuite.java b/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/DerbySQLEntityStoreTestSuite.java
index 1af981d..4ac3302 100644
--- a/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/DerbySQLEntityStoreTestSuite.java
+++ b/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/DerbySQLEntityStoreTestSuite.java
@@ -19,15 +19,14 @@
  */
 package org.apache.polygene.entitystore.sql;
 
-import java.sql.DriverManager;
-import java.sql.SQLException;
 import org.apache.polygene.api.common.Visibility;
-import org.apache.polygene.api.structure.Module;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.entitystore.sql.assembly.DerbySQLEntityStoreAssembler;
 import org.apache.polygene.library.sql.assembly.DataSourceAssembler;
 import org.apache.polygene.library.sql.dbcp.DBCPDataSourceServiceAssembler;
 import org.apache.polygene.test.entity.model.EntityStoreTestSuite;
+import org.jooq.SQLDialect;
+import org.junit.After;
 
 public class DerbySQLEntityStoreTestSuite extends EntityStoreTestSuite
 {
@@ -58,25 +57,9 @@ public class DerbySQLEntityStoreTestSuite extends EntityStoreTestSuite
     }
 
     @Override
+    @After
     public void tearDown()
-        throws Exception
     {
-        super.tearDown();
-        try
-        {
-            DriverManager.getConnection( "jdbc:derby:memory:testdb;drop=true" );
-        }
-        catch( SQLException e )
-        {
-            // ignore, it is EXPECTED to get an exception when the database shuts down. No idea why.
-        }
-        try
-        {
-            DriverManager.getConnection( "jdbc:derby:memory:testdb;shutdown=true" );
-        }
-        catch( SQLException e )
-        {
-            // ignore, it is EXPECTED to get an exception when the database shuts down. No idea why.
-        }
+        TearDown.dropTables( application.findModule( INFRASTRUCTURE_LAYER, STORAGE_MODULE ), SQLDialect.DERBY, super::tearDown );
     }
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/27dc60c4/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/H2SQLEntityStoreTest.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/H2SQLEntityStoreTest.java b/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/H2SQLEntityStoreTest.java
index eea919a..906c7c2 100644
--- a/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/H2SQLEntityStoreTest.java
+++ b/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/H2SQLEntityStoreTest.java
@@ -20,7 +20,6 @@
 package org.apache.polygene.entitystore.sql;
 
 import org.apache.polygene.api.common.Visibility;
-import org.apache.polygene.api.structure.Module;
 import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.entitystore.sql.assembly.H2SQLEntityStoreAssembler;
@@ -28,6 +27,7 @@ import org.apache.polygene.library.sql.assembly.DataSourceAssembler;
 import org.apache.polygene.library.sql.dbcp.DBCPDataSourceServiceAssembler;
 import org.apache.polygene.test.EntityTestAssembler;
 import org.apache.polygene.test.entity.AbstractEntityStoreTest;
+import org.jooq.SQLDialect;
 import org.junit.After;
 
 public class H2SQLEntityStoreTest
@@ -66,4 +66,11 @@ public class H2SQLEntityStoreTest
             .assemble( module );
     }
     // END SNIPPET: assembly
+
+    @Override
+    @After
+    public void tearDown()
+    {
+        TearDown.dropTables( moduleInstance, SQLDialect.H2, super::tearDown );
+    }
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/27dc60c4/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/H2SQLEntityStoreTestSuite.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/H2SQLEntityStoreTestSuite.java b/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/H2SQLEntityStoreTestSuite.java
index 9546dad..7c7d3f5 100644
--- a/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/H2SQLEntityStoreTestSuite.java
+++ b/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/H2SQLEntityStoreTestSuite.java
@@ -20,12 +20,12 @@
 package org.apache.polygene.entitystore.sql;
 
 import org.apache.polygene.api.common.Visibility;
-import org.apache.polygene.api.structure.Module;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.entitystore.sql.assembly.H2SQLEntityStoreAssembler;
 import org.apache.polygene.library.sql.assembly.DataSourceAssembler;
 import org.apache.polygene.library.sql.dbcp.DBCPDataSourceServiceAssembler;
 import org.apache.polygene.test.entity.model.EntityStoreTestSuite;
+import org.jooq.SQLDialect;
 import org.junit.After;
 
 public class H2SQLEntityStoreTestSuite extends EntityStoreTestSuite
@@ -56,4 +56,10 @@ public class H2SQLEntityStoreTestSuite extends EntityStoreTestSuite
             .assemble( module );
     }
 
+    @Override
+    @After
+    public void tearDown()
+    {
+        TearDown.dropTables( application.findModule( INFRASTRUCTURE_LAYER, STORAGE_MODULE ), SQLDialect.H2, super::tearDown );
+    }
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/27dc60c4/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/MariaDbEntityStoreTest.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/MariaDbEntityStoreTest.java b/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/MariaDbEntityStoreTest.java
index d1594e7..7b11e7a 100644
--- a/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/MariaDbEntityStoreTest.java
+++ b/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/MariaDbEntityStoreTest.java
@@ -21,17 +21,17 @@ package org.apache.polygene.entitystore.sql;
 
 import java.util.HashMap;
 import org.apache.polygene.api.common.Visibility;
-import org.apache.polygene.api.structure.Module;
 import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.entitystore.sql.assembly.MariaDbSQLEntityStoreAssembler;
-import org.apache.polygene.entitystore.sql.assembly.MySQLEntityStoreAssembler;
 import org.apache.polygene.library.sql.assembly.DataSourceAssembler;
 import org.apache.polygene.library.sql.datasource.DataSourceConfiguration;
 import org.apache.polygene.library.sql.dbcp.DBCPDataSourceServiceAssembler;
 import org.apache.polygene.test.EntityTestAssembler;
 import org.apache.polygene.test.docker.DockerRule;
 import org.apache.polygene.test.entity.AbstractEntityStoreTest;
+import org.jooq.SQLDialect;
+import org.junit.After;
 import org.junit.ClassRule;
 import org.junit.Ignore;
 
@@ -53,9 +53,6 @@ public class MariaDbEntityStoreTest
 //        , "mysqld: ready for connections"   TODO: add this after next release of tdomzal/junit-docker-rule
     );
 
-    private String storageModuleName;
-    private String storageLayerName;
-
     @Override
     // START SNIPPET: assembly
     public void assemble( ModuleAssembly module )
@@ -63,8 +60,6 @@ public class MariaDbEntityStoreTest
     {
         // END SNIPPET: assembly
         super.assemble( module );
-        storageModuleName = module.name();
-        storageLayerName = module.layer().name();
         ModuleAssembly config = module.layer().module( "config" );
         new EntityTestAssembler().defaultServicesVisibleIn( Visibility.layer ).assemble( config );
 
@@ -101,11 +96,9 @@ public class MariaDbEntityStoreTest
     // END SNIPPET: assembly
 
     @Override
+    @After
     public void tearDown()
-        throws Exception
     {
-        Module storageModule = application.findModule( storageLayerName, storageModuleName );
-        TearDownUtil.dropSchema( storageModule, getClass().getSimpleName() );
-        super.tearDown();
+        TearDown.dropTables( moduleInstance, SQLDialect.MARIADB, super::tearDown );
     }
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/27dc60c4/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/MariaDbEntityStoreTestSuite.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/MariaDbEntityStoreTestSuite.java b/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/MariaDbEntityStoreTestSuite.java
index e3d9254..e8e1a4d 100644
--- a/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/MariaDbEntityStoreTestSuite.java
+++ b/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/MariaDbEntityStoreTestSuite.java
@@ -21,7 +21,6 @@ package org.apache.polygene.entitystore.sql;
 
 import java.util.HashMap;
 import org.apache.polygene.api.common.Visibility;
-import org.apache.polygene.api.structure.Module;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.entitystore.sql.assembly.MySQLEntityStoreAssembler;
 import org.apache.polygene.library.sql.assembly.DataSourceAssembler;
@@ -29,6 +28,8 @@ import org.apache.polygene.library.sql.datasource.DataSourceConfiguration;
 import org.apache.polygene.library.sql.dbcp.DBCPDataSourceServiceAssembler;
 import org.apache.polygene.test.docker.DockerRule;
 import org.apache.polygene.test.entity.model.EntityStoreTestSuite;
+import org.jooq.SQLDialect;
+import org.junit.After;
 import org.junit.ClassRule;
 import org.junit.Ignore;
 
@@ -37,7 +38,7 @@ public class MariaDbEntityStoreTestSuite extends EntityStoreTestSuite
 {
     @ClassRule
     public static final DockerRule DOCKER = new DockerRule(
-        "mysql",
+        "mariadb",
         new HashMap<String, String>()
         {{
             put( "MYSQL_ROOT_PASSWORD", "" );
@@ -83,11 +84,9 @@ public class MariaDbEntityStoreTestSuite extends EntityStoreTestSuite
     }
 
     @Override
+    @After
     public void tearDown()
-        throws Exception
     {
-        Module storageModule = application.findModule( "Infrastructure Layer", "Storage Module" );
-        TearDownUtil.dropSchema( storageModule, getClass().getSimpleName() );
-        super.tearDown();
+        TearDown.dropTables( application.findModule( INFRASTRUCTURE_LAYER, STORAGE_MODULE ), SQLDialect.MARIADB, super::tearDown );
     }
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/27dc60c4/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/MySQLEntityStoreTest.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/MySQLEntityStoreTest.java b/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/MySQLEntityStoreTest.java
index 159d573..76d3736 100644
--- a/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/MySQLEntityStoreTest.java
+++ b/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/MySQLEntityStoreTest.java
@@ -21,7 +21,6 @@ package org.apache.polygene.entitystore.sql;
 
 import java.util.HashMap;
 import org.apache.polygene.api.common.Visibility;
-import org.apache.polygene.api.structure.Module;
 import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.entitystore.sql.assembly.MySQLEntityStoreAssembler;
@@ -31,6 +30,8 @@ import org.apache.polygene.library.sql.dbcp.DBCPDataSourceServiceAssembler;
 import org.apache.polygene.test.EntityTestAssembler;
 import org.apache.polygene.test.docker.DockerRule;
 import org.apache.polygene.test.entity.AbstractEntityStoreTest;
+import org.jooq.SQLDialect;
+import org.junit.After;
 import org.junit.ClassRule;
 import org.junit.Ignore;
 
@@ -52,9 +53,6 @@ public class MySQLEntityStoreTest
 //        , "mysqld: ready for connections"   TODO: add this after next release of tdomzal/junit-docker-rule
     );
 
-    private String storageModuleName;
-    private String storageLayerName;
-
     @Override
     // START SNIPPET: assembly
     public void assemble( ModuleAssembly module )
@@ -62,8 +60,6 @@ public class MySQLEntityStoreTest
     {
         // END SNIPPET: assembly
         super.assemble( module );
-        storageModuleName = module.name();
-        storageLayerName = module.layer().name();
         ModuleAssembly config = module.layer().module( "config" );
         new EntityTestAssembler().defaultServicesVisibleIn( Visibility.layer ).assemble( config );
 
@@ -100,11 +96,9 @@ public class MySQLEntityStoreTest
     // END SNIPPET: assembly
 
     @Override
+    @After
     public void tearDown()
-        throws Exception
     {
-        Module storageModule = application.findModule( storageLayerName, storageModuleName );
-        TearDownUtil.dropSchema( storageModule, getClass().getSimpleName() );
-        super.tearDown();
+        TearDown.dropTables( moduleInstance, SQLDialect.MYSQL, super::tearDown );
     }
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/27dc60c4/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/MySQLEntityStoreTestSuite.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/MySQLEntityStoreTestSuite.java b/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/MySQLEntityStoreTestSuite.java
index f84fa9d..18c7370 100644
--- a/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/MySQLEntityStoreTestSuite.java
+++ b/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/MySQLEntityStoreTestSuite.java
@@ -21,7 +21,6 @@ package org.apache.polygene.entitystore.sql;
 
 import java.util.HashMap;
 import org.apache.polygene.api.common.Visibility;
-import org.apache.polygene.api.structure.Module;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.entitystore.sql.assembly.MySQLEntityStoreAssembler;
 import org.apache.polygene.library.sql.assembly.DataSourceAssembler;
@@ -29,6 +28,8 @@ import org.apache.polygene.library.sql.datasource.DataSourceConfiguration;
 import org.apache.polygene.library.sql.dbcp.DBCPDataSourceServiceAssembler;
 import org.apache.polygene.test.docker.DockerRule;
 import org.apache.polygene.test.entity.model.EntityStoreTestSuite;
+import org.jooq.SQLDialect;
+import org.junit.After;
 import org.junit.ClassRule;
 import org.junit.Ignore;
 
@@ -83,11 +84,9 @@ public class MySQLEntityStoreTestSuite extends EntityStoreTestSuite
     }
 
     @Override
+    @After
     public void tearDown()
-        throws Exception
     {
-        Module storageModule = application.findModule( "Infrastructure Layer", "Storage Module" );
-        TearDownUtil.dropSchema( storageModule, getClass().getSimpleName() );
-        super.tearDown();
+        TearDown.dropTables( application.findModule( INFRASTRUCTURE_LAYER, STORAGE_MODULE ), SQLDialect.MYSQL, super::tearDown );
     }
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/27dc60c4/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/PostgreSQLEntityStoreTest.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/PostgreSQLEntityStoreTest.java b/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/PostgreSQLEntityStoreTest.java
index a682398..3813220 100644
--- a/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/PostgreSQLEntityStoreTest.java
+++ b/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/PostgreSQLEntityStoreTest.java
@@ -22,7 +22,6 @@ package org.apache.polygene.entitystore.sql;
 import java.util.HashMap;
 import java.util.Map;
 import org.apache.polygene.api.common.Visibility;
-import org.apache.polygene.api.structure.Module;
 import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.entitystore.sql.assembly.PostgreSQLEntityStoreAssembler;
@@ -32,6 +31,8 @@ import org.apache.polygene.library.sql.dbcp.DBCPDataSourceServiceAssembler;
 import org.apache.polygene.test.EntityTestAssembler;
 import org.apache.polygene.test.docker.DockerRule;
 import org.apache.polygene.test.entity.AbstractEntityStoreTest;
+import org.jooq.SQLDialect;
+import org.junit.After;
 import org.junit.ClassRule;
 
 public class PostgreSQLEntityStoreTest
@@ -52,9 +53,6 @@ public class PostgreSQLEntityStoreTest
                                  "PostgreSQL init process complete; ready for start up." );
     }
 
-    private String storageModuleName;
-    private String storageLayerName;
-
     @Override
     // START SNIPPET: assembly
     public void assemble( ModuleAssembly module )
@@ -62,8 +60,6 @@ public class PostgreSQLEntityStoreTest
     {
         // END SNIPPET: assembly
         super.assemble( module );
-        storageModuleName = module.name();
-        storageLayerName = module.layer().name();
         ModuleAssembly config = module.layer().module( "config" );
         new EntityTestAssembler().defaultServicesVisibleIn( Visibility.layer ).assemble( config );
 
@@ -104,11 +100,9 @@ public class PostgreSQLEntityStoreTest
     // END SNIPPET: assembly
 
     @Override
+    @After
     public void tearDown()
-        throws Exception
     {
-        Module storageModule = application.findModule( storageLayerName, storageModuleName );
-        TearDownUtil.dropSchema( storageModule, getClass().getSimpleName() );
-        super.tearDown();
+        TearDown.dropTables( moduleInstance, SQLDialect.POSTGRES, super::tearDown );
     }
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/27dc60c4/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/PostgreSQLEntityStoreTestSuite.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/PostgreSQLEntityStoreTestSuite.java b/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/PostgreSQLEntityStoreTestSuite.java
index 487ad9f..6c7dcd4 100644
--- a/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/PostgreSQLEntityStoreTestSuite.java
+++ b/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/PostgreSQLEntityStoreTestSuite.java
@@ -22,7 +22,6 @@ package org.apache.polygene.entitystore.sql;
 import java.util.HashMap;
 import java.util.Map;
 import org.apache.polygene.api.common.Visibility;
-import org.apache.polygene.api.structure.Module;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.entitystore.sql.assembly.PostgreSQLEntityStoreAssembler;
 import org.apache.polygene.library.sql.assembly.DataSourceAssembler;
@@ -30,6 +29,8 @@ import org.apache.polygene.library.sql.datasource.DataSourceConfiguration;
 import org.apache.polygene.library.sql.dbcp.DBCPDataSourceServiceAssembler;
 import org.apache.polygene.test.docker.DockerRule;
 import org.apache.polygene.test.entity.model.EntityStoreTestSuite;
+import org.jooq.SQLDialect;
+import org.junit.After;
 import org.junit.ClassRule;
 
 public class PostgreSQLEntityStoreTestSuite extends EntityStoreTestSuite
@@ -86,11 +87,9 @@ public class PostgreSQLEntityStoreTestSuite extends EntityStoreTestSuite
     // END SNIPPET: assembly
 
     @Override
+    @After
     public void tearDown()
-        throws Exception
     {
-        Module storageModule = application.findModule( "Infrastructure Layer", "Storage Module" );
-        TearDownUtil.dropSchema( storageModule, getClass().getSimpleName() );
-        super.tearDown();
+        TearDown.dropTables( application.findModule( INFRASTRUCTURE_LAYER, STORAGE_MODULE ), SQLDialect.POSTGRES, super::tearDown );
     }
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/27dc60c4/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/SQLiteEntityStoreTest.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/SQLiteEntityStoreTest.java b/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/SQLiteEntityStoreTest.java
index ad2ecc1..376f3da 100644
--- a/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/SQLiteEntityStoreTest.java
+++ b/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/SQLiteEntityStoreTest.java
@@ -20,7 +20,6 @@
 package org.apache.polygene.entitystore.sql;
 
 import org.apache.polygene.api.common.Visibility;
-import org.apache.polygene.api.structure.Module;
 import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.entitystore.sql.assembly.SQLiteEntityStoreAssembler;
@@ -28,6 +27,7 @@ import org.apache.polygene.library.sql.assembly.DataSourceAssembler;
 import org.apache.polygene.library.sql.dbcp.DBCPDataSourceServiceAssembler;
 import org.apache.polygene.test.EntityTestAssembler;
 import org.apache.polygene.test.entity.AbstractEntityStoreTest;
+import org.jooq.SQLDialect;
 import org.junit.After;
 import org.junit.BeforeClass;
 
@@ -75,4 +75,10 @@ public class SQLiteEntityStoreTest extends AbstractEntityStoreTest
     }
     // END SNIPPET: assembly
 
+    @Override
+    @After
+    public void tearDown()
+    {
+        TearDown.dropTables( moduleInstance, SQLDialect.DERBY, super::tearDown );
+    }
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/27dc60c4/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/SQLiteEntityStoreTestSuite.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/SQLiteEntityStoreTestSuite.java b/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/SQLiteEntityStoreTestSuite.java
index 39f2c05..498211e 100644
--- a/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/SQLiteEntityStoreTestSuite.java
+++ b/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/SQLiteEntityStoreTestSuite.java
@@ -20,12 +20,12 @@
 package org.apache.polygene.entitystore.sql;
 
 import org.apache.polygene.api.common.Visibility;
-import org.apache.polygene.api.structure.Module;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.entitystore.sql.assembly.SQLiteEntityStoreAssembler;
 import org.apache.polygene.library.sql.assembly.DataSourceAssembler;
 import org.apache.polygene.library.sql.dbcp.DBCPDataSourceServiceAssembler;
 import org.apache.polygene.test.entity.model.EntityStoreTestSuite;
+import org.jooq.SQLDialect;
 import org.junit.After;
 import org.junit.BeforeClass;
 
@@ -64,4 +64,11 @@ public class SQLiteEntityStoreTestSuite extends EntityStoreTestSuite
             .withConfig( configModule, Visibility.application )
             .assemble( module );
     }
+
+    @Override
+    @After
+    public void tearDown()
+    {
+        TearDown.dropTables( application.findModule( INFRASTRUCTURE_LAYER, STORAGE_MODULE ), SQLDialect.SQLITE, super::tearDown );
+    }
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/27dc60c4/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/SqlEntityStoreTest.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/SqlEntityStoreTest.java b/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/SqlEntityStoreTest.java
index 2a4ce95..e5e1d41 100644
--- a/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/SqlEntityStoreTest.java
+++ b/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/SqlEntityStoreTest.java
@@ -22,7 +22,6 @@ package org.apache.polygene.entitystore.sql;
 import org.apache.polygene.api.common.Visibility;
 import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.ModuleAssembly;
-import org.apache.polygene.entitystore.sql.assembly.AbstractSQLEntityStoreAssembler;
 import org.apache.polygene.entitystore.sql.assembly.H2SQLEntityStoreAssembler;
 import org.apache.polygene.library.sql.assembly.DataSourceAssembler;
 import org.apache.polygene.library.sql.datasource.DataSourceConfiguration;
@@ -30,6 +29,7 @@ import org.apache.polygene.library.sql.dbcp.DBCPDataSourceServiceAssembler;
 import org.apache.polygene.test.EntityTestAssembler;
 import org.apache.polygene.test.entity.AbstractEntityStoreTest;
 import org.jooq.SQLDialect;
+import org.junit.After;
 import org.junit.Rule;
 import org.junit.rules.TemporaryFolder;
 
@@ -86,4 +86,11 @@ public class SqlEntityStoreTest extends AbstractEntityStoreTest
         // START SNIPPET: assembly
     }
     // END SNIPPET: assembly
+
+    @Override
+    @After
+    public void tearDown()
+    {
+        TearDown.dropTables( moduleInstance, SQLDialect.DERBY, super::tearDown );
+    }
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/27dc60c4/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/TearDown.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/TearDown.java b/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/TearDown.java
new file mode 100644
index 0000000..e2371c0
--- /dev/null
+++ b/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/TearDown.java
@@ -0,0 +1,100 @@
+package org.apache.polygene.entitystore.sql;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.sql.Statement;
+import javax.sql.DataSource;
+import org.apache.polygene.api.service.ServiceFinder;
+import org.apache.polygene.api.structure.Module;
+import org.apache.polygene.api.unitofwork.UnitOfWork;
+import org.apache.polygene.api.unitofwork.UnitOfWorkFactory;
+import org.apache.polygene.api.usecase.UsecaseBuilder;
+import org.jooq.SQLDialect;
+
+class TearDown
+{
+    static void dropTables( Module module, SQLDialect dialect, Runnable after )
+    {
+        if( module == null ){
+            System.err.println( "WARNING: 'module' was null. Happens if there was a pre-activation error. Otherwise an InternalError" );
+        }
+        UnitOfWorkFactory unitOfWorkFactory = module.unitOfWorkFactory();
+        ServiceFinder serviceFinder = module.serviceFinder();
+        try( UnitOfWork uow = unitOfWorkFactory.newUnitOfWork( UsecaseBuilder.newUsecase( "Cleaning up. Drop Tables" ) ) )
+        {
+            try( Connection connection = serviceFinder.findService( DataSource.class ).get().getConnection() )
+            {
+                connection.setAutoCommit( true );
+                try( Statement stmt = connection.createStatement() )
+                {
+                    dropTable( dialect, stmt, "TYPES" );
+                    dropTable( dialect, stmt, "ENTITIES" );
+                    dropTable( dialect, stmt, "TestEntity" );
+                    dropTable( dialect, stmt, "TestEntity_ASSOCS" );
+                    dropIndex( dialect, stmt, "TestEntity_ASSOCS" );
+                    dropTable( dialect, stmt, "PhoneNumber" );
+                    dropTable( dialect, stmt, "PhoneNumber_ASSOCS" );
+                    dropIndex( dialect, stmt, "PhoneNumber_ASSOCS" );
+                    dropTable( dialect, stmt, "Person" );
+                    dropTable( dialect, stmt, "Person_ASSOCS" );
+                    dropIndex( dialect, stmt, "Person_ASSOCS" );
+                    dropTable( dialect, stmt, "City" );
+                    dropTable( dialect, stmt, "City_ASSOCS" );
+                    dropIndex( dialect, stmt, "City_ASSOCS" );
+                    dropTable( dialect, stmt, "Address" );
+                    dropTable( dialect, stmt, "Address_ASSOCS" );
+                    dropIndex( dialect, stmt, "Address_ASSOCS" );
+                    dropTable( dialect, stmt, "Country" );
+                    dropTable( dialect, stmt, "Country_ASSOCS" );
+                    dropIndex( dialect, stmt, "Country_ASSOCS" );
+                }
+            }
+        }
+        catch( SQLException e )
+        {
+            throw new RuntimeException( "Unable to clean up tables.", e );
+        }
+        finally
+        {
+            after.run();
+        }
+    }
+
+    private static void dropTable( SQLDialect dialect, Statement stmt, String tableName )
+    {
+        try
+        {
+            if( dialect == SQLDialect.MYSQL || dialect == SQLDialect.MARIADB )
+            {
+                stmt.execute( String.format( "DROP TABLE `%s`", tableName ) );
+            }
+            else
+            {
+                stmt.execute( String.format( "DROP TABLE \"%s\"", tableName ) );
+            }
+        }
+        catch( SQLException e )
+        {
+            //  ignore. Not all tables will be present in all tests.
+        }
+    }
+
+    private static void dropIndex( SQLDialect dialect, Statement stmt, String tableName )
+    {
+        try
+        {
+            if( dialect == SQLDialect.MYSQL || dialect == SQLDialect.MARIADB )
+            {
+                stmt.execute( String.format( "DROP INDEX `IDX_%s`", tableName ) );
+            }
+            else
+            {
+                stmt.execute( String.format( "DROP INDEX \"IDX_%s\"", tableName ) );
+            }
+        }
+        catch( SQLException e )
+        {
+            //  ignore. Not all tables will be present in all tests.
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/27dc60c4/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/TearDownUtil.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/TearDownUtil.java b/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/TearDownUtil.java
deleted file mode 100644
index 00f1e24..0000000
--- a/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/TearDownUtil.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package org.apache.polygene.entitystore.sql;
-
-import java.sql.Connection;
-import java.sql.Statement;
-import javax.sql.DataSource;
-import org.apache.polygene.api.service.ServiceFinder;
-import org.apache.polygene.api.structure.Application;
-import org.apache.polygene.api.structure.Module;
-import org.apache.polygene.api.unitofwork.UnitOfWork;
-import org.apache.polygene.api.unitofwork.UnitOfWorkFactory;
-import org.apache.polygene.entitystore.sql.assembly.AbstractSQLEntityStoreAssembler;
-import org.apache.polygene.library.sql.common.SQLConfiguration;
-
-import static org.apache.polygene.api.usecase.UsecaseBuilder.newUsecase;
-
-public class TearDownUtil
-{
-
-    public static void dropSchema( Module storageModule, String testName )
-        throws Exception
-    {
-        String usecaseName = "Delete " + testName + " test data";
-        UnitOfWorkFactory uowf = storageModule.unitOfWorkFactory();
-        ServiceFinder serviceFinder = storageModule.serviceFinder();
-        UnitOfWork uow = uowf.newUnitOfWork( newUsecase( usecaseName ) );
-        try
-        {
-            SQLConfiguration config = uow.get( SQLConfiguration.class, AbstractSQLEntityStoreAssembler.DEFAULT_ENTITYSTORE_IDENTITY );
-            Connection connection = serviceFinder.findService( DataSource.class ).get().getConnection();
-            connection.setAutoCommit( false );
-            String schemaName = config.schemaName().get();
-            try( Statement stmt = connection.createStatement() )
-            {
-                stmt.execute( String.format( "DROP SCHEMA \"%s\" CASCADE", schemaName ) );
-                connection.commit();
-            }
-        }
-        finally
-        {
-            uow.discard();
-        }
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/27dc60c4/extensions/entitystore-sql/src/test/resources/maridb-datasource.properties
----------------------------------------------------------------------
diff --git a/extensions/entitystore-sql/src/test/resources/maridb-datasource.properties b/extensions/entitystore-sql/src/test/resources/maridb-datasource.properties
new file mode 100644
index 0000000..a2f4175
--- /dev/null
+++ b/extensions/entitystore-sql/src/test/resources/maridb-datasource.properties
@@ -0,0 +1,25 @@
+#
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+#
+#
+#
+
+enabled=true
+#url=jdbc:mysql://localhost:3306/jdbc_test_db?profileSQL=false&useLegacyDatetimeCode=false&serverTimezone=UTC&nullCatalogMeansCurrent=true&nullNamePatternMatchesAll=true
+driver=com.mysql.cj.jdbc.Driver
+username=root
+password=

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/27dc60c4/extensions/entitystore-sqlkv/build.gradle
----------------------------------------------------------------------
diff --git a/extensions/entitystore-sqlkv/build.gradle b/extensions/entitystore-sqlkv/build.gradle
index b13b95a..f86274c 100644
--- a/extensions/entitystore-sqlkv/build.gradle
+++ b/extensions/entitystore-sqlkv/build.gradle
@@ -29,8 +29,6 @@ dependencies {
   api polygene.library( 'sql' )
   api libraries.jooq
 
-  implementation polygene.library( 'sql-liquibase' )
-
   runtimeOnly polygene.core.runtime
 
   testImplementation polygene.internals.testsupport

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/27dc60c4/extensions/entitystore-sqlkv/src/docs/es-sqlkv.txt
----------------------------------------------------------------------
diff --git a/extensions/entitystore-sqlkv/src/docs/es-sqlkv.txt b/extensions/entitystore-sqlkv/src/docs/es-sqlkv.txt
index f36e39d..cfaa275 100644
--- a/extensions/entitystore-sqlkv/src/docs/es-sqlkv.txt
+++ b/extensions/entitystore-sqlkv/src/docs/es-sqlkv.txt
@@ -30,8 +30,6 @@ EntityStore service backed by a SQL database with a simple schema where entities
 This extension fully leverage the <<library-sql>> meaning that you must use it to assemble your DataSource and that you
 get <<library-circuitbreaker,Circuit Breaker>> and <<library-jmx, JMX>> integration for free.
 
-The database schema is managed using <<library-sql-liquibase>>.
-
 TIP: See the <<sample-sql-support>> that demonstrate combined use of <<library-sql>>, <<extension-es-sql>> and
 <<extension-indexing-sql>>.
 

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/27dc60c4/extensions/entitystore-sqlkv/src/main/java/org/apache/polygene/entitystore/sqlkv/SQLEntityStoreConfiguration.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-sqlkv/src/main/java/org/apache/polygene/entitystore/sqlkv/SQLEntityStoreConfiguration.java b/extensions/entitystore-sqlkv/src/main/java/org/apache/polygene/entitystore/sqlkv/SQLEntityStoreConfiguration.java
index e5e3510..c1285cd 100644
--- a/extensions/entitystore-sqlkv/src/main/java/org/apache/polygene/entitystore/sqlkv/SQLEntityStoreConfiguration.java
+++ b/extensions/entitystore-sqlkv/src/main/java/org/apache/polygene/entitystore/sqlkv/SQLEntityStoreConfiguration.java
@@ -22,24 +22,16 @@ import org.apache.polygene.api.property.Property;
 import org.apache.polygene.library.sql.common.SQLConfiguration;
 
 // START SNIPPET: config
-public interface SQLEntityStoreConfiguration extends SQLConfiguration
+public interface SQLEntityStoreConfiguration
 {
     /**
-     * Name of the database schema to use.
-     * Ignored on SQL databases that don't support schemas.
-     */
-    @UseDefaults( "POLYGENE_ES" )
-    @Override
-    Property<String> schemaName();
-
-    /**
      * Name of the entities table.
      */
     @UseDefaults( "POLYGENE_ENTITIES" )
     Property<String> entityTableName();
 
     /**
-     * Defines whether the database schema and table should be created if not already present.
+     * Defines whether the database table should be created if not already present.
      */
     @UseDefaults( "true" )
     Property<Boolean> createIfMissing();


Mime
View raw message