Index: test/environments/runtime.xml =================================================================== --- test/environments/runtime.xml (revision 43448) +++ test/environments/runtime.xml (working copy) @@ -26,7 +26,6 @@ <plugins> <exclude> <feature>core/runtime.sending.mail</feature> - <feature>core/reader.profile.init</feature> </exclude> </plugins> Index: test/environments/scripts/jdbc-derby/dropTables.sql =================================================================== --- test/environments/scripts/jdbc-derby/dropTables.sql (revision 0) +++ test/environments/scripts/jdbc-derby/dropTables.sql (revision 0) @@ -0,0 +1,42 @@ +-- +-- Copyright 2009 Anyware Services +-- +-- Licensed 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. +-- + +--_ignore_exceptions_=on +DROP TABLE RIGHTS_PROFILERIGHTS; + +DROP TABLE RIGHTS_ALLOWEDGROUPS; +DROP TABLE RIGHTS_ALLOWEDUSERS; +DROP TABLE RIGHTS_DENIEDGROUPS; +DROP TABLE RIGHTS_DENIEDUSERS; +DROP TABLE RIGHTS_ALLOWEDPROFILESANYCON; +DROP TABLE RIGHTS_DENIEDPROFILESANYCON; +DROP TABLE RIGHTS_ALLOWEDPROFILESANONYM; +DROP TABLE RIGHTS_DENIEDPROFILESANONYM; + +DROP TABLE RIGHTS_PROFILE; + +DROP TABLE USERPOPULATIONSBYCONTEXT; +DROP TABLE GROUPDIRECTORIESBYCONTEXT; + +DROP TABLE ADMINUSERS; +DROP TABLE GROUPS_USERS; +DROP TABLE GROUPS; +DROP TABLE USERS; + +DROP TABLE USERPREFERENCES; +DROP SEQUENCE SEQ_GROUPS; +DROP SEQUENCE SEQ_RIGHTS_PROFILE; +DROP SEQUENCE SEQ_PROFILE_ASSIGNMENTS; Index: test/environments/scripts/jdbc-hsqldb/dropTables.sql =================================================================== --- test/environments/scripts/jdbc-hsqldb/dropTables.sql (revision 0) +++ test/environments/scripts/jdbc-hsqldb/dropTables.sql (revision 0) @@ -0,0 +1,42 @@ +-- +-- Copyright 2009 Anyware Services +-- +-- Licensed 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. +-- + +--_ignore_exceptions_=on +DROP TABLE RIGHTS_PROFILERIGHTS; + +DROP TABLE RIGHTS_ALLOWEDGROUPS; +DROP TABLE RIGHTS_ALLOWEDUSERS; +DROP TABLE RIGHTS_DENIEDGROUPS; +DROP TABLE RIGHTS_DENIEDUSERS; +DROP TABLE RIGHTS_ALLOWEDPROFILESANYCON; +DROP TABLE RIGHTS_DENIEDPROFILESANYCON; +DROP TABLE RIGHTS_ALLOWEDPROFILESANONYM; +DROP TABLE RIGHTS_DENIEDPROFILESANONYM; + +DROP TABLE RIGHTS_PROFILE; + +DROP TABLE USERPOPULATIONSBYCONTEXT; +DROP TABLE GROUPDIRECTORIESBYCONTEXT; + +DROP TABLE ADMINUSERS; +DROP TABLE GROUPS_USERS; +DROP TABLE GROUPS; +DROP TABLE USERS; + +DROP TABLE USERPREFERENCES; +DROP SEQUENCE SEQ_GROUPS; +DROP SEQUENCE SEQ_RIGHTS_PROFILE; +DROP SEQUENCE SEQ_PROFILE_ASSIGNMENTS; Index: test/environments/scripts/jdbc-mysql/dropTables.sql =================================================================== --- test/environments/scripts/jdbc-mysql/dropTables.sql (revision 0) +++ test/environments/scripts/jdbc-mysql/dropTables.sql (revision 0) @@ -0,0 +1,42 @@ +-- +-- Copyright 2016 Anyware Services +-- +-- Licensed 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. +-- + +--_ignore_exceptions_=on +DROP TABLE RIGHTS_PROFILERIGHTS IF EXISTS; + +DROP TABLE RIGHTS_ALLOWEDGROUPS IF EXISTS; +DROP TABLE RIGHTS_ALLOWEDUSERS IF EXISTS; +DROP TABLE RIGHTS_DENIEDGROUPS IF EXISTS; +DROP TABLE RIGHTS_DENIEDUSERS IF EXISTS; +DROP TABLE RIGHTS_ALLOWEDPROFILESANYCON IF EXISTS; +DROP TABLE RIGHTS_DENIEDPROFILESANYCON IF EXISTS; +DROP TABLE RIGHTS_ALLOWEDPROFILESANONYM IF EXISTS; +DROP TABLE RIGHTS_DENIEDPROFILESANONYM IF EXISTS; + +DROP TABLE RIGHTS_PROFILE IF EXISTS; + +DROP TABLE USERPOPULATIONSBYCONTEXT IF EXISTS; +DROP TABLE GROUPDIRECTORIESBYCONTEXT IF EXISTS; + +DROP TABLE ADMINUSERS IF EXISTS; +DROP TABLE GROUPS_USERS IF EXISTS; +DROP TABLE GROUPS IF EXISTS; +DROP TABLE USERS IF EXISTS; + +DROP TABLE USERPREFERENCES IF EXISTS; +DROP SEQUENCE SEQ_GROUPS IF EXISTS; +DROP SEQUENCE SEQ_RIGHTS_PROFILE IF EXISTS; +DROP SEQUENCE SEQ_PROFILE_ASSIGNMENTS IF EXISTS; Index: test/environments/scripts/jdbc-oracle/dropTables.sql =================================================================== --- test/environments/scripts/jdbc-oracle/dropTables.sql (revision 0) +++ test/environments/scripts/jdbc-oracle/dropTables.sql (revision 0) @@ -0,0 +1,31 @@ +-- +-- Copyright 2009 Anyware Services +-- +-- Licensed 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. +-- + +--_separator_=$$$ +DECLARE + CURSOR tables is SELECT table_name FROM user_tables where table_name IN ('RIGHTS_PROFILE', 'RIGHTS_PROFILERIGHTS', 'RIGHTS_ALLOWEDGROUPS', 'RIGHTS_ALLOWEDUSERS', 'RIGHTS_DENIEDGROUPS', 'RIGHTS_DENIEDUSERS', 'RIGHTS_ALLOWEDPROFILESANYCON', 'RIGHTS_DENIEDPROFILESANYCON', 'RIGHTS_ALLOWEDPROFILESANONYM', 'RIGHTS_DENIEDPROFILESANONYM', 'USERPOPULATIONSBYCONTEXT', 'GROUPDIRECTORIESBYCONTEXT', 'ADMINUSERS', 'GROUPS_USERS', 'GROUPS', 'USERS', 'USERPREFERENCES'); + CURSOR sequences is SELECT sequence_name FROM user_sequences where sequence_name IN ('SEQ_GROUPS', 'SEQ_RIGHTS_PROFILE', 'SEQ_PROFILE_ASSIGNMENTS'); +BEGIN + -- PURGE works only as of Oracle 10g Release 2. + FOR TAB IN tables LOOP + EXECUTE IMMEDIATE 'DROP TABLE ' || TAB.TABLE_NAME || ' PURGE'; + END LOOP; + + FOR seq IN sequences LOOP + EXECUTE IMMEDIATE 'DROP SEQUENCE ' || seq.sequence_name; + END LOOP; +END; +--_separator_=; Index: test/environments/scripts/jdbc-postgres/dropTables.sql =================================================================== --- test/environments/scripts/jdbc-postgres/dropTables.sql (revision 0) +++ test/environments/scripts/jdbc-postgres/dropTables.sql (revision 0) @@ -0,0 +1,42 @@ +-- +-- Copyright 2016 Anyware Services +-- +-- Licensed 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. +-- + +--_ignore_exceptions_=on +DROP TABLE RIGHTS_PROFILERIGHTS IF EXISTS; + +DROP TABLE RIGHTS_ALLOWEDGROUPS IF EXISTS; +DROP TABLE RIGHTS_ALLOWEDUSERS IF EXISTS; +DROP TABLE RIGHTS_DENIEDGROUPS IF EXISTS; +DROP TABLE RIGHTS_DENIEDUSERS IF EXISTS; +DROP TABLE RIGHTS_ALLOWEDPROFILESANYCON IF EXISTS; +DROP TABLE RIGHTS_DENIEDPROFILESANYCON IF EXISTS; +DROP TABLE RIGHTS_ALLOWEDPROFILESANONYM IF EXISTS; +DROP TABLE RIGHTS_DENIEDPROFILESANONYM IF EXISTS; + +DROP TABLE RIGHTS_PROFILE IF EXISTS; + +DROP TABLE USERPOPULATIONSBYCONTEXT IF EXISTS; +DROP TABLE GROUPDIRECTORIESBYCONTEXT IF EXISTS; + +DROP TABLE ADMINUSERS IF EXISTS; +DROP TABLE GROUPS_USERS IF EXISTS; +DROP TABLE GROUPS IF EXISTS; +DROP TABLE USERS IF EXISTS; + +DROP TABLE USERPREFERENCES IF EXISTS; +DROP SEQUENCE SEQ_GROUPS IF EXISTS; +DROP SEQUENCE SEQ_RIGHTS_PROFILE IF EXISTS; +DROP SEQUENCE SEQ_PROFILE_ASSIGNMENTS IF EXISTS; Index: test/src/org/ametys/plugins/workflow/WorkflowTestCase.java =================================================================== --- test/src/org/ametys/plugins/workflow/WorkflowTestCase.java (revision 43448) +++ test/src/org/ametys/plugins/workflow/WorkflowTestCase.java (working copy) @@ -56,8 +56,7 @@ // Remove jackrabbit home directory before each test FileUtils.deleteDirectory(new File("test/environments/webapp/WEB-INF/data/repository")); - String dataSourceFile = "test/environments/datasources/datasource-derby.xml"; - _startApplication("test/environments/runtime.xml", "test/environments/config/config.xml", dataSourceFile, "test/environments/webapp"); + _startApplication("test/environments/runtime.xml", "test/environments/config/config.xml", "test/environments/webapp"); _fillRights(); _workflowProvider = (WorkflowProvider) Init.getPluginServiceManager().lookup(WorkflowProvider.ROLE); @@ -65,6 +64,18 @@ } @Override + protected String _getDataSourceFile() + { + return "test/environments/datasources/datasource-derby.xml"; + } + + @Override + protected File[] _getStartScripts() + { + return new File[] {new File("test/environments/scripts/jdbc-derby/dropTables.sql")}; + } + + @Override protected void tearDown() throws Exception { _cocoon.dispose(); Index: test/src/org/ametys/plugins/workflow/store/AbstractFunctionalWorkflowTest.java =================================================================== --- test/src/org/ametys/plugins/workflow/store/AbstractFunctionalWorkflowTest.java (revision 43448) +++ test/src/org/ametys/plugins/workflow/store/AbstractFunctionalWorkflowTest.java (working copy) @@ -74,16 +74,7 @@ protected void setUp() throws Exception { super.setUp(); - String sqlDataSourceFileName = _getSQLDataSourceFilename(); - - if (sqlDataSourceFileName != null) - { - _startApplication("test/environments/runtime.xml", "test/environments/config/" + _getConfigFilename(), "test/environments/datasources/" + sqlDataSourceFileName, "test/environments/webapp"); - } - else - { - _startApplication("test/environments/runtime.xml", "test/environments/config/" + _getConfigFilename(), "test/environments/webapp"); - } + _startApplication("test/environments/runtime.xml", "test/environments/config/" + _getConfigFilename(), "test/environments/webapp"); _workflowProvider = (WorkflowProvider) Init.getPluginServiceManager().lookup(WorkflowProvider.ROLE); @@ -113,15 +104,6 @@ { return "config.xml"; } - - /** - * Provides the data source filename to use - * @return the data source filename. - */ - protected String _getSQLDataSourceFilename() - { - return null; - } @Override protected void tearDown() throws Exception Index: test/src/org/ametys/plugins/workflow/store/DerbyWorkflowStoreTestCase.java =================================================================== --- test/src/org/ametys/plugins/workflow/store/DerbyWorkflowStoreTestCase.java (revision 43448) +++ test/src/org/ametys/plugins/workflow/store/DerbyWorkflowStoreTestCase.java (working copy) @@ -15,6 +15,8 @@ */ package org.ametys.plugins.workflow.store; +import java.io.File; + import junit.framework.TestCase; /** @@ -32,9 +34,15 @@ } @Override - protected String _getSQLDataSourceFilename() + protected String _getDataSourceFile() { - return "datasource-derby.xml"; + return "test/environments/datasources/datasource-derby.xml"; + } + + @Override + protected File[] _getStartScripts() + { + return new File[] {new File("test/environments/scripts/jdbc-derby/dropTables.sql")}; } @Override Index: test/src/org/ametys/plugins/workflow/store/HsqldbWorkflowStoreTestCase.java =================================================================== --- test/src/org/ametys/plugins/workflow/store/HsqldbWorkflowStoreTestCase.java (revision 43448) +++ test/src/org/ametys/plugins/workflow/store/HsqldbWorkflowStoreTestCase.java (working copy) @@ -15,6 +15,8 @@ */ package org.ametys.plugins.workflow.store; +import java.io.File; + import junit.framework.TestCase; /** @@ -32,9 +34,15 @@ } @Override - protected String _getSQLDataSourceFilename() + protected String _getDataSourceFile() { - return "datasource-hsql.xml"; + return "test/environments/datasources/datasource-hsql.xml"; + } + + @Override + protected File[] _getStartScripts() + { + return new File[] {new File("test/environments/scripts/jdbc-hsqldb/dropTables.sql")}; } @Override Index: test/src/org/ametys/plugins/workflow/store/MysqlWorkflowStoreTestCase.java =================================================================== --- test/src/org/ametys/plugins/workflow/store/MysqlWorkflowStoreTestCase.java (revision 43448) +++ test/src/org/ametys/plugins/workflow/store/MysqlWorkflowStoreTestCase.java (working copy) @@ -15,6 +15,8 @@ */ package org.ametys.plugins.workflow.store; +import java.io.File; + import junit.framework.TestCase; /** @@ -30,6 +32,18 @@ { super(name); } + + @Override + protected String _getDataSourceFile() + { + return "test/environments/datasources/datasource-mysql.xml"; + } + + @Override + protected File[] _getStartScripts() + { + return new File[] {new File("test/environments/scripts/jdbc-mysql/dropTables.sql")}; + } @Override protected String _getRDBMName() Index: test/src/org/ametys/plugins/workflow/store/OracleWorkflowStoreTestCase.java =================================================================== --- test/src/org/ametys/plugins/workflow/store/OracleWorkflowStoreTestCase.java (revision 43448) +++ test/src/org/ametys/plugins/workflow/store/OracleWorkflowStoreTestCase.java (working copy) @@ -15,6 +15,8 @@ */ package org.ametys.plugins.workflow.store; +import java.io.File; + import junit.framework.TestCase; /** @@ -32,9 +34,15 @@ } @Override - protected String _getSQLDataSourceFilename() + protected String _getDataSourceFile() { - return "datasource-oracle.xml"; + return "test/environments/datasources/datasource-oracle.xml"; + } + + @Override + protected File[] _getStartScripts() + { + return new File[] {new File("test/environments/scripts/jdbc-oracle/dropTables.sql")}; } @Override Index: test/src/org/ametys/plugins/workflow/store/PostgresWorkflowStoreTestCase.java =================================================================== --- test/src/org/ametys/plugins/workflow/store/PostgresWorkflowStoreTestCase.java (revision 43448) +++ test/src/org/ametys/plugins/workflow/store/PostgresWorkflowStoreTestCase.java (working copy) @@ -15,6 +15,8 @@ */ package org.ametys.plugins.workflow.store; +import java.io.File; + import junit.framework.TestCase; /** @@ -32,9 +34,15 @@ } @Override - protected String _getSQLDataSourceFilename() + protected String _getDataSourceFile() { - return "datasource-postgresql.xml"; + return "test/environments/datasources/datasource-postgresql.xml"; + } + + @Override + protected File[] _getStartScripts() + { + return new File[] {new File("test/environments/scripts/jdbc-postgres/dropTables.sql")}; } @Override