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
ccm-docs
jensp 2019-04-03 18:11:48 +00:00
parent 694708d3e3
commit 8acf9fce53
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 org.librecms.assets.FileAsset;
import java.util.concurrent.Callable;
import static org.hamcrest.CoreMatchers.*; import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*; import static org.junit.Assert.*;
@ -71,8 +69,18 @@ import static org.junit.Assert.*;
@RunWith(Arquillian.class) @RunWith(Arquillian.class)
@PersistenceTest @PersistenceTest
@Transactional(TransactionMode.COMMIT) @Transactional(TransactionMode.COMMIT)
@CreateSchema({"create_ccm_cms_schema.sql"}) @CreateSchema(
@CleanupUsingScript({"cleanup.sql"}) {
"001_create_schema.sql",
"002_create_ccm_cms_tables.sql",
"003_init_hibernate_sequence.sql"
}
)
@CleanupUsingScript(
{
"999_cleanup.sql"
}
)
public class AssetManagerTest { public class AssetManagerTest {
@Inject @Inject

View File

@ -62,9 +62,19 @@ import static org.junit.Assert.*;
@RunWith(Arquillian.class) @RunWith(Arquillian.class)
@PersistenceTest @PersistenceTest
@Transactional(TransactionMode.COMMIT) @Transactional(TransactionMode.COMMIT)
@CreateSchema({"create_ccm_cms_schema.sql"}) @CreateSchema(
@CleanupUsingScript(value = {"cleanup.sql"}, {
phase = TestExecutionPhase.BEFORE) "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 { public class AttachmentListManagerTest {
@Inject @Inject

View File

@ -61,9 +61,19 @@ import static org.junit.Assert.*;
@RunWith(Arquillian.class) @RunWith(Arquillian.class)
@PersistenceTest @PersistenceTest
@Transactional(TransactionMode.COMMIT) @Transactional(TransactionMode.COMMIT)
@CreateSchema({"create_ccm_cms_schema.sql"}) @CreateSchema(
@CleanupUsingScript(value = {"cleanup.sql"}, {
phase = TestExecutionPhase.BEFORE) "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 { public class ContentItemL10NManagerTest {
@Inject @Inject

View File

@ -71,9 +71,19 @@ import org.libreccm.workflow.WorkflowRepository;
@RunWith(Arquillian.class) @RunWith(Arquillian.class)
@PersistenceTest @PersistenceTest
@Transactional(TransactionMode.COMMIT) @Transactional(TransactionMode.COMMIT)
@CreateSchema({"create_ccm_cms_schema.sql"}) @CreateSchema(
@CleanupUsingScript(value = {"cleanup.sql"}, {
phase = TestExecutionPhase.BEFORE) "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 { public class ContentItemManagerTest {
@Inject @Inject

View File

@ -67,9 +67,19 @@ import static org.junit.Assert.*;
@RunWith(Arquillian.class) @RunWith(Arquillian.class)
@PersistenceTest @PersistenceTest
@Transactional(TransactionMode.COMMIT) @Transactional(TransactionMode.COMMIT)
@CreateSchema({"create_ccm_cms_schema.sql"}) @CreateSchema(
@CleanupUsingScript(value = {"cleanup.sql"}, {
phase = TestExecutionPhase.BEFORE) "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 { public class ContentItemPermissionTest {
private static final String QUERY = "SELECT DISTINCT i FROM ContentItem i " 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.apache.shiro.subject.Subject;
import org.libreccm.security.Shiro; import org.libreccm.security.Shiro;
import java.util.concurrent.Callable;
/** /**
* *
@ -68,9 +67,19 @@ import java.util.concurrent.Callable;
@RunWith(Arquillian.class) @RunWith(Arquillian.class)
@PersistenceTest @PersistenceTest
@Transactional(TransactionMode.COMMIT) @Transactional(TransactionMode.COMMIT)
@CreateSchema({"create_ccm_cms_schema.sql"}) @CreateSchema(
@CleanupUsingScript(value = {"cleanup.sql"}, {
phase = TestExecutionPhase.BEFORE) "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 { public class ContentItemRepositoryTest {
@Inject @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 * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -75,9 +74,19 @@ import org.librecms.lifecycle.LifecycleDefinitionRepository;
@RunWith(Arquillian.class) @RunWith(Arquillian.class)
@PersistenceTest @PersistenceTest
@Transactional(TransactionMode.COMMIT) @Transactional(TransactionMode.COMMIT)
@CreateSchema({"create_ccm_cms_schema.sql"}) @CreateSchema(
@CleanupUsingScript(value = {"cleanup.sql"}, {
phase = TestExecutionPhase.BEFORE) "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 { public class ContentSectionManagerTest {
@Inject @Inject

View File

@ -64,9 +64,19 @@ import static org.junit.Assert.*;
@RunWith(Arquillian.class) @RunWith(Arquillian.class)
@PersistenceTest @PersistenceTest
@Transactional(TransactionMode.COMMIT) @Transactional(TransactionMode.COMMIT)
@CreateSchema({"create_ccm_cms_schema.sql"}) @CreateSchema(
@CleanupUsingScript(value = {"cleanup.sql"}, {
phase = TestExecutionPhase.BEFORE) "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 { public class ContentTypeRepositoryTest {
@Inject @Inject

View File

@ -60,9 +60,19 @@ import static org.junit.Assert.*;
@RunWith(Arquillian.class) @RunWith(Arquillian.class)
@PersistenceTest @PersistenceTest
@Transactional(TransactionMode.COMMIT) @Transactional(TransactionMode.COMMIT)
@CreateSchema({"create_ccm_cms_schema.sql"}) @CreateSchema(
@CleanupUsingScript(value = {"cleanup.sql"}, {
phase = TestExecutionPhase.BEFORE) "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 { public class FolderManagerTest {
@Inject @Inject

View File

@ -60,9 +60,19 @@ import static org.junit.Assert.*;
@RunWith(Arquillian.class) @RunWith(Arquillian.class)
@PersistenceTest @PersistenceTest
//@Transactional(TransactionMode.COMMIT) //@Transactional(TransactionMode.COMMIT)
@CreateSchema({"create_ccm_cms_schema.sql"}) @CreateSchema(
@CleanupUsingScript(value = {"cleanup.sql"}, {
phase = TestExecutionPhase.BEFORE) "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 { public class ItemAttachmentManagerTest {
@Inject @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 ( create table CCM_CMS.ARTICLE_TEXTS (
OBJECT_ID bigint not null, 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 ( create table CCM_CORE.APPLICATIONS (
APPLICATION_TYPE varchar(1024) not null, APPLICATION_TYPE varchar(1024) not null,
PRIMARY_URL varchar(1024) not null, PRIMARY_URL varchar(1024) not null,