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
parent
b1a5a77013
commit
ad58cc9d33
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 "
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
@ -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,
|
||||
|
|
@ -0,0 +1 @@
|
|||
ALTER SEQUENCE hibernate_sequence RESTART WITH 100000;
|
||||
|
|
@ -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;
|
||||
|
||||
|
|
@ -0,0 +1 @@
|
|||
ALTER SEQUENCE hibernate_sequence RESTART WITH 100000;
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
drop schema if exists CCM_CORE cascade;
|
||||
|
||||
drop sequence if exists HIBERNATE_SEQUENCE;
|
||||
|
||||
create schema CCM_CORE;
|
||||
|
|
@ -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,
|
||||
Loading…
Reference in New Issue