CCM NG: Fixed a problem with the tests for ccm-shortcuts: The inclusion of the ServletFilter into the test archives caused a failure because the filter was invoked before Arquillian has run the database creation scripts (Arquillan communicates with the Server using HTTP).

git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@4317 8810af33-2d31-482b-a856-94f89814c4df
pull/2/head
jensp 2016-09-24 16:57:04 +00:00
parent 847c1bcc1e
commit fef0c2eb41
7 changed files with 61 additions and 40 deletions

View File

@ -172,13 +172,13 @@
<version>2.19.1</version> <version>2.19.1</version>
<configuration> <configuration>
<groups>org.libreccm.tests.categories.UnitTest</groups> <groups>org.libreccm.tests.categories.UnitTest</groups>
<trimStackTrace>false</trimStackTrace>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.jacoco</groupId> <groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId> <artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.5.201505241946</version>
<executions> <executions>
<execution> <execution>
<id>default-prepare-agent</id> <id>default-prepare-agent</id>
@ -362,16 +362,9 @@
<profile> <profile>
<id>wildfly-remote-h2-mem</id> <id>wildfly-remote-h2-mem</id>
<dependencies> <dependencies>
<!-- <dependency>
<groupId>org.libreccm</groupId>
<artifactId>ccm-core</artifactId>
<version>${project.parent.version}</version>
</dependency>-->
<dependency> <dependency>
<groupId>org.wildfly</groupId> <groupId>org.wildfly</groupId>
<artifactId>wildfly-arquillian-container-remote</artifactId> <artifactId>wildfly-arquillian-container-remote</artifactId>
<!--<version>8.2.1.Final</version>-->
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
@ -382,7 +375,6 @@
<dependency> <dependency>
<groupId>org.jacoco</groupId> <groupId>org.jacoco</groupId>
<artifactId>org.jacoco.core</artifactId> <artifactId>org.jacoco.core</artifactId>
<!--<version>0.7.5.201505241946</version>-->
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
@ -446,6 +438,7 @@
<module.path>${project.basedir}/target/wildfly-8.2.0.Final/modules</module.path>--> <module.path>${project.basedir}/target/wildfly-8.2.0.Final/modules</module.path>-->
</systemPropertyVariables> </systemPropertyVariables>
<redirectTestOutputToFile>false</redirectTestOutputToFile> <redirectTestOutputToFile>false</redirectTestOutputToFile>
<trimStackTrace>false</trimStackTrace>
<groups> <groups>
org.libreccm.tests.categories.UnitTest, org.libreccm.tests.categories.UnitTest,
org.libreccm.tests.categories.IntegrationTest org.libreccm.tests.categories.IntegrationTest
@ -532,6 +525,7 @@
<module.path>${project.basedir}/target/wildfly-8.2.0.Final/modules</module.path>--> <module.path>${project.basedir}/target/wildfly-8.2.0.Final/modules</module.path>-->
</systemPropertyVariables> </systemPropertyVariables>
<redirectTestOutputToFile>false</redirectTestOutputToFile> <redirectTestOutputToFile>false</redirectTestOutputToFile>
<trimStackTrace>false</trimStackTrace>
<groups> <groups>
org.libreccm.tests.categories.UnitTest, org.libreccm.tests.categories.UnitTest,
org.libreccm.tests.categories.IntegrationTest org.libreccm.tests.categories.IntegrationTest

View File

@ -150,10 +150,12 @@ public class ShortcutManagerTest {
.addPackage(org.libreccm.l10n.LocalizedString.class .addPackage(org.libreccm.l10n.LocalizedString.class
.getPackage()) .getPackage())
.addPackage(org.libreccm.security.Permission.class.getPackage()) .addPackage(org.libreccm.security.Permission.class.getPackage())
.addPackage(org.libreccm.shortcuts.Shortcuts.class.getPackage())
.addPackage(org.libreccm.web.CcmApplication.class.getPackage()) .addPackage(org.libreccm.web.CcmApplication.class.getPackage())
.addPackage(org.libreccm.workflow.Workflow.class.getPackage()) .addPackage(org.libreccm.workflow.Workflow.class.getPackage())
.addClass(com.arsdigita.kernel.KernelConfig.class) .addClass(com.arsdigita.kernel.KernelConfig.class)
.addClass(org.libreccm.shortcuts.Shortcut.class)
.addClass(org.libreccm.shortcuts.ShortcutManager.class)
.addClass(org.libreccm.shortcuts.ShortcutRepository.class)
.addAsLibraries(libs) .addAsLibraries(libs)
.addAsResource("configs/shiro.ini", "shiro.ini") .addAsResource("configs/shiro.ini", "shiro.ini")
.addAsResource("test-persistence.xml", .addAsResource("test-persistence.xml",

View File

@ -23,6 +23,7 @@ import org.jboss.arquillian.junit.Arquillian;
import org.jboss.arquillian.junit.InSequence; import org.jboss.arquillian.junit.InSequence;
import org.jboss.arquillian.persistence.CreateSchema; import org.jboss.arquillian.persistence.CreateSchema;
import org.jboss.arquillian.persistence.PersistenceTest; import org.jboss.arquillian.persistence.PersistenceTest;
import org.jboss.arquillian.persistence.UsingDataSet;
import org.jboss.arquillian.transaction.api.annotation.TransactionMode; import org.jboss.arquillian.transaction.api.annotation.TransactionMode;
import org.jboss.arquillian.transaction.api.annotation.Transactional; import org.jboss.arquillian.transaction.api.annotation.Transactional;
import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.ShrinkWrap;
@ -37,7 +38,6 @@ import org.junit.AfterClass;
import org.junit.Before; import org.junit.Before;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.Test; import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.libreccm.tests.categories.IntegrationTest; import org.libreccm.tests.categories.IntegrationTest;
@ -50,7 +50,6 @@ import java.util.stream.IntStream;
import javax.inject.Inject; import javax.inject.Inject;
import javax.persistence.EntityManager; import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext; import javax.persistence.PersistenceContext;
import org.jboss.arquillian.persistence.UsingDataSet;
import static org.hamcrest.CoreMatchers.*; import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*; import static org.junit.Assert.*;
@ -59,7 +58,7 @@ import static org.junit.Assert.*;
* *
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a> * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/ */
@Category(IntegrationTest.class) @org.junit.experimental.categories.Category(IntegrationTest.class)
@RunWith(Arquillian.class) @RunWith(Arquillian.class)
@PersistenceTest @PersistenceTest
@Transactional(TransactionMode.COMMIT) @Transactional(TransactionMode.COMMIT)
@ -126,7 +125,7 @@ public class ShortcutRepositoryTest {
return ShrinkWrap.create( return ShrinkWrap.create(
WebArchive.class, WebArchive.class,
"LibreCCM-org.libreccm.shortcuts.ShortcutTest-web.war") "LibreCCM-org.libreccm.shortcuts.ShortcutRepositoryTest-web.war")
.addPackage(org.libreccm.auditing.CcmRevision.class.getPackage()) .addPackage(org.libreccm.auditing.CcmRevision.class.getPackage())
.addPackage(org.libreccm.categorization.Categorization.class .addPackage(org.libreccm.categorization.Categorization.class
.getPackage()) .getPackage())
@ -138,9 +137,10 @@ public class ShortcutRepositoryTest {
.addPackage(org.libreccm.l10n.LocalizedString.class .addPackage(org.libreccm.l10n.LocalizedString.class
.getPackage()) .getPackage())
.addPackage(org.libreccm.security.Permission.class.getPackage()) .addPackage(org.libreccm.security.Permission.class.getPackage())
.addPackage(org.libreccm.shortcuts.Shortcuts.class.getPackage())
.addPackage(org.libreccm.web.CcmApplication.class.getPackage()) .addPackage(org.libreccm.web.CcmApplication.class.getPackage())
.addPackage(org.libreccm.workflow.Workflow.class.getPackage()) .addPackage(org.libreccm.workflow.Workflow.class.getPackage())
.addClass(org.libreccm.shortcuts.Shortcut.class)
.addClass(org.libreccm.shortcuts.ShortcutRepository.class)
.addAsLibraries(libs) .addAsLibraries(libs)
.addAsResource("test-persistence.xml", .addAsResource("test-persistence.xml",
"META-INF/persistence.xml") "META-INF/persistence.xml")

View File

@ -40,6 +40,7 @@ CREATE SCHEMA ccm_shortcuts;
CATEGORY_ORDER bigint, CATEGORY_ORDER bigint,
CATEGORY_INDEX boolean, CATEGORY_INDEX boolean,
OBJECT_ORDER bigint, OBJECT_ORDER bigint,
TYPE varchar(255),
OBJECT_ID bigint, OBJECT_ID bigint,
CATEGORY_ID bigint, CATEGORY_ID bigint,
primary key (CATEGORIZATION_ID) primary key (CATEGORIZATION_ID)
@ -47,7 +48,7 @@ CREATE SCHEMA ccm_shortcuts;
create table CCM_CORE.CATEGORY_DESCRIPTIONS ( create table CCM_CORE.CATEGORY_DESCRIPTIONS (
OBJECT_ID bigint not null, OBJECT_ID bigint not null,
LOCALIZED_VALUE clob, LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (OBJECT_ID, LOCALE) primary key (OBJECT_ID, LOCALE)
); );
@ -64,7 +65,7 @@ CREATE SCHEMA ccm_shortcuts;
create table CCM_CORE.CATEGORY_TITLES ( create table CCM_CORE.CATEGORY_TITLES (
OBJECT_ID bigint not null, OBJECT_ID bigint not null,
LOCALIZED_VALUE clob, LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (OBJECT_ID, LOCALE) primary key (OBJECT_ID, LOCALE)
); );
@ -111,7 +112,7 @@ CREATE SCHEMA ccm_shortcuts;
create table CCM_CORE.DOMAIN_DESCRIPTIONS ( create table CCM_CORE.DOMAIN_DESCRIPTIONS (
OBJECT_ID bigint not null, OBJECT_ID bigint not null,
LOCALIZED_VALUE clob, LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (OBJECT_ID, LOCALE) primary key (OBJECT_ID, LOCALE)
); );
@ -128,14 +129,14 @@ CREATE SCHEMA ccm_shortcuts;
create table CCM_CORE.DOMAIN_TITLES ( create table CCM_CORE.DOMAIN_TITLES (
OBJECT_ID bigint not null, OBJECT_ID bigint not null,
LOCALIZED_VALUE clob, LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (OBJECT_ID, LOCALE) primary key (OBJECT_ID, LOCALE)
); );
create table CCM_CORE.FORMBUILDER_COMPONENT_DESCRIPTIONS ( create table CCM_CORE.FORMBUILDER_COMPONENT_DESCRIPTIONS (
COMPONENT_ID bigint not null, COMPONENT_ID bigint not null,
LOCALIZED_VALUE clob, LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (COMPONENT_ID, LOCALE) primary key (COMPONENT_ID, LOCALE)
); );
@ -180,14 +181,14 @@ CREATE SCHEMA ccm_shortcuts;
create table CCM_CORE.FORMBUILDER_DATA_QUERY_DESCRIPTIONS ( create table CCM_CORE.FORMBUILDER_DATA_QUERY_DESCRIPTIONS (
DATA_QUERY_ID bigint not null, DATA_QUERY_ID bigint not null,
LOCALIZED_VALUE clob, LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (DATA_QUERY_ID, LOCALE) primary key (DATA_QUERY_ID, LOCALE)
); );
create table CCM_CORE.FORMBUILDER_DATA_QUERY_NAMES ( create table CCM_CORE.FORMBUILDER_DATA_QUERY_NAMES (
DATA_QUERY_ID bigint not null, DATA_QUERY_ID bigint not null,
LOCALIZED_VALUE clob, LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (DATA_QUERY_ID, LOCALE) primary key (DATA_QUERY_ID, LOCALE)
); );
@ -224,7 +225,7 @@ CREATE SCHEMA ccm_shortcuts;
create table CCM_CORE.FORMBUILDER_OPTION_LABELS ( create table CCM_CORE.FORMBUILDER_OPTION_LABELS (
OPTION_ID bigint not null, OPTION_ID bigint not null,
LOCALIZED_VALUE clob, LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (OPTION_ID, LOCALE) primary key (OPTION_ID, LOCALE)
); );
@ -237,14 +238,14 @@ CREATE SCHEMA ccm_shortcuts;
create table CCM_CORE.FORMBUILDER_PROCESS_LISTENER_DESCRIPTIONS ( create table CCM_CORE.FORMBUILDER_PROCESS_LISTENER_DESCRIPTIONS (
PROCESS_LISTENER_ID bigint not null, PROCESS_LISTENER_ID bigint not null,
LOCALIZED_VALUE clob, LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (PROCESS_LISTENER_ID, LOCALE) primary key (PROCESS_LISTENER_ID, LOCALE)
); );
create table CCM_CORE.FORMBUILDER_PROCESS_LISTENER_NAMES ( create table CCM_CORE.FORMBUILDER_PROCESS_LISTENER_NAMES (
PROCESS_LISTENER_ID bigint not null, PROCESS_LISTENER_ID bigint not null,
LOCALIZED_VALUE clob, LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (PROCESS_LISTENER_ID, LOCALE) primary key (PROCESS_LISTENER_ID, LOCALE)
); );
@ -441,21 +442,21 @@ CREATE SCHEMA ccm_shortcuts;
create table CCM_CORE.RESOURCE_DESCRIPTIONS ( create table CCM_CORE.RESOURCE_DESCRIPTIONS (
OBJECT_ID bigint not null, OBJECT_ID bigint not null,
LOCALIZED_VALUE clob, LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (OBJECT_ID, LOCALE) primary key (OBJECT_ID, LOCALE)
); );
create table CCM_CORE.RESOURCE_TITLES ( create table CCM_CORE.RESOURCE_TITLES (
OBJECT_ID bigint not null, OBJECT_ID bigint not null,
LOCALIZED_VALUE clob, LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (OBJECT_ID, LOCALE) primary key (OBJECT_ID, LOCALE)
); );
create table CCM_CORE.RESOURCE_TYPE_DESCRIPTIONS ( create table CCM_CORE.RESOURCE_TYPE_DESCRIPTIONS (
RESOURCE_TYPE_ID bigint not null, RESOURCE_TYPE_ID bigint not null,
LOCALIZED_VALUE clob, LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (RESOURCE_TYPE_ID, LOCALE) primary key (RESOURCE_TYPE_ID, LOCALE)
); );
@ -490,11 +491,11 @@ CREATE SCHEMA ccm_shortcuts;
SETTING_ID bigint not null, SETTING_ID bigint not null,
CONFIGURATION_CLASS varchar(512) not null, CONFIGURATION_CLASS varchar(512) not null,
NAME varchar(512) not null, NAME varchar(512) not null,
SETTING_VALUE_DOUBLE double,
SETTING_VALUE_LONG bigint, SETTING_VALUE_LONG bigint,
SETTING_VALUE_BOOLEAN boolean,
SETTING_VALUE_STRING varchar(1024), SETTING_VALUE_STRING varchar(1024),
SETTING_VALUE_BIG_DECIMAL decimal(19,2), SETTING_VALUE_BIG_DECIMAL decimal(19,2),
SETTING_VALUE_BOOLEAN boolean,
SETTING_VALUE_DOUBLE double,
primary key (SETTING_ID) primary key (SETTING_ID)
); );
@ -505,7 +506,7 @@ CREATE SCHEMA ccm_shortcuts;
create table CCM_CORE.SETTINGS_L10N_STR_VALUES ( create table CCM_CORE.SETTINGS_L10N_STR_VALUES (
ENTRY_ID bigint not null, ENTRY_ID bigint not null,
LOCALIZED_VALUE clob, LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (ENTRY_ID, LOCALE) primary key (ENTRY_ID, LOCALE)
); );
@ -550,14 +551,14 @@ CREATE SCHEMA ccm_shortcuts;
create table CCM_CORE.WORKFLOW_DESCRIPTIONS ( create table CCM_CORE.WORKFLOW_DESCRIPTIONS (
WORKFLOW_ID bigint not null, WORKFLOW_ID bigint not null,
LOCALIZED_VALUE clob, LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (WORKFLOW_ID, LOCALE) primary key (WORKFLOW_ID, LOCALE)
); );
create table CCM_CORE.WORKFLOW_NAMES ( create table CCM_CORE.WORKFLOW_NAMES (
WORKFLOW_ID bigint not null, WORKFLOW_ID bigint not null,
LOCALIZED_VALUE clob, LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (WORKFLOW_ID, LOCALE) primary key (WORKFLOW_ID, LOCALE)
); );
@ -574,7 +575,7 @@ CREATE SCHEMA ccm_shortcuts;
create table CCM_CORE.WORKFLOW_TASK_LABELS ( create table CCM_CORE.WORKFLOW_TASK_LABELS (
TASK_ID bigint not null, TASK_ID bigint not null,
LOCALIZED_VALUE clob, LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (TASK_ID, LOCALE) primary key (TASK_ID, LOCALE)
); );
@ -589,7 +590,7 @@ CREATE SCHEMA ccm_shortcuts;
create table CCM_CORE.WORKFLOW_TASKS_DESCRIPTIONS ( create table CCM_CORE.WORKFLOW_TASKS_DESCRIPTIONS (
TASK_ID bigint not null, TASK_ID bigint not null,
LOCALIZED_VALUE clob, LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (TASK_ID, LOCALE) primary key (TASK_ID, LOCALE)
); );
@ -612,6 +613,7 @@ CREATE SCHEMA ccm_shortcuts;
create table CCM_CORE.WORKFLOWS ( create table CCM_CORE.WORKFLOWS (
WORKFLOW_ID bigint not null, WORKFLOW_ID bigint not null,
TEMPLATE_ID bigint,
primary key (WORKFLOW_ID) primary key (WORKFLOW_ID)
); );
@ -1127,4 +1129,9 @@ create sequence hibernate_sequence start with 1 increment by 1;
alter table CCM_CORE.WORKFLOW_USER_TASKS alter table CCM_CORE.WORKFLOW_USER_TASKS
add constraint FKefpdf9ojplu7loo31hfm0wl2h add constraint FKefpdf9ojplu7loo31hfm0wl2h
foreign key (TASK_ID) foreign key (TASK_ID)
references CCM_CORE.WORKFLOW_TASKS; references CCM_CORE.WORKFLOW_TASKS;
alter table CCM_CORE.WORKFLOWS
add constraint FKeixdxau4jebw682gd49tdbsjy
foreign key (TEMPLATE_ID)
references CCM_CORE.WORKFLOW_TEMPLATES;

View File

@ -40,6 +40,7 @@ CREATE SCHEMA ccm_shortcuts;
CATEGORY_ORDER int8, CATEGORY_ORDER int8,
CATEGORY_INDEX boolean, CATEGORY_INDEX boolean,
OBJECT_ORDER int8, OBJECT_ORDER int8,
TYPE varchar(255),
OBJECT_ID int8, OBJECT_ID int8,
CATEGORY_ID int8, CATEGORY_ID int8,
primary key (CATEGORIZATION_ID) primary key (CATEGORIZATION_ID)
@ -490,11 +491,11 @@ CREATE SCHEMA ccm_shortcuts;
SETTING_ID int8 not null, SETTING_ID int8 not null,
CONFIGURATION_CLASS varchar(512) not null, CONFIGURATION_CLASS varchar(512) not null,
NAME varchar(512) not null, NAME varchar(512) not null,
SETTING_VALUE_BIG_DECIMAL numeric(19, 2),
SETTING_VALUE_DOUBLE float8,
SETTING_VALUE_STRING varchar(1024),
SETTING_VALUE_LONG int8, SETTING_VALUE_LONG int8,
SETTING_VALUE_STRING varchar(1024),
SETTING_VALUE_BIG_DECIMAL numeric(19, 2),
SETTING_VALUE_BOOLEAN boolean, SETTING_VALUE_BOOLEAN boolean,
SETTING_VALUE_DOUBLE float8,
primary key (SETTING_ID) primary key (SETTING_ID)
); );
@ -612,6 +613,7 @@ CREATE SCHEMA ccm_shortcuts;
create table CCM_CORE.WORKFLOWS ( create table CCM_CORE.WORKFLOWS (
WORKFLOW_ID int8 not null, WORKFLOW_ID int8 not null,
TEMPLATE_ID int8,
primary key (WORKFLOW_ID) primary key (WORKFLOW_ID)
); );
@ -1127,4 +1129,9 @@ create sequence hibernate_sequence start 1 increment 1;
alter table CCM_CORE.WORKFLOW_USER_TASKS alter table CCM_CORE.WORKFLOW_USER_TASKS
add constraint FKefpdf9ojplu7loo31hfm0wl2h add constraint FKefpdf9ojplu7loo31hfm0wl2h
foreign key (TASK_ID) foreign key (TASK_ID)
references CCM_CORE.WORKFLOW_TASKS; references CCM_CORE.WORKFLOW_TASKS;
alter table CCM_CORE.WORKFLOWS
add constraint FKeixdxau4jebw682gd49tdbsjy
foreign key (TEMPLATE_ID)
references CCM_CORE.WORKFLOW_TEMPLATES;

View File

@ -0,0 +1,11 @@
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"
bean-discovery-mode="annotated">
<interceptors>
<class>org.libreccm.security.AuthorizationInterceptor</class>
</interceptors>
</beans>