CCM NG: Reorganization of SQL scripts for integration tests

git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@5896 8810af33-2d31-482b-a856-94f89814c4df
pull/2/head
jensp 2019-03-31 10:01:05 +00:00
parent 3d48e5f121
commit a2fc97a3e0
27 changed files with 101 additions and 50 deletions

View File

@ -70,8 +70,10 @@ import org.jboss.arquillian.persistence.TestExecutionPhase;
@RunWith(Arquillian.class)
@PersistenceTest
@Transactional(TransactionMode.COMMIT)
@CreateSchema({"create_ccm_core_schema.sql"})
@CleanupUsingScript(value = {"cleanup.sql"},
@CreateSchema({"001_create_schema.sql",
"002_create_ccm_core_tables.sql",
"003_init_hibernate_sequence.sql"})
@CleanupUsingScript(value = {"999_cleanup.sql"},
phase = TestExecutionPhase.BEFORE)
public class CategoryManagerTest {

View File

@ -65,8 +65,10 @@ import org.jboss.arquillian.persistence.TestExecutionPhase;
@RunWith(Arquillian.class)
@PersistenceTest
@Transactional(TransactionMode.COMMIT)
@CreateSchema({"create_ccm_core_schema.sql"})
@CleanupUsingScript(value = {"cleanup.sql"},
@CreateSchema({"001_create_schema.sql",
"002_create_ccm_core_tables.sql",
"003_init_hibernate_sequence.sql"})
@CleanupUsingScript(value = {"999_cleanup.sql"},
phase = TestExecutionPhase.BEFORE)
public class CategoryRepositoryTest {

View File

@ -62,8 +62,10 @@ import org.jboss.arquillian.persistence.TestExecutionPhase;
@RunWith(Arquillian.class)
@PersistenceTest
@Transactional(TransactionMode.COMMIT)
@CreateSchema({"create_ccm_core_schema.sql"})
@CleanupUsingScript(value = {"cleanup.sql"},
@CreateSchema({"001_create_schema.sql",
"002_create_ccm_core_tables.sql",
"003_init_hibernate_sequence.sql"})
@CleanupUsingScript(value = {"999_cleanup.sql"},
phase = TestExecutionPhase.BEFORE)
public class ConfigurationManagerTest {

View File

@ -67,8 +67,10 @@ import org.jboss.arquillian.persistence.TestExecutionPhase;
@RunWith(Arquillian.class)
@PersistenceTest
@Transactional(TransactionMode.COMMIT)
@CreateSchema({"create_ccm_core_schema.sql"})
@CleanupUsingScript(value = {"cleanup.sql"},
@CreateSchema({"001_create_schema.sql",
"002_create_ccm_core_tables.sql",
"003_init_hibernate_sequence.sql"})
@CleanupUsingScript(value = {"999_cleanup.sql"},
phase = TestExecutionPhase.BEFORE)
public class CcmObjectRepositoryTest {

View File

@ -72,8 +72,10 @@ import static org.junit.Assert.*;
@RunWith(Arquillian.class)
@PersistenceTest
@Transactional(TransactionMode.COMMIT)
@CreateSchema("create_ccm_core_schema.sql")
@CleanupUsingScript(value = {"cleanup.sql"},
@CreateSchema({"001_create_schema.sql",
"002_create_ccm_core_tables.sql",
"003_init_hibernate_sequence.sql"})
@CleanupUsingScript(value = {"999_cleanup.sql"},
phase = TestExecutionPhase.BEFORE)
public class GroupImportTest {

View File

@ -72,8 +72,10 @@ import static org.junit.Assert.*;
@RunWith(Arquillian.class)
@PersistenceTest
@Transactional(TransactionMode.COMMIT)
@CreateSchema("create_ccm_core_schema.sql")
@CleanupUsingScript(value = {"cleanup.sql"},
@CreateSchema({"001_create_schema.sql",
"002_create_ccm_core_tables.sql",
"003_init_hibernate_sequence.sql"})
@CleanupUsingScript(value = {"999_cleanup.sql"},
phase = TestExecutionPhase.BEFORE)
public class GroupMembershipImportTest {

View File

@ -72,8 +72,10 @@ import static org.junit.Assert.*;
@RunWith(Arquillian.class)
@PersistenceTest
@Transactional(TransactionMode.COMMIT)
@CreateSchema("create_ccm_core_schema.sql")
@CleanupUsingScript(value = {"cleanup.sql"},
@CreateSchema({"001_create_schema.sql",
"002_create_ccm_core_tables.sql",
"003_init_hibernate_sequence.sql"})
@CleanupUsingScript(value = {"999_cleanup.sql"},
phase = TestExecutionPhase.BEFORE)
public class UserImportTest {

View File

@ -55,8 +55,10 @@ import org.jboss.arquillian.persistence.TestExecutionPhase;
@RunWith(Arquillian.class)
@PersistenceTest
@Transactional(TransactionMode.COMMIT)
@CreateSchema({"create_ccm_core_schema.sql"})
@CleanupUsingScript(value = {"cleanup.sql"},
@CreateSchema({"001_create_schema.sql",
"002_create_ccm_core_tables.sql",
"003_init_hibernate_sequence.sql"})
@CleanupUsingScript(value = {"999_cleanup.sql"},
phase = TestExecutionPhase.BEFORE)
public class ConfigurationLoaderTest {

View File

@ -62,8 +62,10 @@ import org.jboss.arquillian.persistence.TestExecutionPhase;
@RunWith(Arquillian.class)
@PersistenceTest
@Transactional(TransactionMode.COMMIT)
@CreateSchema({"create_ccm_core_schema.sql"})
@CleanupUsingScript(value = {"cleanup.sql"},
@CreateSchema({"001_create_schema.sql",
"002_create_ccm_core_tables.sql",
"003_init_hibernate_sequence.sql"})
@CleanupUsingScript(value = {"999_cleanup.sql"},
phase = TestExecutionPhase.BEFORE)
public class AuthorizationInterceptorTest {

View File

@ -50,7 +50,6 @@ import static org.libreccm.testutils.DependenciesHelpers.*;
import org.jboss.arquillian.persistence.CleanupUsingScript;
import java.util.Optional;
import org.jboss.arquillian.persistence.TestExecutionPhase;
/**
@ -61,8 +60,10 @@ import org.jboss.arquillian.persistence.TestExecutionPhase;
@RunWith(Arquillian.class)
@PersistenceTest
@Transactional(TransactionMode.COMMIT)
@CreateSchema("create_ccm_core_schema.sql")
@CleanupUsingScript(value = {"cleanup.sql"},
@CreateSchema({"001_create_schema.sql",
"002_create_ccm_core_tables.sql",
"003_init_hibernate_sequence.sql"})
@CleanupUsingScript(value = {"999_cleanup.sql"},
phase = TestExecutionPhase.BEFORE)
public class ChallengeManagerTest {

View File

@ -59,8 +59,10 @@ import org.jboss.arquillian.persistence.TestExecutionPhase;
@RunWith(Arquillian.class)
@PersistenceTest
@Transactional(TransactionMode.COMMIT)
@CreateSchema({"create_ccm_core_schema.sql"})
@CleanupUsingScript(value = {"cleanup.sql"},
@CreateSchema({"001_create_schema.sql",
"002_create_ccm_core_tables.sql",
"003_init_hibernate_sequence.sql"})
@CleanupUsingScript(value = {"999_cleanup.sql"},
phase = TestExecutionPhase.BEFORE)
public class GroupManagerTest {

View File

@ -65,8 +65,10 @@ import org.jboss.arquillian.persistence.TestExecutionPhase;
@RunWith(Arquillian.class)
@PersistenceTest
@Transactional(TransactionMode.COMMIT)
@CreateSchema("create_ccm_core_schema.sql")
@CleanupUsingScript(value = {"cleanup.sql"},
@CreateSchema({"001_create_schema.sql",
"002_create_ccm_core_tables.sql",
"003_init_hibernate_sequence.sql"})
@CleanupUsingScript(value = {"999_cleanup.sql"},
phase = TestExecutionPhase.BEFORE)
public class GroupRepositoryTest {

View File

@ -66,8 +66,10 @@ import org.jboss.arquillian.persistence.TestExecutionPhase;
@RunWith(Arquillian.class)
@PersistenceTest
@Transactional(TransactionMode.COMMIT)
@CreateSchema("create_ccm_core_schema.sql")
@CleanupUsingScript(value = {"cleanup.sql"},
@CreateSchema({"001_create_schema.sql",
"002_create_ccm_core_tables.sql",
"003_init_hibernate_sequence.sql"})
@CleanupUsingScript(value = {"999_cleanup.sql"},
phase = TestExecutionPhase.BEFORE)
public class OneTimeAuthManagerTest {

View File

@ -63,8 +63,10 @@ import org.jboss.arquillian.persistence.TestExecutionPhase;
@RunWith(Arquillian.class)
@PersistenceTest
@Transactional(TransactionMode.COMMIT)
@CreateSchema({"create_ccm_core_schema.sql"})
@CleanupUsingScript(value = {"cleanup.sql"},
@CreateSchema({"001_create_schema.sql",
"002_create_ccm_core_tables.sql",
"003_init_hibernate_sequence.sql"})
@CleanupUsingScript(value = {"999_cleanup.sql"},
phase = TestExecutionPhase.BEFORE)
public class PartyRepositoryTest {

View File

@ -69,8 +69,10 @@ import org.jboss.arquillian.persistence.TestExecutionPhase;
@RunWith(Arquillian.class)
@PersistenceTest
@Transactional(TransactionMode.COMMIT)
@CreateSchema({"create_ccm_core_schema.sql"})
@CleanupUsingScript(value = {"cleanup.sql"},
@CreateSchema({"001_create_schema.sql",
"002_create_ccm_core_tables.sql",
"003_init_hibernate_sequence.sql"})
@CleanupUsingScript(value = {"999_cleanup.sql"},
phase = TestExecutionPhase.BEFORE)
public class PermissionCheckerTest {

View File

@ -67,8 +67,10 @@ import org.jboss.arquillian.persistence.TestExecutionPhase;
@RunWith(Arquillian.class)
@PersistenceTest
@Transactional(TransactionMode.COMMIT)
@CreateSchema({"create_ccm_core_schema.sql"})
@CleanupUsingScript(value = {"cleanup.sql"},
@CreateSchema({"001_create_schema.sql",
"002_create_ccm_core_tables.sql",
"003_init_hibernate_sequence.sql"})
@CleanupUsingScript(value = {"999_cleanup.sql"},
phase = TestExecutionPhase.BEFORE)
public class PermissionManagerTest {

View File

@ -58,8 +58,10 @@ import org.jboss.arquillian.persistence.TestExecutionPhase;
@RunWith(Arquillian.class)
@PersistenceTest
@Transactional(TransactionMode.COMMIT)
@CreateSchema({"create_ccm_core_schema.sql"})
@CleanupUsingScript(value = {"cleanup.sql"},
@CreateSchema({"001_create_schema.sql",
"002_create_ccm_core_tables.sql",
"003_init_hibernate_sequence.sql"})
@CleanupUsingScript(value = {"999_cleanup.sql"},
phase = TestExecutionPhase.BEFORE)
public class RoleManagerTest {

View File

@ -69,8 +69,10 @@ import org.jboss.arquillian.persistence.TestExecutionPhase;
@RunWith(Arquillian.class)
@PersistenceTest
@Transactional(TransactionMode.COMMIT)
@CreateSchema({"create_ccm_core_schema.sql"})
@CleanupUsingScript(value = {"cleanup.sql"},
@CreateSchema({"001_create_schema.sql",
"002_create_ccm_core_tables.sql",
"003_init_hibernate_sequence.sql"})
@CleanupUsingScript(value = {"999_cleanup.sql"},
phase = TestExecutionPhase.BEFORE)
public class RoleRepositoryTest {

View File

@ -65,8 +65,10 @@ import org.jboss.arquillian.persistence.TestExecutionPhase;
@RunWith(Arquillian.class)
@PersistenceTest
@Transactional(TransactionMode.COMMIT)
@CreateSchema({"create_ccm_core_schema.sql"})
@CleanupUsingScript(value = {"cleanup.sql"},
@CreateSchema({"001_create_schema.sql",
"002_create_ccm_core_tables.sql",
"003_init_hibernate_sequence.sql"})
@CleanupUsingScript(value = {"999_cleanup.sql"},
phase = TestExecutionPhase.BEFORE)
public class SecuredCollectionTest {

View File

@ -66,8 +66,10 @@ import org.jboss.arquillian.persistence.TestExecutionPhase;
@RunWith(Arquillian.class)
@PersistenceTest
@Transactional(TransactionMode.COMMIT)
@CreateSchema({"create_ccm_core_schema.sql"})
@CleanupUsingScript(value = {"cleanup.sql"},
@CreateSchema({"001_create_schema.sql",
"002_create_ccm_core_tables.sql",
"003_init_hibernate_sequence.sql"})
@CleanupUsingScript(value = {"999_cleanup.sql"},
phase = TestExecutionPhase.BEFORE)
public class SecuredIteratorTest {

View File

@ -64,8 +64,10 @@ import org.jboss.arquillian.persistence.TestExecutionPhase;
@RunWith(Arquillian.class)
@PersistenceTest
@Transactional(TransactionMode.COMMIT)
@CreateSchema({"create_ccm_core_schema.sql"})
@CleanupUsingScript(value = {"cleanup.sql"},
@CreateSchema({"001_create_schema.sql",
"002_create_ccm_core_tables.sql",
"003_init_hibernate_sequence.sql"})
@CleanupUsingScript(value = {"999_cleanup.sql"},
phase = TestExecutionPhase.BEFORE)
public class ShiroTest {

View File

@ -63,8 +63,10 @@ import org.jboss.arquillian.persistence.TestExecutionPhase;
@RunWith(Arquillian.class)
@PersistenceTest
@Transactional(TransactionMode.COMMIT)
@CreateSchema({"create_ccm_core_schema.sql"})
@CleanupUsingScript(value = {"cleanup.sql"},
@CreateSchema({"001_create_schema.sql",
"002_create_ccm_core_tables.sql",
"003_init_hibernate_sequence.sql"})
@CleanupUsingScript(value = {"999_cleanup.sql"},
phase = TestExecutionPhase.BEFORE)
public class UserManagerTest {

View File

@ -65,8 +65,10 @@ import org.jboss.arquillian.persistence.TestExecutionPhase;
@RunWith(Arquillian.class)
@PersistenceTest
@Transactional(TransactionMode.COMMIT)
@CreateSchema({"create_ccm_core_schema.sql"})
@CleanupUsingScript(value = {"cleanup.sql"},
@CreateSchema({"001_create_schema.sql",
"002_create_ccm_core_tables.sql",
"003_init_hibernate_sequence.sql"})
@CleanupUsingScript(value = {"999_cleanup.sql"},
phase = TestExecutionPhase.BEFORE)
public class UserRepositoryTest {

View File

@ -0,0 +1,5 @@
drop schema if exists CCM_CORE;
drop sequence if exists HIBERNATE_SEQUENCE;
create schema CCM_CORE;

View File

@ -1,8 +1,8 @@
drop schema if exists CCM_CORE;
-- drop schema if exists CCM_CORE;
drop sequence if exists HIBERNATE_SEQUENCE;
-- drop sequence if exists HIBERNATE_SEQUENCE;
create schema CCM_CORE;
-- create schema CCM_CORE;
create table CCM_CORE.APPLICATIONS (
APPLICATION_TYPE varchar(1024) not null,

View File

@ -0,0 +1 @@
ALTER SEQUENCE hibernate_sequence RESTART WITH 100000;