CCM NG: Split up SQL generation scripts for testing

git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@5908 8810af33-2d31-482b-a856-94f89814c4df

Former-commit-id: ad58cc9d33
pull/2/head
jensp 2019-04-03 18:11:48 +00:00
parent 0583b1be57
commit 92189cb676
21 changed files with 157 additions and 49 deletions

View File

@ -57,8 +57,6 @@ import org.jboss.arquillian.persistence.CleanupUsingScript;
import org.librecms.assets.FileAsset;
import java.util.concurrent.Callable;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
@ -71,8 +69,18 @@ import static org.junit.Assert.*;
@RunWith(Arquillian.class)
@PersistenceTest
@Transactional(TransactionMode.COMMIT)
@CreateSchema({"create_ccm_cms_schema.sql"})
@CleanupUsingScript({"cleanup.sql"})
@CreateSchema(
{
"001_create_schema.sql",
"002_create_ccm_cms_tables.sql",
"003_init_hibernate_sequence.sql"
}
)
@CleanupUsingScript(
{
"999_cleanup.sql"
}
)
public class AssetManagerTest {
@Inject

View File

@ -62,9 +62,19 @@ import static org.junit.Assert.*;
@RunWith(Arquillian.class)
@PersistenceTest
@Transactional(TransactionMode.COMMIT)
@CreateSchema({"create_ccm_cms_schema.sql"})
@CleanupUsingScript(value = {"cleanup.sql"},
phase = TestExecutionPhase.BEFORE)
@CreateSchema(
{
"001_create_schema.sql",
"002_create_ccm_cms_tables.sql",
"003_init_hibernate_sequence.sql"
}
)
@CleanupUsingScript(
value = {
"999_cleanup.sql"
},
phase = TestExecutionPhase.BEFORE
)
public class AttachmentListManagerTest {
@Inject

View File

@ -61,9 +61,19 @@ import static org.junit.Assert.*;
@RunWith(Arquillian.class)
@PersistenceTest
@Transactional(TransactionMode.COMMIT)
@CreateSchema({"create_ccm_cms_schema.sql"})
@CleanupUsingScript(value = {"cleanup.sql"},
phase = TestExecutionPhase.BEFORE)
@CreateSchema(
{
"001_create_schema.sql",
"002_create_ccm_cms_tables.sql",
"003_init_hibernate_sequence.sql"
}
)
@CleanupUsingScript(
value = {
"999_cleanup.sql"
},
phase = TestExecutionPhase.BEFORE
)
public class ContentItemL10NManagerTest {
@Inject

View File

@ -71,9 +71,19 @@ import org.libreccm.workflow.WorkflowRepository;
@RunWith(Arquillian.class)
@PersistenceTest
@Transactional(TransactionMode.COMMIT)
@CreateSchema({"create_ccm_cms_schema.sql"})
@CleanupUsingScript(value = {"cleanup.sql"},
phase = TestExecutionPhase.BEFORE)
@CreateSchema(
{
"001_create_schema.sql",
"002_create_ccm_cms_tables.sql",
"003_init_hibernate_sequence.sql"
}
)
@CleanupUsingScript(
value = {
"999_cleanup.sql"
},
phase = TestExecutionPhase.BEFORE
)
public class ContentItemManagerTest {
@Inject

View File

@ -67,9 +67,19 @@ import static org.junit.Assert.*;
@RunWith(Arquillian.class)
@PersistenceTest
@Transactional(TransactionMode.COMMIT)
@CreateSchema({"create_ccm_cms_schema.sql"})
@CleanupUsingScript(value = {"cleanup.sql"},
phase = TestExecutionPhase.BEFORE)
@CreateSchema(
{
"001_create_schema.sql",
"002_create_ccm_cms_tables.sql",
"003_init_hibernate_sequence.sql"
}
)
@CleanupUsingScript(
value = {
"999_cleanup.sql"
},
phase = TestExecutionPhase.BEFORE
)
public class ContentItemPermissionTest {
private static final String QUERY = "SELECT DISTINCT i FROM ContentItem i "

View File

@ -58,7 +58,6 @@ import static org.libreccm.testutils.DependenciesHelpers.*;
import org.apache.shiro.subject.Subject;
import org.libreccm.security.Shiro;
import java.util.concurrent.Callable;
/**
*
@ -68,9 +67,19 @@ import java.util.concurrent.Callable;
@RunWith(Arquillian.class)
@PersistenceTest
@Transactional(TransactionMode.COMMIT)
@CreateSchema({"create_ccm_cms_schema.sql"})
@CleanupUsingScript(value = {"cleanup.sql"},
phase = TestExecutionPhase.BEFORE)
@CreateSchema(
{
"001_create_schema.sql",
"002_create_ccm_cms_tables.sql",
"003_init_hibernate_sequence.sql"
}
)
@CleanupUsingScript(
value = {
"999_cleanup.sql"
},
phase = TestExecutionPhase.BEFORE
)
public class ContentItemRepositoryTest {
@Inject

View File

@ -1,5 +1,4 @@
/*
* Copyright (C) 2016 LibreCCM Foundation.
/* Copyright (C) 2016 LibreCCM Foundation.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -75,9 +74,19 @@ import org.librecms.lifecycle.LifecycleDefinitionRepository;
@RunWith(Arquillian.class)
@PersistenceTest
@Transactional(TransactionMode.COMMIT)
@CreateSchema({"create_ccm_cms_schema.sql"})
@CleanupUsingScript(value = {"cleanup.sql"},
phase = TestExecutionPhase.BEFORE)
@CreateSchema(
{
"001_create_schema.sql",
"002_create_ccm_cms_tables.sql",
"003_init_hibernate_sequence.sql"
}
)
@CleanupUsingScript(
value = {
"999_cleanup.sql"
},
phase = TestExecutionPhase.BEFORE
)
public class ContentSectionManagerTest {
@Inject

View File

@ -64,9 +64,19 @@ import static org.junit.Assert.*;
@RunWith(Arquillian.class)
@PersistenceTest
@Transactional(TransactionMode.COMMIT)
@CreateSchema({"create_ccm_cms_schema.sql"})
@CleanupUsingScript(value = {"cleanup.sql"},
phase = TestExecutionPhase.BEFORE)
@CreateSchema(
{
"001_create_schema.sql",
"002_create_ccm_cms_tables.sql",
"003_init_hibernate_sequence.sql"
}
)
@CleanupUsingScript(
value = {
"999_cleanup.sql"
},
phase = TestExecutionPhase.BEFORE
)
public class ContentTypeRepositoryTest {
@Inject

View File

@ -60,9 +60,19 @@ import static org.junit.Assert.*;
@RunWith(Arquillian.class)
@PersistenceTest
@Transactional(TransactionMode.COMMIT)
@CreateSchema({"create_ccm_cms_schema.sql"})
@CleanupUsingScript(value = {"cleanup.sql"},
phase = TestExecutionPhase.BEFORE)
@CreateSchema(
{
"001_create_schema.sql",
"002_create_ccm_cms_tables.sql",
"003_init_hibernate_sequence.sql"
}
)
@CleanupUsingScript(
value = {
"999_cleanup.sql"
},
phase = TestExecutionPhase.BEFORE
)
public class FolderManagerTest {
@Inject

View File

@ -60,9 +60,19 @@ import static org.junit.Assert.*;
@RunWith(Arquillian.class)
@PersistenceTest
//@Transactional(TransactionMode.COMMIT)
@CreateSchema({"create_ccm_cms_schema.sql"})
@CleanupUsingScript(value = {"cleanup.sql"},
phase = TestExecutionPhase.BEFORE)
@CreateSchema(
{
"001_create_schema.sql",
"002_create_ccm_cms_tables.sql",
"003_init_hibernate_sequence.sql"
}
)
@CleanupUsingScript(
value = {
"999_cleanup.sql"
},
phase = TestExecutionPhase.BEFORE
)
public class ItemAttachmentManagerTest {
@Inject

View File

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

View File

@ -1,12 +1,3 @@
drop schema if exists CCM_CMS;
drop schema if exists CCM_CORE;
drop sequence if exists HIBERNATE_SEQUENCE;
create schema CCM_CMS;
create schema CCM_CORE;
create table CCM_CMS.ARTICLE_TEXTS (
OBJECT_ID bigint not null,

View File

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

View File

@ -0,0 +1,10 @@
drop schema if exists CCM_CMS cascade;
drop schema if exists CCM_CORE cascade;
drop sequence if exists HIBERNATE_SEQUENCE;
create schema CCM_CMS;
create schema CCM_CORE;

View File

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

View File

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

View File

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