Merge branch 'master' into restapi
commit
c8138350b6
|
|
@ -1,3 +1,4 @@
|
||||||
|
it-pgsql-datasources.properties
|
||||||
nb-configuration.xml
|
nb-configuration.xml
|
||||||
node
|
node
|
||||||
node_modules
|
node_modules
|
||||||
|
|
|
||||||
|
|
@ -7,20 +7,14 @@ pipeline {
|
||||||
stage('Build and Test') {
|
stage('Build and Test') {
|
||||||
steps {
|
steps {
|
||||||
dir('') {
|
dir('') {
|
||||||
// sh 'mvn clean package test -Pwildfly-remote-h2-mem'
|
sh 'mvn clean verify -Prun-its-with-wildfly-h2mem -Dwildfly.propertiesFile=/srv/libreccm-wildfly.properties'
|
||||||
sh 'mvn clean package -Pwildfly-remote-h2-mem'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
post {
|
|
||||||
always {
|
|
||||||
sh 'sudo systemctl restart wildfly'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage("Analyse") {
|
stage("Analyse") {
|
||||||
steps {
|
steps {
|
||||||
dir('') {
|
dir('') {
|
||||||
sh 'mvn package pmd:pmd pmd:cpd spotbugs:spotbugs'
|
sh 'mvn pmd:pmd pmd:cpd spotbugs:spotbugs'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -46,7 +40,8 @@ pipeline {
|
||||||
body: "Build ${env.BUILD_URL} failed."
|
body: "Build ${env.BUILD_URL} failed."
|
||||||
}
|
}
|
||||||
always {
|
always {
|
||||||
junit testResults: '**/target/surefire-reports/*.xml'
|
junit allowEmptyResults: true, testResults: '**/target/surefire-reports/*.xml'
|
||||||
|
|
||||||
|
|
||||||
recordIssues enabledForFailure: true, tools: [java(), javaDoc()]
|
recordIssues enabledForFailure: true, tools: [java(), javaDoc()]
|
||||||
recordIssues enabledForFailure: false, tool: spotBugs()
|
recordIssues enabledForFailure: false, tool: spotBugs()
|
||||||
|
|
|
||||||
104
README.md
104
README.md
|
|
@ -3,8 +3,11 @@
|
||||||
The [https://libreccm.org](LibreCCM) framework and the
|
The [https://libreccm.org](LibreCCM) framework and the
|
||||||
[https://librecms.org](LibreCMS) web content management system.
|
[https://librecms.org](LibreCMS) web content management system.
|
||||||
|
|
||||||
This repository contains the Jakarta EE based, new version of LibreCCM
|
## Overview
|
||||||
and LibreCMS. We are now using Maven as build tool.
|
|
||||||
|
This repository contains the Jakarta EE based, new version of
|
||||||
|
[https://libreccm.org](LibreCCM) and [https://librecms.org](LibreCMS). We are
|
||||||
|
now using Maven as build tool.
|
||||||
|
|
||||||
Some more documentation is provided as Maven project site. To create the site
|
Some more documentation is provided as Maven project site. To create the site
|
||||||
run
|
run
|
||||||
|
|
@ -15,46 +18,86 @@ and open the ./target/staging/index.html file in your browser.
|
||||||
|
|
||||||
The recreate the site run
|
The recreate the site run
|
||||||
|
|
||||||
mvn clean package site site:stage
|
mvn package site site:stage
|
||||||
|
|
||||||
again.
|
again.
|
||||||
|
|
||||||
To include integration tests into the reports
|
Note: The ./target/staging folder is left intact when cleaning. If you
|
||||||
|
want to remove the folder you have delete it manually.
|
||||||
|
|
||||||
mvn clean package test site site:stage -P$profile-name
|
To include integration tests into the reports run
|
||||||
|
|
||||||
Note: If there are test failures the package goal fails and the site is not
|
mvn clean verifiy site site:stage -P${profileName}
|
||||||
|
|
||||||
|
Note: If there are test failures the build fails and the site is not
|
||||||
build. The build the site anywhy use
|
build. The build the site anywhy use
|
||||||
|
|
||||||
mvn clean package site site:stage -Dmaven.test.failure.ignore=true
|
mvn clean package site site:stage -Dmaven.test.failure.ignore=true
|
||||||
|
|
||||||
or with a profile
|
or with the integration tests included
|
||||||
|
|
||||||
mvn clean package site site:stage -Dmaven.test.failure.ignore=true -Pwildfly-remote-h2-mem
|
mvn clean verify site site:stage -Dmaven.test.failure.ignore=true -P${profileName}
|
||||||
|
|
||||||
The available profiles are listed in the documentation. All modules should
|
## Running integration tests
|
||||||
provide a profile called wildfly-remote-h2-mem. This profile uses a remote
|
|
||||||
Wildfly application server and its integrated H2 in-memory database for
|
|
||||||
running the tests. Before you can run the integration tests you must download
|
|
||||||
Wildfly from http://www.wildfly.org. Unzip the downloaded archive and start
|
|
||||||
the server using the bin/standalone.sh file. Then go to another terminal,
|
|
||||||
navigate to the CCM NG directory and run
|
|
||||||
|
|
||||||
mvn clean package test site site:stage -Pwildfly-remote-h2-mem
|
Some of the modules provide integration tests which use
|
||||||
|
[Arquillian](http://arquillian.org/) to run tests inside an application server.
|
||||||
|
If a module provides integration tests it should have at least four profiles
|
||||||
|
for running them (at the time of writing):
|
||||||
|
|
||||||
|
* `run-its-with-wildfly-h2mem`: This profile uses the
|
||||||
|
[wildfly-maven-plugin](https://docs.jboss.org/wildfly/plugins/maven/latest/)
|
||||||
|
to start a Wildfly and run the integration tests. The H2 database which is
|
||||||
|
integrated with Wildfly is used for run the tests. No configuration
|
||||||
|
is necessary.
|
||||||
|
* `run-its-with-wildfly-pgsql`: This profile uses the
|
||||||
|
[wildfly-maven-plugin](https://docs.jboss.org/wildfly/plugins/maven/latest/)
|
||||||
|
to start a Wildfly and run the integration tests. A PostgreSQL database is
|
||||||
|
used to run the tests. The connection parameters are configured using
|
||||||
|
the `it-pgsql-datasources.properties` file in the project root. Make sure
|
||||||
|
to create a database for all modules and configure them before using
|
||||||
|
this profile.
|
||||||
|
* `run-its-in-remote-wildfly-h2mem`: This profile uses a remote Wildfly and
|
||||||
|
the H2 database for
|
||||||
|
running the tests. The user it responsible for starting the Wildfly container
|
||||||
|
and for creating the required databases.
|
||||||
|
* `run-its-in-remote-wildfly-pgsql`: This profile uses a remote Wildfly and
|
||||||
|
PostgreSQL databases for
|
||||||
|
running the tests. The user it responsible for starting the Wildfly container
|
||||||
|
and for creating the required databases.
|
||||||
|
|
||||||
|
To run the integration tests select a profile - we recommend to use the profiles
|
||||||
|
which use the wildfly-maven-plugin` to manage to Wildfly application server -
|
||||||
|
and run
|
||||||
|
|
||||||
|
mvn verify site site:stage -P${profileName}
|
||||||
|
|
||||||
|
## Running LibreCCM (development environment)
|
||||||
|
|
||||||
|
Before running a bundle the WAR file has the be generated using
|
||||||
|
|
||||||
|
mvn package
|
||||||
|
|
||||||
To run LibreCCM choose the bundle to run, for instance
|
To run LibreCCM choose the bundle to run, for instance
|
||||||
ccm-bundle-devel-wildfly. Depending on the bundle and the selected profile
|
`ccm-bundle-devel-wildfly`. You can run the bundle
|
||||||
you may have to configure a datasource in the Wildfly server and create a
|
|
||||||
database. Also you need to configure an environement variable which points to
|
|
||||||
your Wildfly installation. Then you can run LibreCCM using
|
|
||||||
|
|
||||||
mvn package wildfly:run -DskipTests -pl ccm-bundle-devel-wildfly -am -Pgeneric
|
mvn wildfly:run -pl ${bundleName} -am
|
||||||
|
|
||||||
The above example skips all tests to speed up the start process. The generic
|
This will start a Wildfly server running the selected bundle. Before running
|
||||||
profile used in this example uses an existing Wildfly installation. The
|
the bundle the Wildfly container has the be configured. For these purpose, run
|
||||||
JBOSS_HOME environment variable must either be configured or must be provided.
|
|
||||||
Alternativly you can provide the location of your Wildfly installation using
|
mvn wildfly:run -pl ${bundleName} -am -Psetup-runtime
|
||||||
the -D switch: mvn -Djboss-as.home=/path/to/wildfly/
|
|
||||||
|
This will start the Wildfly server, deploy the bundle WAR, and create a
|
||||||
|
datasource. At the moment only PostgreSQL is supported as database. The
|
||||||
|
datasource configuration is provided by the `datasource.properties` file in the
|
||||||
|
bundle directory. To create one copy the example file and adjust the settings.
|
||||||
|
|
||||||
|
You also have to create a wildfly.properties file which contains some settings
|
||||||
|
for the Wildfly server, for isntance the port the Wildfly server binds to. An
|
||||||
|
example file is provided.
|
||||||
|
|
||||||
|
## Archetypes
|
||||||
|
|
||||||
To install the archetypes in your local Maven repository run
|
To install the archetypes in your local Maven repository run
|
||||||
|
|
||||||
|
|
@ -64,15 +107,6 @@ for example
|
||||||
|
|
||||||
mvn clean install -pl ccm-cms-archetypes-contenttype -am
|
mvn clean install -pl ccm-cms-archetypes-contenttype -am
|
||||||
|
|
||||||
Using the managed profiles (example is for testing):
|
|
||||||
|
|
||||||
mvn clean test -Djboss.home=/path/to/wildfly/ -DstartupTimeoutInSeconds=180 -Pwildfly-managed-h2-mem
|
|
||||||
|
|
||||||
You might need to increase the timeout.
|
|
||||||
|
|
||||||
For convience, we also provide a small Bash script which makes calling some Maven tasks easier. For more information please refer to the help of the ccm.sh script:
|
|
||||||
|
|
||||||
ccm.sh --help
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
mvn clean package site site:stage -Dmaven.test.failure.ignore=true -Pwildfly-remote-h2-mem
|
mvn clean verify site site:stage -Dmaven.test.failure.ignore=true -Prun-its-with-wildfly-h2mem
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
<artifactId>ccm-archetype-module</artifactId>
|
<artifactId>ccm-archetype-module</artifactId>
|
||||||
<version>7.0.0-SNAPSHOT</version>
|
<version>7.0.0-SNAPSHOT</version>
|
||||||
|
|
||||||
<name>LibreCCM Module archetype</name>
|
<name>LibreCCM Module Archetype</name>
|
||||||
<url>http://www.libreccm.org/devel/modules</url>
|
<url>http://www.libreccm.org/devel/modules</url>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
||||||
|
|
@ -228,11 +228,6 @@
|
||||||
<artifactId>jacoco-maven-plugin</artifactId>
|
<artifactId>jacoco-maven-plugin</artifactId>
|
||||||
<version>0.7.5.201505241946</version>
|
<version>0.7.5.201505241946</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
|
||||||
<artifactId>findbugs-maven-plugin</artifactId>
|
|
||||||
<version>3.0.1</version>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
|
|
||||||
|
|
@ -26,9 +26,7 @@ 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 java.io.File;
|
import java.io.File;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -39,7 +37,6 @@ import javax.persistence.PersistenceContext;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
@Category(IntegrationTest.class)
|
|
||||||
@RunWith(Arquillian.class)
|
@RunWith(Arquillian.class)
|
||||||
@PersistenceTest
|
@PersistenceTest
|
||||||
@Transactional(TransactionMode.COMMIT)
|
@Transactional(TransactionMode.COMMIT)
|
||||||
|
|
@ -3,12 +3,6 @@
|
||||||
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<!--<parent>
|
|
||||||
<groupId>org.libreccm</groupId>
|
|
||||||
<artifactId>libreccm-parent</artifactId>
|
|
||||||
<version>7.0.0-SNAPSHOT</version>
|
|
||||||
</parent>-->
|
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.libreccm</groupId>
|
<groupId>org.libreccm</groupId>
|
||||||
<artifactId>ccm-bundle-devel</artifactId>
|
<artifactId>ccm-bundle-devel</artifactId>
|
||||||
|
|
@ -142,17 +136,14 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.webjars</groupId>
|
<groupId>org.webjars</groupId>
|
||||||
<artifactId>font-awesome</artifactId>
|
<artifactId>font-awesome</artifactId>
|
||||||
<version>4.7.0</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.webjars</groupId>
|
<groupId>org.webjars</groupId>
|
||||||
<artifactId>requirejs</artifactId>
|
<artifactId>requirejs</artifactId>
|
||||||
<version>2.3.6</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.webjars</groupId>
|
<groupId>org.webjars</groupId>
|
||||||
<artifactId>requirejs-domready</artifactId>
|
<artifactId>requirejs-domready</artifactId>
|
||||||
<version>2.0.1-2</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project-shared-configuration>
|
|
||||||
<!--
|
|
||||||
This file contains additional configuration written by modules in the NetBeans IDE.
|
|
||||||
The configuration is intended to be shared among all the users of project and
|
|
||||||
therefore it is assumed to be part of version control checkout.
|
|
||||||
Without this configuration present, some functionality in the IDE may be limited or fail altogether.
|
|
||||||
-->
|
|
||||||
<spellchecker-wordlist xmlns="http://www.netbeans.org/ns/spellchecker-wordlist/1">
|
|
||||||
<word>libreccm</word>
|
|
||||||
</spellchecker-wordlist>
|
|
||||||
</project-shared-configuration>
|
|
||||||
|
|
@ -1,200 +0,0 @@
|
||||||
<?xml version="1.0"?>
|
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
||||||
|
|
||||||
<properties>
|
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
||||||
</properties>
|
|
||||||
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
|
|
||||||
<parent>
|
|
||||||
<groupId>org.libreccm</groupId>
|
|
||||||
<artifactId>ccm-bundle-devel</artifactId>
|
|
||||||
<relativePath>../ccm-bundle-devel</relativePath>
|
|
||||||
<version>7.0.0-SNAPSHOT</version>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<groupId>org.libreccm</groupId>
|
|
||||||
<artifactId>ccm-bundle-devel-wildfly-web</artifactId>
|
|
||||||
<!--<version>7.0.0-SNAPSHOT</version>-->
|
|
||||||
<packaging>war</packaging>
|
|
||||||
|
|
||||||
<name>LibreCCM Devel Bundle Web for Wildfly</name>
|
|
||||||
<url>http://www.libreccm.org/modules/web/wildfly</url>
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.webjars</groupId>
|
|
||||||
<artifactId>font-awesome</artifactId>
|
|
||||||
<!--<version>4.7.0</version>-->
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.webjars</groupId>
|
|
||||||
<artifactId>requirejs</artifactId>
|
|
||||||
<!--<version>2.3.5</version>-->
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.webjars</groupId>
|
|
||||||
<artifactId>requirejs-domready</artifactId>
|
|
||||||
<!--<version>2.0.1-2</version>-->
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.webjars.npm</groupId>
|
|
||||||
<artifactId>tinymce</artifactId>
|
|
||||||
<!--<version>4.8.2</version>-->
|
|
||||||
</dependency>
|
|
||||||
<!-- <dependency>
|
|
||||||
<groupId>org.librecms</groupId>
|
|
||||||
<artifactId>ccm-cms-js</artifactId>
|
|
||||||
<version>7.0.0-SNAPSHOT</version>
|
|
||||||
</dependency> -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.librecms</groupId>
|
|
||||||
<artifactId>ccm-cms-pagemodelseditor</artifactId>
|
|
||||||
<version>${project.parent.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.librecms</groupId>
|
|
||||||
<artifactId>ccm-cms-tinymce</artifactId>
|
|
||||||
<version>${project.parent.version}</version>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
<build>
|
|
||||||
<finalName>libreccm-web-wildfly</finalName>
|
|
||||||
|
|
||||||
<resources>
|
|
||||||
<resource>
|
|
||||||
<directory>src/main/resources</directory>
|
|
||||||
</resource>
|
|
||||||
<resource>
|
|
||||||
<directory>${project.build.directory}/generated-resources</directory>
|
|
||||||
</resource>
|
|
||||||
</resources>
|
|
||||||
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<source>1.8</source>
|
|
||||||
<target>1.8</target>
|
|
||||||
<optimize>true</optimize>
|
|
||||||
<debug>true</debug>
|
|
||||||
<encoding>${project.build.sourceEncoding}</encoding>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<plugin>
|
|
||||||
<groupId>com.github.eirslett</groupId>
|
|
||||||
<artifactId>frontend-maven-plugin</artifactId>
|
|
||||||
|
|
||||||
<configuration>
|
|
||||||
<installDirectory>../node</installDirectory>
|
|
||||||
</configuration>
|
|
||||||
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>Install node.js and NPM</id>
|
|
||||||
<goals>
|
|
||||||
<goal>install-node-and-npm</goal>
|
|
||||||
</goals>
|
|
||||||
<configuration>
|
|
||||||
<nodeVersion>v12.18.2</nodeVersion>
|
|
||||||
</configuration>
|
|
||||||
</execution>
|
|
||||||
<execution>
|
|
||||||
<id>npm install ccm-cms-pagemodelseditor</id>
|
|
||||||
<goals>
|
|
||||||
<goal>npm</goal>
|
|
||||||
</goals>
|
|
||||||
<configuration>
|
|
||||||
<arguments>install ../ccm-cms-pagemodelseditor</arguments>
|
|
||||||
</configuration>
|
|
||||||
</execution>
|
|
||||||
<execution>
|
|
||||||
<id>npm install</id>
|
|
||||||
<goals>
|
|
||||||
<goal>npm</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
<execution>
|
|
||||||
<id>build</id>
|
|
||||||
<goals>
|
|
||||||
<goal>npm</goal>
|
|
||||||
</goals>
|
|
||||||
<configuration>
|
|
||||||
<arguments>run build</arguments>
|
|
||||||
</configuration>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-war-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
|
|
||||||
<webResources>
|
|
||||||
<resource>
|
|
||||||
<directory>src/main/resources</directory>
|
|
||||||
</resource>
|
|
||||||
<resource>
|
|
||||||
<directory>${project.build.directory}/generated-resources</directory>
|
|
||||||
</resource>
|
|
||||||
</webResources>
|
|
||||||
|
|
||||||
<overlays>
|
|
||||||
<overlay>
|
|
||||||
<groupId>org.libreccm</groupId>
|
|
||||||
<artifactId>ccm-editor</artifactId>
|
|
||||||
<type>jar</type>
|
|
||||||
</overlay>
|
|
||||||
<overlay>
|
|
||||||
<groupId>org.libreccm</groupId>
|
|
||||||
<artifactId>ccm-pagemodelseditor</artifactId>
|
|
||||||
<type>jar</type>
|
|
||||||
</overlay>
|
|
||||||
<overlay>
|
|
||||||
<groupId>org.libreccm</groupId>
|
|
||||||
<artifactId>ccm-theme-foundry</artifactId>
|
|
||||||
<type>jar</type>
|
|
||||||
</overlay>
|
|
||||||
<overlay>
|
|
||||||
<groupId>org.libreccm</groupId>
|
|
||||||
<artifactId>ccm-core</artifactId>
|
|
||||||
<type>jar</type>
|
|
||||||
<includes>
|
|
||||||
<include>assets/</include>
|
|
||||||
</includes>
|
|
||||||
</overlay>
|
|
||||||
<overlay>
|
|
||||||
<groupId>org.librecms</groupId>
|
|
||||||
<artifactId>ccm-cms</artifactId>
|
|
||||||
<type>jar</type>
|
|
||||||
<includes>
|
|
||||||
<include>templates/</include>
|
|
||||||
</includes>
|
|
||||||
</overlay>
|
|
||||||
<overlay>
|
|
||||||
<groupId>org.librecms</groupId>
|
|
||||||
<artifactId>ccm-cms-tinymce</artifactId>
|
|
||||||
<type>jar</type>
|
|
||||||
<includes>
|
|
||||||
<include>scripts/</include>
|
|
||||||
</includes>
|
|
||||||
</overlay>
|
|
||||||
</overlays>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.wildfly.plugins</groupId>
|
|
||||||
<artifactId>wildfly-maven-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<skip>true</skip>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
</project>
|
|
||||||
|
|
@ -1,107 +0,0 @@
|
||||||
<?xml version="1.0"?>
|
|
||||||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
|
|
||||||
http://maven.apache.org/xsd/maven-4.0.0.xsd"
|
|
||||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
|
||||||
|
|
||||||
<properties>
|
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
||||||
</properties>
|
|
||||||
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
|
|
||||||
<parent>
|
|
||||||
<groupId>org.libreccm</groupId>
|
|
||||||
<artifactId>ccm-bundle-devel</artifactId>
|
|
||||||
<relativePath>../ccm-bundle-devel</relativePath>
|
|
||||||
<version>7.0.0-SNAPSHOT</version>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<groupId>org.libreccm</groupId>
|
|
||||||
<artifactId>ccm-bundle-devel-wildfly-web</artifactId>
|
|
||||||
<!--<version>7.0.0-SNAPSHOT</version>-->
|
|
||||||
<packaging>war</packaging>
|
|
||||||
|
|
||||||
<name>LibreCCM Devel Bundle Web for Wildfly</name>
|
|
||||||
<url>http://www.libreccm.org/modules/web/wildfly</url>
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.webjars</groupId>
|
|
||||||
<artifactId>font-awesome</artifactId>
|
|
||||||
<version>4.7.0</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.webjars</groupId>
|
|
||||||
<artifactId>requirejs</artifactId>
|
|
||||||
<version>2.3.5</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.webjars</groupId>
|
|
||||||
<artifactId>requirejs-domready</artifactId>
|
|
||||||
<version>2.0.1-2</version>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
<build>
|
|
||||||
<finalName>libreccm-web-wildfly</finalName>
|
|
||||||
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<source>1.8</source>
|
|
||||||
<target>1.8</target>
|
|
||||||
<optimize>true</optimize>
|
|
||||||
<debug>true</debug>
|
|
||||||
<encoding>${project.build.sourceEncoding}</encoding>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-war-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<overlays>
|
|
||||||
<overlay>
|
|
||||||
<groupId>org.libreccm</groupId>
|
|
||||||
<artifactId>ccm-editor</artifactId>
|
|
||||||
<type>jar</type>
|
|
||||||
</overlay>
|
|
||||||
<overlay>
|
|
||||||
<groupId>org.libreccm</groupId>
|
|
||||||
<artifactId>ccm-theme-foundry</artifactId>
|
|
||||||
<type>jar</type>
|
|
||||||
</overlay>
|
|
||||||
<overlay>
|
|
||||||
<groupId>org.libreccm</groupId>
|
|
||||||
<artifactId>ccm-core</artifactId>
|
|
||||||
<type>jar</type>
|
|
||||||
<includes>
|
|
||||||
<include>assets/</include>
|
|
||||||
<include>VAADIN/</include>
|
|
||||||
</includes>
|
|
||||||
</overlay>
|
|
||||||
<overlay>
|
|
||||||
<groupId>org.librecms</groupId>
|
|
||||||
<artifactId>ccm-cms</artifactId>
|
|
||||||
<type>jar</type>
|
|
||||||
<includes>
|
|
||||||
<include>templates/</include>
|
|
||||||
</includes>
|
|
||||||
</overlay>
|
|
||||||
</overlays>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.wildfly.plugins</groupId>
|
|
||||||
<artifactId>wildfly-maven-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<skip>true</skip>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
</project>
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
--------------
|
|
||||||
Overview
|
|
||||||
--------------
|
|
||||||
Jens Pelzetter
|
|
||||||
--------------
|
|
||||||
2016-03-18
|
|
||||||
--------------
|
|
||||||
|
|
||||||
LibreCCM Bundle Web for Wildfly
|
|
||||||
|
|
||||||
This module provides the web application part of the the LibreCCM devel
|
|
||||||
bundle for the Wildfly application server.
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<project xmlns="http://maven.apache.org/DECORATION/1.3.0"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://maven.apache.org/DECORATION/1.3.0
|
|
||||||
http://maven.apache.org/xsd/decoration-1.3.0.xsd">
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<menu name="Parent project">
|
|
||||||
<item name="LibreCCM" href="../index.html"/>
|
|
||||||
</menu>
|
|
||||||
|
|
||||||
<menu name="Overview">
|
|
||||||
<item name="The LibreCCM Devel Bundle Web module" href="index.html"/>
|
|
||||||
</menu>
|
|
||||||
|
|
||||||
<menu ref="reports"/>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</project>
|
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
datasource.properties
|
||||||
|
wildfly.properties
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
# ccm-bundle-devel-wildfly README
|
||||||
|
|
||||||
|
This module creates a WAR which can be deployed to a Wildfly Application
|
||||||
|
Server. For testing, the module also provides an runtime environment
|
||||||
|
and the setup. The runtime is managed using the
|
||||||
|
[wildfly-maven-plugin](https://docs.jboss.org/wildfly/plugins/maven/latest/).
|
||||||
|
|
||||||
|
At the moment the runtime only supports PostgreSQL as database.
|
||||||
|
|
||||||
|
To use these runtime some prepration steps are necessary.
|
||||||
|
|
||||||
|
1. Create the configuration files. The runtime is configured using two files:
|
||||||
|
* wildfly.properties allows it to configure the ports used by the Wildfly server
|
||||||
|
* datasource.properties provides the configuration data for datasource used by
|
||||||
|
LibreCCM.
|
||||||
|
|
||||||
|
For both files examples are provided (`datasource.example.properties`,
|
||||||
|
`wildfly.example.properties`). Copy the example files and customize
|
||||||
|
the settings is necessary.
|
||||||
|
|
||||||
|
2. Run a build using the `setup-runtime` profile. It is important to add the
|
||||||
|
`package` goal, otherwise the WAR file which is deployed in this step is
|
||||||
|
not build correctly:
|
||||||
|
|
||||||
|
```
|
||||||
|
mvn package -Psetup-runtime -pl ccm-bundle-devel-wildfly -am
|
||||||
|
```
|
||||||
|
|
||||||
|
During the `package` phase of the this module Wildfly will be downloaded,
|
||||||
|
unpackaged into the `target` directory, the PostgreSQL driver will be
|
||||||
|
deployed, a datasource will be generated and the WAR file will be deployed.
|
||||||
|
|
||||||
|
To run LibreCCM in this environment, use the `enable-runtime` profile and the `wildfly:start`
|
||||||
|
goal:
|
||||||
|
|
||||||
|
mvn -pl ccm-bundle-devel-wildfly wildfly:start
|
||||||
|
|
||||||
|
To shutdown the server:
|
||||||
|
|
||||||
|
mvn -pl ccm-bundle-devel-wildfly wildfly:shutdown
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
libreccm.datasource.connectionUrl=jdbc:postgresql://localhost:5432/ccm-devel-beta
|
||||||
|
libreccm.datasource.username=ccm
|
||||||
|
libreccm.datasource.password=ccm
|
||||||
|
|
@ -3,200 +3,360 @@
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<wildfly.version>12.0.0.Final</wildfly.version>
|
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.libreccm</groupId>
|
<groupId>org.libreccm</groupId>
|
||||||
<artifactId>libreccm-parent</artifactId>
|
<artifactId>ccm-bundle-devel</artifactId>
|
||||||
|
<relativePath>../ccm-bundle-devel</relativePath>
|
||||||
<version>7.0.0-SNAPSHOT</version>
|
<version>7.0.0-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<groupId>org.libreccm</groupId>
|
<groupId>org.libreccm</groupId>
|
||||||
<artifactId>ccm-bundle-devel-wildfly</artifactId>
|
<artifactId>ccm-bundle-devel-wildfly</artifactId>
|
||||||
<!--<version>7.0.0-SNAPSHOT</version>-->
|
<!--<version>7.0.0-SNAPSHOT</version>-->
|
||||||
<packaging>ear</packaging>
|
<packaging>war</packaging>
|
||||||
|
|
||||||
<name>LibreCCM Devel Bundle for Wildfly</name>
|
<name>LibreCCM Devel Bundle for Wildfly</name>
|
||||||
<url>http://www.libreccm.org/bundles/devel/wildfly</url>
|
<url>http://www.libreccm.org/modules/web/wildfly</url>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.libreccm</groupId>
|
<groupId>org.webjars</groupId>
|
||||||
<artifactId>ccm-bundle-devel-wildfly-web</artifactId>
|
<artifactId>font-awesome</artifactId>
|
||||||
<version>${project.parent.version}</version>
|
<!--<version>4.7.0</version>-->
|
||||||
<type>war</type>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.webjars</groupId>
|
||||||
|
<artifactId>requirejs</artifactId>
|
||||||
|
<!--<version>2.3.5</version>-->
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.webjars</groupId>
|
||||||
|
<artifactId>requirejs-domready</artifactId>
|
||||||
|
<!--<version>2.0.1-2</version>-->
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.webjars.npm</groupId>
|
||||||
|
<artifactId>tinymce</artifactId>
|
||||||
|
<!--<version>4.8.2</version>-->
|
||||||
|
</dependency>
|
||||||
|
<!-- <dependency>
|
||||||
|
<groupId>org.librecms</groupId>
|
||||||
|
<artifactId>ccm-cms-js</artifactId>
|
||||||
|
<version>7.0.0-SNAPSHOT</version>
|
||||||
|
</dependency> -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.librecms</groupId>
|
||||||
|
<artifactId>ccm-cms-pagemodelseditor</artifactId>
|
||||||
|
<version>${project.parent.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.librecms</groupId>
|
||||||
|
<artifactId>ccm-cms-tinymce</artifactId>
|
||||||
|
<version>${project.parent.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- <dependency>
|
||||||
|
<groupId>org.postgresql</groupId>
|
||||||
|
<artifactId>postgresql</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>-->
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<finalName>libreccm-devel-${project.version}</finalName>
|
<finalName>libreccm-web-wildfly</finalName>
|
||||||
|
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>src/main/resources</directory>
|
||||||
|
</resource>
|
||||||
|
<resource>
|
||||||
|
<directory>${project.build.directory}/generated-resources</directory>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-ear-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<configuration>
|
<configuration>
|
||||||
<!-- Tell Maven we are using Java EE 7 -->
|
<source>1.8</source>
|
||||||
<version>7</version>
|
<target>1.8</target>
|
||||||
<!-- Use Java EE ear libraries as needed. Java EE ear libraries
|
<optimize>true</optimize>
|
||||||
are an easy way to package any libraries needed in the ear,
|
<debug>true</debug>
|
||||||
and automatically
|
<encoding>${project.build.sourceEncoding}</encoding>
|
||||||
have any modules (EJB-JARs and WARs) use them -->
|
</configuration>
|
||||||
<defaultLibBundleDir>lib</defaultLibBundleDir>
|
</plugin>
|
||||||
<outputFileNameMapping>no-version</outputFileNameMapping>
|
|
||||||
<modules>
|
<plugin>
|
||||||
<webModule>
|
<groupId>com.github.eirslett</groupId>
|
||||||
|
<artifactId>frontend-maven-plugin</artifactId>
|
||||||
|
|
||||||
|
<configuration>
|
||||||
|
<installDirectory>../node</installDirectory>
|
||||||
|
</configuration>
|
||||||
|
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>Install node.js and NPM</id>
|
||||||
|
<goals>
|
||||||
|
<goal>install-node-and-npm</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<nodeVersion>v8.11.4</nodeVersion>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
<!-- <execution>
|
||||||
|
<id>npm link @libreccm/ccm-pagemodelseditor</id>
|
||||||
|
<goals>
|
||||||
|
<goal>npm</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<arguments>link @libreccm/ccm-pagemodelseditor</arguments>
|
||||||
|
</configuration>
|
||||||
|
</execution> -->
|
||||||
|
<execution>
|
||||||
|
<id>npm link @librecms/ccm-cms-pagemodelseditor</id>
|
||||||
|
<goals>
|
||||||
|
<goal>npm</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<arguments>link @librecms/ccm-cms-pagemodelseditor</arguments>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
<!-- <execution>
|
||||||
|
<id>npm link @librecms/ccm-cms-tinymce</id>
|
||||||
|
<goals>
|
||||||
|
<goal>npm</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<arguments>link @librecms/ccm-cms-tinymce</arguments>
|
||||||
|
</configuration>
|
||||||
|
</execution>-->
|
||||||
|
<!--<execution>
|
||||||
|
<id>npm link @librecms/ccm-cms-js</id>
|
||||||
|
<goals>
|
||||||
|
<goal>npm</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<arguments>link @librecms/ccm-cms-js</arguments>
|
||||||
|
</configuration>
|
||||||
|
</execution>-->
|
||||||
|
<execution>
|
||||||
|
<id>npm install</id>
|
||||||
|
<goals>
|
||||||
|
<goal>npm</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>build</id>
|
||||||
|
<goals>
|
||||||
|
<goal>npm</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<arguments>run build</arguments>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-war-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
|
||||||
|
<webResources>
|
||||||
|
<resource>
|
||||||
|
<directory>src/main/resources</directory>
|
||||||
|
</resource>
|
||||||
|
<resource>
|
||||||
|
<directory>${project.build.directory}/generated-resources</directory>
|
||||||
|
</resource>
|
||||||
|
</webResources>
|
||||||
|
|
||||||
|
<overlays>
|
||||||
|
<overlay>
|
||||||
<groupId>org.libreccm</groupId>
|
<groupId>org.libreccm</groupId>
|
||||||
<artifactId>ccm-bundle-devel-wildfly-web</artifactId>
|
<artifactId>ccm-editor</artifactId>
|
||||||
<contextRoot>/libreccm</contextRoot>
|
<type>jar</type>
|
||||||
</webModule>
|
</overlay>
|
||||||
</modules>
|
<overlay>
|
||||||
|
<groupId>org.libreccm</groupId>
|
||||||
|
<artifactId>ccm-pagemodelseditor</artifactId>
|
||||||
|
<type>jar</type>
|
||||||
|
</overlay>
|
||||||
|
<overlay>
|
||||||
|
<groupId>org.libreccm</groupId>
|
||||||
|
<artifactId>ccm-theme-foundry</artifactId>
|
||||||
|
<type>jar</type>
|
||||||
|
</overlay>
|
||||||
|
<overlay>
|
||||||
|
<groupId>org.libreccm</groupId>
|
||||||
|
<artifactId>ccm-core</artifactId>
|
||||||
|
<type>jar</type>
|
||||||
|
<includes>
|
||||||
|
<include>assets/</include>
|
||||||
|
</includes>
|
||||||
|
</overlay>
|
||||||
|
<overlay>
|
||||||
|
<groupId>org.librecms</groupId>
|
||||||
|
<artifactId>ccm-cms</artifactId>
|
||||||
|
<type>jar</type>
|
||||||
|
<includes>
|
||||||
|
<include>templates/</include>
|
||||||
|
</includes>
|
||||||
|
</overlay>
|
||||||
|
<overlay>
|
||||||
|
<groupId>org.librecms</groupId>
|
||||||
|
<artifactId>ccm-cms-tinymce</artifactId>
|
||||||
|
<type>jar</type>
|
||||||
|
<includes>
|
||||||
|
<include>scripts/</include>
|
||||||
|
</includes>
|
||||||
|
</overlay>
|
||||||
|
</overlays>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-clean-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<excludeDefaultDirectories>true</excludeDefaultDirectories>
|
||||||
|
<filesets>
|
||||||
|
<fileset>
|
||||||
|
<directory>${project.build.directory}</directory>
|
||||||
|
<excludes>
|
||||||
|
<exclude>wildfly*/**</exclude>
|
||||||
|
</excludes>
|
||||||
|
</fileset>
|
||||||
|
</filesets>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.wildfly.plugins</groupId>
|
||||||
|
<artifactId>wildfly-maven-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<skip>false</skip>
|
||||||
|
<propertiesFile>${project.basedir}/wildfly.properties</propertiesFile>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
<!-- Profiles for running the bundle in a development environment -->
|
|
||||||
<profiles>
|
<profiles>
|
||||||
|
|
||||||
<!-- Profile which uses a H2 database. The DB file is put into the
|
|
||||||
project build directory and therefore deleted when the clean phase
|
|
||||||
runs.
|
|
||||||
-->
|
|
||||||
<profile>
|
<profile>
|
||||||
<id>h2</id>
|
<id>setup-runtime</id>
|
||||||
|
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.wildfly.plugins</groupId>
|
|
||||||
<artifactId>wildfly-maven-plugin</artifactId>
|
|
||||||
|
|
||||||
<configuration>
|
|
||||||
<version>${wildfly.version}</version>
|
|
||||||
|
|
||||||
<skip>false</skip>
|
|
||||||
|
|
||||||
<add-user>
|
|
||||||
<users>
|
|
||||||
<user>
|
|
||||||
<username>admin</username>
|
|
||||||
<password>admin123</password>
|
|
||||||
</user>
|
|
||||||
</users>
|
|
||||||
</add-user>
|
|
||||||
|
|
||||||
<beforeDeployment>
|
|
||||||
<commands>
|
|
||||||
<command>data-source add --jndi-name=java:/comp/env/jdbc/libreccm/db --name=ccm-devel --connection-url=jdbc:h2:${project.build.directory}/libreccm-db;DB_CLOSE_ON_EXIT=FALSE --driver-name=h2 --driver-class=org.h2.Driver --user-name=sa --password=sa</command>
|
|
||||||
</commands>
|
|
||||||
</beforeDeployment>
|
|
||||||
|
|
||||||
<java-opts>
|
|
||||||
<java-opt>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8787</java-opt>
|
|
||||||
</java-opts>
|
|
||||||
|
|
||||||
</configuration>
|
|
||||||
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
</profile>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Profile which uses a PostgreSQL datasource with a generic
|
|
||||||
configuration. When using this profile PostgreSQL must run on the
|
|
||||||
local system and a database with the name "libreccm-devel" which
|
|
||||||
is accessible by the user "ccm" with the password "ccm47web" must
|
|
||||||
exist.
|
|
||||||
-->
|
|
||||||
<profile>
|
|
||||||
<id>pgsql</id>
|
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.postgresql</groupId>
|
<groupId>org.postgresql</groupId>
|
||||||
<artifactId>postgresql</artifactId>
|
<artifactId>postgresql</artifactId>
|
||||||
<version>9.4.1208</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
|
<artifactId>properties-maven-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>read-datasource-properties</id>
|
||||||
|
<phase>initialize</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>read-project-properties</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<files>
|
||||||
|
<file>${project.basedir}/datasource.properties</file>
|
||||||
|
</files>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.wildfly.plugins</groupId>
|
<groupId>org.wildfly.plugins</groupId>
|
||||||
<artifactId>wildfly-maven-plugin</artifactId>
|
<artifactId>wildfly-maven-plugin</artifactId>
|
||||||
|
|
||||||
<configuration>
|
<configuration>
|
||||||
<version>${wildfly.version}</version>
|
|
||||||
|
|
||||||
<skip>false</skip>
|
<skip>false</skip>
|
||||||
|
<propertiesFile>${project.basedir}/wildfly.properties</propertiesFile>
|
||||||
<add-user>
|
|
||||||
<users>
|
|
||||||
<user>
|
|
||||||
<username>admin</username>
|
|
||||||
<password>admin1234</password>
|
|
||||||
</user>
|
|
||||||
</users>
|
|
||||||
</add-user>
|
|
||||||
|
|
||||||
<beforeDeployment>
|
|
||||||
<commands>
|
|
||||||
<!--jdbc-drivers/postgresql-9.4.1208.jar-->
|
|
||||||
<command>module add --name=org.postgres --resources=${project.build.directory}/${project.build.finalName}/lib/postgresql.jar --dependencies=javax.api,javax.transaction.api</command>
|
|
||||||
<command>/subsystem=datasources/jdbc-driver=postgres:add(driver-name="postgres",driver-module-name="org.postgres",driver-class-name=org.postgresql.Driver)</command>
|
|
||||||
<command>data-source add --jndi-name=java:/comp/env/jdbc/libreccm/db --name=libreccm-devel --connection-url=jdbc:postgresql://localhost:5432/libreccm-devel --driver-name=postgres --driver-class=org.postgresql.Driver --user-name=ccm --password=ccm47web</command>
|
|
||||||
</commands>
|
|
||||||
</beforeDeployment>
|
|
||||||
|
|
||||||
<java-opts>
|
|
||||||
<java-opt>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8787</java-opt>
|
|
||||||
</java-opts>
|
|
||||||
|
|
||||||
</configuration>
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>start-for-prepare</id>
|
||||||
|
<goals>
|
||||||
|
<goal>start</goal>
|
||||||
|
</goals>
|
||||||
|
<phase>package</phase>
|
||||||
|
<configuration>
|
||||||
|
<stdout>System.out</stdout>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>deploy-jdbc-driver</id>
|
||||||
|
<configuration>
|
||||||
|
<groupId>org.postgresql</groupId>
|
||||||
|
<artifactId>postgresql</artifactId>
|
||||||
|
<name>postgresql.jar</name>
|
||||||
|
<force>true</force>
|
||||||
|
</configuration>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>deploy-artifact</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>add-datasource</id>
|
||||||
|
<configuration>
|
||||||
|
<address>subsystem=datasources,data-source=ccm-devel</address>
|
||||||
|
<force>true</force>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<properties>
|
||||||
|
<connection-url>${libreccm.datasource.connectionUrl}</connection-url>
|
||||||
|
<jndi-name>java:/comp/env/jdbc/libreccm/db</jndi-name>
|
||||||
|
<enabled>true</enabled>
|
||||||
|
<user-name>${libreccm.datasource.username}</user-name>
|
||||||
|
<password>${libreccm.datasource.password}</password>
|
||||||
|
<use-ccm>false</use-ccm>
|
||||||
|
<driver-name>postgresql.jar</driver-name>
|
||||||
|
</properties>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
|
||||||
|
</configuration>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>add-resource</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>deploy-libreccm-bundle-devel</id>
|
||||||
|
<configuration>
|
||||||
|
<force>true</force>
|
||||||
|
</configuration>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>deploy-only</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>shutdown-after-deploy</id>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>shutdown</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</profile>
|
</profile>
|
||||||
|
|
||||||
<!--
|
|
||||||
Generic profile for using an existing Wildfly installation.
|
|
||||||
The datasource for CCM must be configured in the Wildfly instance.
|
|
||||||
Also the plugin must know where the wildfly installation is. This
|
|
||||||
can either be done by setting the JBOSS_HOME environment variable or
|
|
||||||
by providing the location using -Djboss-as.home=/path/to/wildfly
|
|
||||||
on the command line.
|
|
||||||
-->
|
|
||||||
<profile>
|
|
||||||
<id>generic</id>
|
|
||||||
|
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.wildfly.plugins</groupId>
|
|
||||||
<artifactId>wildfly-maven-plugin</artifactId>
|
|
||||||
|
|
||||||
<configuration>
|
|
||||||
<version>${wildfly.version}</version>
|
|
||||||
|
|
||||||
<skip>false</skip>
|
|
||||||
<startupTimeout>120</startupTimeout>
|
|
||||||
|
|
||||||
<java-opts>
|
|
||||||
<java-opt>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8787</java-opt>
|
|
||||||
</java-opts>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
|
|
||||||
</profile>
|
|
||||||
</profiles>
|
</profiles>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
||||||
|
|
@ -6,200 +6,102 @@
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<wildfly.version>10.0.0.Final</wildfly.version>
|
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.libreccm</groupId>
|
<groupId>org.libreccm</groupId>
|
||||||
<artifactId>libreccm-parent</artifactId>
|
<artifactId>ccm-bundle-devel</artifactId>
|
||||||
|
<relativePath>../ccm-bundle-devel</relativePath>
|
||||||
<version>7.0.0-SNAPSHOT</version>
|
<version>7.0.0-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<groupId>org.libreccm</groupId>
|
<groupId>org.libreccm</groupId>
|
||||||
<artifactId>ccm-bundle-devel-wildfly</artifactId>
|
<artifactId>ccm-bundle-devel-wildfly-web</artifactId>
|
||||||
<!--<version>7.0.0-SNAPSHOT</version>-->
|
<!--<version>7.0.0-SNAPSHOT</version>-->
|
||||||
<packaging>ear</packaging>
|
<packaging>war</packaging>
|
||||||
|
|
||||||
<name>LibreCCM Devel Bundle for Wildfly</name>
|
<name>LibreCCM Devel Bundle Web for Wildfly</name>
|
||||||
<url>http://www.libreccm.org/bundles/devel/wildfly</url>
|
<url>http://www.libreccm.org/modules/web/wildfly</url>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.libreccm</groupId>
|
<groupId>org.webjars</groupId>
|
||||||
<artifactId>ccm-bundle-devel-wildfly-web</artifactId>
|
<artifactId>font-awesome</artifactId>
|
||||||
<version>${project.parent.version}</version>
|
<version>4.7.0</version>
|
||||||
<type>war</type>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.webjars</groupId>
|
||||||
|
<artifactId>requirejs</artifactId>
|
||||||
|
<version>2.3.5</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.webjars</groupId>
|
||||||
|
<artifactId>requirejs-domready</artifactId>
|
||||||
|
<version>2.0.1-2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<finalName>libreccm-devel-${project.version}</finalName>
|
<finalName>libreccm-web-wildfly</finalName>
|
||||||
|
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-ear-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<configuration>
|
<configuration>
|
||||||
<!-- Tell Maven we are using Java EE 7 -->
|
<source>1.8</source>
|
||||||
<version>7</version>
|
<target>1.8</target>
|
||||||
<!-- Use Java EE ear libraries as needed. Java EE ear libraries
|
<optimize>true</optimize>
|
||||||
are an easy way to package any libraries needed in the ear,
|
<debug>true</debug>
|
||||||
and automatically
|
<encoding>${project.build.sourceEncoding}</encoding>
|
||||||
have any modules (EJB-JARs and WARs) use them -->
|
|
||||||
<defaultLibBundleDir>lib</defaultLibBundleDir>
|
|
||||||
<fileNameMapping>no-version</fileNameMapping>
|
|
||||||
<modules>
|
|
||||||
<webModule>
|
|
||||||
<groupId>org.libreccm</groupId>
|
|
||||||
<artifactId>ccm-bundle-devel-wildfly-web</artifactId>
|
|
||||||
<contextRoot>/libreccm</contextRoot>
|
|
||||||
</webModule>
|
|
||||||
</modules>
|
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-war-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<overlays>
|
||||||
|
<overlay>
|
||||||
|
<groupId>org.libreccm</groupId>
|
||||||
|
<artifactId>ccm-editor</artifactId>
|
||||||
|
<type>jar</type>
|
||||||
|
</overlay>
|
||||||
|
<overlay>
|
||||||
|
<groupId>org.libreccm</groupId>
|
||||||
|
<artifactId>ccm-theme-foundry</artifactId>
|
||||||
|
<type>jar</type>
|
||||||
|
</overlay>
|
||||||
|
<overlay>
|
||||||
|
<groupId>org.libreccm</groupId>
|
||||||
|
<artifactId>ccm-core</artifactId>
|
||||||
|
<type>jar</type>
|
||||||
|
<includes>
|
||||||
|
<include>assets/</include>
|
||||||
|
<include>VAADIN/</include>
|
||||||
|
</includes>
|
||||||
|
</overlay>
|
||||||
|
<overlay>
|
||||||
|
<groupId>org.librecms</groupId>
|
||||||
|
<artifactId>ccm-cms</artifactId>
|
||||||
|
<type>jar</type>
|
||||||
|
<includes>
|
||||||
|
<include>templates/</include>
|
||||||
|
</includes>
|
||||||
|
</overlay>
|
||||||
|
</overlays>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.wildfly.plugins</groupId>
|
||||||
|
<artifactId>wildfly-maven-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<skip>true</skip>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
<!-- Profiles for running the bundle in a development environment -->
|
|
||||||
<profiles>
|
|
||||||
|
|
||||||
<!-- Profile which uses a H2 database. The DB file is put into the
|
|
||||||
project build directory and therefore deleted when the clean phase
|
|
||||||
runs.
|
|
||||||
-->
|
|
||||||
<profile>
|
|
||||||
<id>h2</id>
|
|
||||||
|
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.wildfly.plugins</groupId>
|
|
||||||
<artifactId>wildfly-maven-plugin</artifactId>
|
|
||||||
|
|
||||||
<configuration>
|
|
||||||
<version>${wildfly.version}</version>
|
|
||||||
|
|
||||||
<skip>false</skip>
|
|
||||||
|
|
||||||
<add-user>
|
|
||||||
<users>
|
|
||||||
<user>
|
|
||||||
<username>admin</username>
|
|
||||||
<password>admin123</password>
|
|
||||||
</user>
|
|
||||||
</users>
|
|
||||||
</add-user>
|
|
||||||
|
|
||||||
<beforeDeployment>
|
|
||||||
<commands>
|
|
||||||
<command>data-source add --jndi-name=java:/comp/env/jdbc/libreccm/db --name=ccm-devel --connection-url=jdbc:h2:${project.build.directory}/libreccm-db;DB_CLOSE_ON_EXIT=FALSE --driver-name=h2 --driver-class=org.h2.Driver --user-name=sa --password=sa</command>
|
|
||||||
</commands>
|
|
||||||
</beforeDeployment>
|
|
||||||
|
|
||||||
<java-opts>
|
|
||||||
<java-opt>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8787</java-opt>
|
|
||||||
</java-opts>
|
|
||||||
|
|
||||||
</configuration>
|
|
||||||
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
</profile>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Profile which uses a PostgreSQL datasource with a generic
|
|
||||||
configuration. When using this profile PostgreSQL must run on the
|
|
||||||
local system and a database with the name "libreccm-devel" which
|
|
||||||
is accessible by the user "ccm" with the password "ccm47web" must
|
|
||||||
exist.
|
|
||||||
-->
|
|
||||||
<profile>
|
|
||||||
<id>pgsql</id>
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.postgresql</groupId>
|
|
||||||
<artifactId>postgresql</artifactId>
|
|
||||||
<version>9.4.1208</version>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.wildfly.plugins</groupId>
|
|
||||||
<artifactId>wildfly-maven-plugin</artifactId>
|
|
||||||
|
|
||||||
<configuration>
|
|
||||||
<version>${wildfly.version}</version>
|
|
||||||
|
|
||||||
<skip>false</skip>
|
|
||||||
|
|
||||||
<add-user>
|
|
||||||
<users>
|
|
||||||
<user>
|
|
||||||
<username>admin</username>
|
|
||||||
<password>admin1234</password>
|
|
||||||
</user>
|
|
||||||
</users>
|
|
||||||
</add-user>
|
|
||||||
|
|
||||||
<beforeDeployment>
|
|
||||||
<commands>
|
|
||||||
<!--jdbc-drivers/postgresql-9.4.1208.jar-->
|
|
||||||
<command>module add --name=org.postgres --resources=${project.build.directory}/${project.build.finalName}/lib/postgresql.jar --dependencies=javax.api,javax.transaction.api</command>
|
|
||||||
<command>/subsystem=datasources/jdbc-driver=postgres:add(driver-name="postgres",driver-module-name="org.postgres",driver-class-name=org.postgresql.Driver)</command>
|
|
||||||
<command>data-source add --jndi-name=java:/comp/env/jdbc/libreccm/db --name=libreccm-devel --connection-url=jdbc:postgresql://localhost:5432/libreccm-devel --driver-name=postgres --driver-class=org.postgresql.Driver --user-name=ccm --password=ccm47web</command>
|
|
||||||
</commands>
|
|
||||||
</beforeDeployment>
|
|
||||||
|
|
||||||
<java-opts>
|
|
||||||
<java-opt>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8787</java-opt>
|
|
||||||
</java-opts>
|
|
||||||
|
|
||||||
</configuration>
|
|
||||||
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
</profile>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Generic profile for using an existing Wildfly installation.
|
|
||||||
The datasource for CCM must be configured in the Wildfly instance.
|
|
||||||
Also the plugin must know where the wildfly installation is. This
|
|
||||||
can either be done by setting the JBOSS_HOME environment variable or
|
|
||||||
by providing the location using -Djboss-as.home=/path/to/wildfly
|
|
||||||
on the command line.
|
|
||||||
-->
|
|
||||||
<profile>
|
|
||||||
<id>generic</id>
|
|
||||||
|
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.wildfly.plugins</groupId>
|
|
||||||
<artifactId>wildfly-maven-plugin</artifactId>
|
|
||||||
|
|
||||||
<configuration>
|
|
||||||
<version>${wildfly.version}</version>
|
|
||||||
|
|
||||||
<skip>false</skip>
|
|
||||||
<startupTimeout>120</startupTimeout>
|
|
||||||
|
|
||||||
<java-opts>
|
|
||||||
<java-opt>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8787</java-opt>
|
|
||||||
</java-opts>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
|
|
||||||
</profile>
|
|
||||||
</profiles>
|
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
<?xml version="1.0" ?>
|
||||||
|
<jboss-web>
|
||||||
|
<context-root>/libreccm</context-root>
|
||||||
|
</jboss-web>
|
||||||
|
|
@ -3,61 +3,10 @@
|
||||||
--------------
|
--------------
|
||||||
Jens Pelzetter
|
Jens Pelzetter
|
||||||
--------------
|
--------------
|
||||||
2016-06-03
|
2016-03-18
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
LibreCCM Bundle for Wildfly
|
LibreCCM Bundle Web for Wildfly
|
||||||
|
|
||||||
This module provides the LibreCCM development bundle for the Wildfly
|
This module provides the web application part of the the LibreCCM devel
|
||||||
application server.
|
bundle for the Wildfly application server.
|
||||||
|
|
||||||
This bundle is not meant for production use as its contains most of the
|
|
||||||
available modules.
|
|
||||||
|
|
||||||
Developers can run this LibreCCM directly from Maven. Three profiles are
|
|
||||||
provided:
|
|
||||||
|
|
||||||
[h2] Uses a H2 database located in the project build directory. This means
|
|
||||||
that the database is deleted every time <<<mvn clean>>>.
|
|
||||||
|
|
||||||
[pgsql] Uses an PostgresSQL database with a generic configuration. The
|
|
||||||
PostgreSQL server must run on localhost and the standard port and there
|
|
||||||
must be a database called with <<<libreccm-devel>>> which is accessible
|
|
||||||
for the user <<<ccm>>> using the password <<<ccm47web>>>.
|
|
||||||
|
|
||||||
[generic] Uses an existing Wildfly installation. The datasource for the
|
|
||||||
database which is used by LibreCCM has to be configured by the user for this
|
|
||||||
profile. Also, Maven or more exactly the wildfly-maven-plugin has to know
|
|
||||||
the location of the Wildfly instance to use. The location of the Wildfly
|
|
||||||
instance can either be provided on the command line when invoking Maven
|
|
||||||
or by setting the <<<JBOSS_HOME>>> environment variable.
|
|
||||||
|
|
||||||
When using the <<<h2>>> it is not necessary to install a Wildfly application
|
|
||||||
server first. The <wildfly-maven-plugin> will download the Wildfly
|
|
||||||
application server and extract the server into the <<<target>>> directory.
|
|
||||||
|
|
||||||
The <<<h2>>> and the <<<pgsql>>> profile add a user to the Wildfly server
|
|
||||||
with the username <<<admin>>> and the password <<<admin123>>> which allow
|
|
||||||
the developer to access the management web UI of the Wildfly server.
|
|
||||||
|
|
||||||
* Run examples
|
|
||||||
|
|
||||||
** Profile h2
|
|
||||||
|
|
||||||
To run the LibreCCM bundle using a H2 database:
|
|
||||||
|
|
||||||
mvn package wildfly:run -pl ccm-bundle-devel-wildfly -am -Ph2
|
|
||||||
|
|
||||||
** Profile pgsql
|
|
||||||
|
|
||||||
mvn package wildfly:run -pl ccm-bundle-devel-wildfly -am -Ppgsql
|
|
||||||
|
|
||||||
** Profile generic
|
|
||||||
|
|
||||||
mvn -Djboss-as.home=/home/mustermann/java-ee-servers/wildfly/wildfly-10.0.0.Final package wildfly:run -pl ccm-bundle-devel-wildfly -am -Pgeneric
|
|
||||||
|
|
||||||
** Additional options
|
|
||||||
|
|
||||||
The <<<wildfly:run>>> goal of the <wildfly-maven-plugin> provides several
|
|
||||||
other options. For a complete list please refer to the documentation of the
|
|
||||||
{{{https://docs.jboss.org/wildfly/plugins/maven/latest/run-mojo.html}run goal}}.
|
|
||||||
|
|
|
||||||
|
|
@ -10,11 +10,10 @@
|
||||||
</menu>
|
</menu>
|
||||||
|
|
||||||
<menu name="Overview">
|
<menu name="Overview">
|
||||||
<item name="The LibreCCM Devel Bundle module" href="index.html"/>
|
<item name="The LibreCCM Devel Bundle Web module" href="index.html"/>
|
||||||
</menu>
|
</menu>
|
||||||
|
|
||||||
<menu ref="reports"/>
|
<menu ref="reports"/>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
# Configuration for Wildfly, primarly ports on which Wildfly will listen
|
||||||
|
|
||||||
|
# Ports for Undertow (Servlet Container). These are the ports which you are
|
||||||
|
# using the access your application
|
||||||
|
jboss.http.port=8080
|
||||||
|
jboss.https.port=8443
|
||||||
|
|
||||||
|
# Ports for Wildfly's Management Interface
|
||||||
|
jboss.management.http.port=9990
|
||||||
|
jboss.management.https.port=9993
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -236,11 +236,6 @@
|
||||||
<artifactId>jacoco-maven-plugin</artifactId>
|
<artifactId>jacoco-maven-plugin</artifactId>
|
||||||
<version>0.7.5.201505241946</version>
|
<version>0.7.5.201505241946</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
|
||||||
<artifactId>findbugs-maven-plugin</artifactId>
|
|
||||||
<version>3.0.1</version>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
|
|
||||||
|
|
@ -64,12 +64,12 @@
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.hibernate</groupId>
|
<groupId>org.hibernate.validator</groupId>
|
||||||
<artifactId>hibernate-validator</artifactId>
|
<artifactId>hibernate-validator</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.hibernate</groupId>
|
<groupId>org.hibernate.validator</groupId>
|
||||||
<artifactId>hibernate-validator-cdi</artifactId>
|
<artifactId>hibernate-validator-cdi</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
@ -255,10 +255,6 @@
|
||||||
<groupId>org.jacoco</groupId>
|
<groupId>org.jacoco</groupId>
|
||||||
<artifactId>jacoco-maven-plugin</artifactId>
|
<artifactId>jacoco-maven-plugin</artifactId>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
|
||||||
<artifactId>findbugs-maven-plugin</artifactId>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
|
|
||||||
|
|
@ -64,12 +64,12 @@
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.hibernate</groupId>
|
<groupId>org.hibernate.validator</groupId>
|
||||||
<artifactId>hibernate-validator</artifactId>
|
<artifactId>hibernate-validator</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.hibernate</groupId>
|
<groupId>org.hibernate.validator</groupId>
|
||||||
<artifactId>hibernate-validator-cdi</artifactId>
|
<artifactId>hibernate-validator-cdi</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
@ -252,10 +252,6 @@
|
||||||
<groupId>org.jacoco</groupId>
|
<groupId>org.jacoco</groupId>
|
||||||
<artifactId>jacoco-maven-plugin</artifactId>
|
<artifactId>jacoco-maven-plugin</artifactId>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
|
||||||
<artifactId>findbugs-maven-plugin</artifactId>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
|
|
||||||
|
|
@ -64,12 +64,12 @@
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.hibernate</groupId>
|
<groupId>org.hibernate.validator</groupId>
|
||||||
<artifactId>hibernate-validator</artifactId>
|
<artifactId>hibernate-validator</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.hibernate</groupId>
|
<groupId>org.hibernate.validator</groupId>
|
||||||
<artifactId>hibernate-validator-cdi</artifactId>
|
<artifactId>hibernate-validator-cdi</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
@ -251,10 +251,6 @@
|
||||||
<groupId>org.jacoco</groupId>
|
<groupId>org.jacoco</groupId>
|
||||||
<artifactId>jacoco-maven-plugin</artifactId>
|
<artifactId>jacoco-maven-plugin</artifactId>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
|
||||||
<artifactId>findbugs-maven-plugin</artifactId>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
|
|
||||||
|
|
@ -64,12 +64,12 @@
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.hibernate</groupId>
|
<groupId>org.hibernate.validator</groupId>
|
||||||
<artifactId>hibernate-validator</artifactId>
|
<artifactId>hibernate-validator</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.hibernate</groupId>
|
<groupId>org.hibernate.validator</groupId>
|
||||||
<artifactId>hibernate-validator-cdi</artifactId>
|
<artifactId>hibernate-validator-cdi</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
@ -252,10 +252,6 @@
|
||||||
<groupId>org.jacoco</groupId>
|
<groupId>org.jacoco</groupId>
|
||||||
<artifactId>jacoco-maven-plugin</artifactId>
|
<artifactId>jacoco-maven-plugin</artifactId>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
|
||||||
<artifactId>findbugs-maven-plugin</artifactId>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
|
|
||||||
|
|
@ -64,12 +64,12 @@
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.hibernate</groupId>
|
<groupId>org.hibernate.validator</groupId>
|
||||||
<artifactId>hibernate-validator</artifactId>
|
<artifactId>hibernate-validator</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.hibernate</groupId>
|
<groupId>org.hibernate.validator</groupId>
|
||||||
<artifactId>hibernate-validator-cdi</artifactId>
|
<artifactId>hibernate-validator-cdi</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
@ -251,10 +251,6 @@
|
||||||
<groupId>org.jacoco</groupId>
|
<groupId>org.jacoco</groupId>
|
||||||
<artifactId>jacoco-maven-plugin</artifactId>
|
<artifactId>jacoco-maven-plugin</artifactId>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
|
||||||
<artifactId>findbugs-maven-plugin</artifactId>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
|
|
||||||
|
|
@ -64,12 +64,12 @@
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.hibernate</groupId>
|
<groupId>org.hibernate.validator</groupId>
|
||||||
<artifactId>hibernate-validator</artifactId>
|
<artifactId>hibernate-validator</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.hibernate</groupId>
|
<groupId>org.hibernate.validator</groupId>
|
||||||
<artifactId>hibernate-validator-cdi</artifactId>
|
<artifactId>hibernate-validator-cdi</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
@ -251,10 +251,6 @@
|
||||||
<groupId>org.jacoco</groupId>
|
<groupId>org.jacoco</groupId>
|
||||||
<artifactId>jacoco-maven-plugin</artifactId>
|
<artifactId>jacoco-maven-plugin</artifactId>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
|
||||||
<artifactId>findbugs-maven-plugin</artifactId>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
|
|
||||||
|
|
@ -64,12 +64,12 @@
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.hibernate</groupId>
|
<groupId>org.hibernate.validator</groupId>
|
||||||
<artifactId>hibernate-validator</artifactId>
|
<artifactId>hibernate-validator</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.hibernate</groupId>
|
<groupId>org.hibernate.validator</groupId>
|
||||||
<artifactId>hibernate-validator-cdi</artifactId>
|
<artifactId>hibernate-validator-cdi</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
@ -251,10 +251,6 @@
|
||||||
<groupId>org.jacoco</groupId>
|
<groupId>org.jacoco</groupId>
|
||||||
<artifactId>jacoco-maven-plugin</artifactId>
|
<artifactId>jacoco-maven-plugin</artifactId>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
|
||||||
<artifactId>findbugs-maven-plugin</artifactId>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
|
|
||||||
|
|
@ -64,12 +64,12 @@
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.hibernate</groupId>
|
<groupId>org.hibernate.validator</groupId>
|
||||||
<artifactId>hibernate-validator</artifactId>
|
<artifactId>hibernate-validator</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.hibernate</groupId>
|
<groupId>org.hibernate.validator</groupId>
|
||||||
<artifactId>hibernate-validator-cdi</artifactId>
|
<artifactId>hibernate-validator-cdi</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
@ -252,10 +252,6 @@
|
||||||
<groupId>org.jacoco</groupId>
|
<groupId>org.jacoco</groupId>
|
||||||
<artifactId>jacoco-maven-plugin</artifactId>
|
<artifactId>jacoco-maven-plugin</artifactId>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
|
||||||
<artifactId>findbugs-maven-plugin</artifactId>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
|
|
||||||
595
ccm-cms/pom.xml
595
ccm-cms/pom.xml
|
|
@ -55,12 +55,12 @@
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.hibernate</groupId>
|
<groupId>org.hibernate.validator</groupId>
|
||||||
<artifactId>hibernate-validator</artifactId>
|
<artifactId>hibernate-validator</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.hibernate</groupId>
|
<groupId>org.hibernate.validator</groupId>
|
||||||
<artifactId>hibernate-validator-cdi</artifactId>
|
<artifactId>hibernate-validator-cdi</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
@ -294,16 +294,9 @@
|
||||||
<artifactId>jacoco-maven-plugin</artifactId>
|
<artifactId>jacoco-maven-plugin</artifactId>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
|
||||||
<artifactId>findbugs-maven-plugin</artifactId>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>com.github.spotbugs</groupId>
|
<groupId>com.github.spotbugs</groupId>
|
||||||
<artifactId>spotbugs-maven-plugin</artifactId>
|
<artifactId>spotbugs-maven-plugin</artifactId>
|
||||||
<!--<configuration>
|
|
||||||
<excludeFilterFile>findbugs-exclude.xml</excludeFilterFile>
|
|
||||||
</configuration>-->
|
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
<plugin>
|
<plugin>
|
||||||
|
|
@ -360,192 +353,18 @@
|
||||||
|
|
||||||
<profiles>
|
<profiles>
|
||||||
<profile>
|
<profile>
|
||||||
<id>wildfly-managed-h2-mem</id>
|
<id>run-its-with-wildfly-h2mem</id>
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.wildfly.arquillian</groupId>
|
|
||||||
<artifactId>wildfly-arquillian-container-managed</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.jacoco</groupId>
|
|
||||||
<artifactId>org.jacoco.core</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.jboss.arquillian.extension</groupId>
|
|
||||||
<artifactId>arquillian-jacoco</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>net.sf.saxon</groupId>
|
|
||||||
<artifactId>Saxon-HE</artifactId>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
<build>
|
|
||||||
<testResources>
|
|
||||||
<testResource>
|
|
||||||
<directory>src/test/resources</directory>
|
|
||||||
</testResource>
|
|
||||||
<testResource>
|
|
||||||
<directory>src/test/resources-wildfly-remote-h2-mem</directory>
|
|
||||||
</testResource>
|
|
||||||
<testResource>
|
|
||||||
<directory>${project.build.directory}/generated-resources</directory>
|
|
||||||
</testResource>
|
|
||||||
</testResources>
|
|
||||||
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>de.jpdigital</groupId>
|
|
||||||
<artifactId>hibernate53-ddl-maven-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<dialects>
|
|
||||||
<param>h2</param>
|
|
||||||
<param>postgresql9</param>
|
|
||||||
</dialects>
|
|
||||||
<packages>
|
|
||||||
<param>org.libreccm</param>
|
|
||||||
</packages>
|
|
||||||
<useEnvers>true</useEnvers>
|
|
||||||
</configuration>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<goals>
|
|
||||||
<goal>gen-ddl</goal>
|
|
||||||
</goals>
|
|
||||||
<phase>process-classes</phase>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<forkMode>always</forkMode>
|
|
||||||
<forkCount>999</forkCount>
|
|
||||||
<reuseForks>true</reuseForks>
|
|
||||||
<trimStackTrace>false</trimStackTrace>
|
|
||||||
<systemPropertyVariables>
|
|
||||||
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
|
|
||||||
<!--<jboss.home>${project.basedir}/target/wildfly-8.2.0.Final</jboss.home>
|
|
||||||
<module.path>${project.basedir}/target/wildfly-8.2.0.Final/modules</module.path>-->
|
|
||||||
</systemPropertyVariables>
|
|
||||||
<redirectTestOutputToFile>false</redirectTestOutputToFile>
|
|
||||||
<groups>
|
|
||||||
org.libreccm.tests.categories.UnitTest,
|
|
||||||
org.libreccm.tests.categories.IntegrationTest
|
|
||||||
</groups>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
</profile>
|
|
||||||
|
|
||||||
<profile>
|
|
||||||
<id>wildfly-managed-pgsql</id>
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.wildfly.arquillian</groupId>
|
|
||||||
<artifactId>wildfly-arquillian-container-managed</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.jacoco</groupId>
|
|
||||||
<artifactId>org.jacoco.core</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.jboss.arquillian.extension</groupId>
|
|
||||||
<artifactId>arquillian-jacoco</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>net.sf.saxon</groupId>
|
|
||||||
<artifactId>Saxon-HE</artifactId>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
<build>
|
|
||||||
<testResources>
|
|
||||||
<testResource>
|
|
||||||
<directory>src/test/resources</directory>
|
|
||||||
</testResource>
|
|
||||||
<testResource>
|
|
||||||
<directory>src/test/resources-wildfly-remote-pgsql</directory>
|
|
||||||
</testResource>
|
|
||||||
<testResource>
|
|
||||||
<directory>${project.build.directory}/generated-resources</directory>
|
|
||||||
</testResource>
|
|
||||||
</testResources>
|
|
||||||
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>de.jpdigital</groupId>
|
|
||||||
<artifactId>hibernate53-ddl-maven-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<dialects>
|
|
||||||
<param>h2</param>
|
|
||||||
<param>postgresql9</param>
|
|
||||||
</dialects>
|
|
||||||
<packages>
|
|
||||||
<param>org.libreccm</param>
|
|
||||||
</packages>
|
|
||||||
<useEnvers>true</useEnvers>
|
|
||||||
</configuration>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<goals>
|
|
||||||
<goal>gen-ddl</goal>
|
|
||||||
</goals>
|
|
||||||
<phase>process-classes</phase>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<trimStackTrace>false</trimStackTrace>
|
|
||||||
<forkMode>always</forkMode>
|
|
||||||
<forkCount>999</forkCount>
|
|
||||||
<reuseForks>true</reuseForks>
|
|
||||||
<systemPropertyVariables>
|
|
||||||
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
|
|
||||||
<!--<jboss.home>${project.basedir}/target/wildfly-8.2.0.Final</jboss.home>
|
|
||||||
<module.path>${project.basedir}/target/wildfly-8.2.0.Final/modules</module.path>-->
|
|
||||||
</systemPropertyVariables>
|
|
||||||
<redirectTestOutputToFile>false</redirectTestOutputToFile>
|
|
||||||
<groups>
|
|
||||||
org.libreccm.tests.categories.UnitTest,
|
|
||||||
org.libreccm.tests.categories.IntegrationTest
|
|
||||||
</groups>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
</profile>
|
|
||||||
|
|
||||||
<profile>
|
|
||||||
<id>wildfly-remote-h2-mem</id>
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wildfly.arquillian</groupId>
|
<groupId>org.wildfly.arquillian</groupId>
|
||||||
<artifactId>wildfly-arquillian-container-remote</artifactId>
|
<artifactId>wildfly-arquillian-container-remote</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.jacoco</groupId>
|
|
||||||
<artifactId>org.jacoco.core</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.jboss.arquillian.extension</groupId>
|
|
||||||
<artifactId>arquillian-jacoco</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.sf.saxon</groupId>
|
<groupId>net.sf.saxon</groupId>
|
||||||
<artifactId>Saxon-HE</artifactId>
|
<artifactId>Saxon-HE</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
@ -554,11 +373,12 @@
|
||||||
<directory>src/test/resources</directory>
|
<directory>src/test/resources</directory>
|
||||||
</testResource>
|
</testResource>
|
||||||
<testResource>
|
<testResource>
|
||||||
<directory>src/test/resources-wildfly-remote-h2-mem</directory>
|
<directory>src/test/resources-wildfly-h2mem</directory>
|
||||||
</testResource>
|
</testResource>
|
||||||
<testResource>
|
<testResource>
|
||||||
<directory>${project.build.directory}/generated-resources</directory>
|
<directory>${project.build.directory}/generated-resources</directory>
|
||||||
</testResource>
|
</testResource>
|
||||||
|
|
||||||
</testResources>
|
</testResources>
|
||||||
|
|
||||||
<plugins>
|
<plugins>
|
||||||
|
|
@ -586,49 +406,114 @@
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
<artifactId>maven-failsafe-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>integration-test</goal>
|
||||||
|
<goal>verify</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
<configuration>
|
<configuration>
|
||||||
<forkMode>always</forkMode>
|
<forkMode>always</forkMode>
|
||||||
<forkCount>999</forkCount>
|
<forkCount>999</forkCount>
|
||||||
<reuseForks>true</reuseForks>
|
<reuseForks>true</reuseForks>
|
||||||
<trimStackTrace>false</trimStackTrace>
|
|
||||||
<systemPropertyVariables>
|
<systemPropertyVariables>
|
||||||
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
|
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
|
||||||
<!--<jboss.home>${project.basedir}/target/wildfly-8.2.0.Final</jboss.home>
|
|
||||||
<module.path>${project.basedir}/target/wildfly-8.2.0.Final/modules</module.path>-->
|
|
||||||
</systemPropertyVariables>
|
</systemPropertyVariables>
|
||||||
<redirectTestOutputToFile>false</redirectTestOutputToFile>
|
<redirectTestOutputToFile>false</redirectTestOutputToFile>
|
||||||
<groups>
|
<trimStackTrace>false</trimStackTrace>
|
||||||
org.libreccm.tests.categories.UnitTest,
|
|
||||||
org.libreccm.tests.categories.IntegrationTest
|
|
||||||
</groups>
|
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.wildfly.plugins</groupId>
|
||||||
|
<artifactId>wildfly-maven-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<skip>false</skip>
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>start-test-env</id>
|
||||||
|
<goals>
|
||||||
|
<goal>start</goal>
|
||||||
|
</goals>
|
||||||
|
<phase>pre-integration-test</phase>
|
||||||
|
<configuration>
|
||||||
|
<stdout>System.out</stdout>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>prepare-test-env</id>
|
||||||
|
<goals>
|
||||||
|
<goal>add-resource</goal>
|
||||||
|
</goals>
|
||||||
|
<phase>pre-integration-test</phase>
|
||||||
|
<configuration>
|
||||||
|
<address>subsystem=datasources,data-source=ccm-cms-testdb-h2-mem</address>
|
||||||
|
<force>true</force>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<properties>
|
||||||
|
<connection-url>jdbc:h2:mem:ccm-core-testdb</connection-url>
|
||||||
|
<jndi-name>java:/comp/env/jdbc/org/librecms/ccm-cms/h2-mem</jndi-name>
|
||||||
|
<enabled>true</enabled>
|
||||||
|
<user-name>sa</user-name>
|
||||||
|
<password>sa</password>
|
||||||
|
<use-ccm>false</use-ccm>
|
||||||
|
<driver-name>h2</driver-name>
|
||||||
|
</properties>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>shutdown-test-env</id>
|
||||||
|
<goals>
|
||||||
|
<goal>shutdown</goal>
|
||||||
|
</goals>
|
||||||
|
<phase>post-integration-test</phase>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
|
<reporting>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-surefire-report-plugin</artifactId>
|
||||||
|
<reportSets>
|
||||||
|
<reportSet>
|
||||||
|
<id>integration-tests</id>
|
||||||
|
<reports>
|
||||||
|
<report>failsafe-report-only</report>
|
||||||
|
</reports>
|
||||||
|
</reportSet>
|
||||||
|
</reportSets>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</reporting>
|
||||||
</profile>
|
</profile>
|
||||||
|
|
||||||
<profile>
|
<profile>
|
||||||
<id>wildfly-remote-pgsql</id>
|
<id>run-its-with-wildfly-pgsql</id>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wildfly.arquillian</groupId>
|
<groupId>org.wildfly.arquillian</groupId>
|
||||||
<artifactId>wildfly-arquillian-container-remote</artifactId>
|
<artifactId>wildfly-arquillian-container-remote</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.jacoco</groupId>
|
|
||||||
<artifactId>org.jacoco.core</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.jboss.arquillian.extension</groupId>
|
|
||||||
<artifactId>arquillian-jacoco</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.sf.saxon</groupId>
|
<groupId>net.sf.saxon</groupId>
|
||||||
<artifactId>Saxon-HE</artifactId>
|
<artifactId>Saxon-HE</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.postgresql</groupId>
|
||||||
|
<artifactId>postgresql</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
@ -637,7 +522,7 @@
|
||||||
<directory>src/test/resources</directory>
|
<directory>src/test/resources</directory>
|
||||||
</testResource>
|
</testResource>
|
||||||
<testResource>
|
<testResource>
|
||||||
<directory>src/test/resources-wildfly-remote-pgsql</directory>
|
<directory>src/test/resources-wildfly-pgsql</directory>
|
||||||
</testResource>
|
</testResource>
|
||||||
<testResource>
|
<testResource>
|
||||||
<directory>${project.build.directory}/generated-resources</directory>
|
<directory>${project.build.directory}/generated-resources</directory>
|
||||||
|
|
@ -669,7 +554,282 @@
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
<artifactId>maven-failsafe-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>integration-test</goal>
|
||||||
|
<goal>verify</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
<configuration>
|
||||||
|
<forkMode>always</forkMode>
|
||||||
|
<forkCount>999</forkCount>
|
||||||
|
<reuseForks>true</reuseForks>
|
||||||
|
<systemPropertyVariables>
|
||||||
|
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
|
||||||
|
</systemPropertyVariables>
|
||||||
|
<redirectTestOutputToFile>false</redirectTestOutputToFile>
|
||||||
|
<trimStackTrace>false</trimStackTrace>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
|
<artifactId>properties-maven-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>read-datasource-properties</id>
|
||||||
|
<phase>initialize</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>read-project-properties</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<files>
|
||||||
|
<file>${project.basedir}/../it-pgsql-datasources.properties</file>
|
||||||
|
</files>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.wildfly.plugins</groupId>
|
||||||
|
<artifactId>wildfly-maven-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<skip>false</skip>
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>start-test-env</id>
|
||||||
|
<goals>
|
||||||
|
<goal>start</goal>
|
||||||
|
</goals>
|
||||||
|
<phase>pre-integration-test</phase>
|
||||||
|
<configuration>
|
||||||
|
<stdout>System.out</stdout>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>prepare-deploy-jdbc-driver</id>
|
||||||
|
<configuration>
|
||||||
|
<groupId>org.postgresql</groupId>
|
||||||
|
<artifactId>postgresql</artifactId>
|
||||||
|
<name>postgresql.jar</name>
|
||||||
|
<force>true</force>
|
||||||
|
</configuration>
|
||||||
|
<phase>pre-integration-test</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>deploy-artifact</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>prepare-test-env</id>
|
||||||
|
<goals>
|
||||||
|
<goal>add-resource</goal>
|
||||||
|
</goals>
|
||||||
|
<phase>pre-integration-test</phase>
|
||||||
|
<configuration>
|
||||||
|
<address>subsystem=datasources,data-source=ccm-cms-testdb-pgsql</address>
|
||||||
|
<force>true</force>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<properties>
|
||||||
|
<connection-url>${it.ccm-cms.datasource.connectionUrl}</connection-url>
|
||||||
|
<jndi-name>java:/comp/env/jdbc/org/librecms/ccm-cms/pgsql</jndi-name>
|
||||||
|
<enabled>true</enabled>
|
||||||
|
<user-name>${it.ccm-cms.datasource.username}</user-name>
|
||||||
|
<password>${it.ccm-cms.datasource.password}</password>
|
||||||
|
<use-ccm>false</use-ccm>
|
||||||
|
<driver-name>postgresql.jar</driver-name>
|
||||||
|
</properties>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>shutdown-test-env</id>
|
||||||
|
<goals>
|
||||||
|
<goal>shutdown</goal>
|
||||||
|
</goals>
|
||||||
|
<phase>post-integration-test</phase>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
<reporting>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-surefire-report-plugin</artifactId>
|
||||||
|
<reportSets>
|
||||||
|
<reportSet>
|
||||||
|
<id>integration-tests</id>
|
||||||
|
<reports>
|
||||||
|
<report>failsafe-report-only</report>
|
||||||
|
</reports>
|
||||||
|
</reportSet>
|
||||||
|
</reportSets>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</reporting>
|
||||||
|
</profile>
|
||||||
|
|
||||||
|
<profile>
|
||||||
|
<id>run-its-in-remote-wildfly-h2mem</id>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.wildfly.arquillian</groupId>
|
||||||
|
<artifactId>wildfly-arquillian-container-remote</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.sf.saxon</groupId>
|
||||||
|
<artifactId>Saxon-HE</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<testResources>
|
||||||
|
<testResource>
|
||||||
|
<directory>src/test/resources</directory>
|
||||||
|
</testResource>
|
||||||
|
<testResource>
|
||||||
|
<directory>src/test/resources-wildfly-h2mem</directory>
|
||||||
|
</testResource>
|
||||||
|
<testResource>
|
||||||
|
<directory>${project.build.directory}/generated-resources</directory>
|
||||||
|
</testResource>
|
||||||
|
</testResources>
|
||||||
|
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>de.jpdigital</groupId>
|
||||||
|
<artifactId>hibernate53-ddl-maven-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<dialects>
|
||||||
|
<param>h2</param>
|
||||||
|
<param>postgresql9</param>
|
||||||
|
</dialects>
|
||||||
|
<packages>
|
||||||
|
<param>org.libreccm</param>
|
||||||
|
</packages>
|
||||||
|
<useEnvers>true</useEnvers>
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>gen-ddl</goal>
|
||||||
|
</goals>
|
||||||
|
<phase>process-classes</phase>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-failsafe-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>integration-test</goal>
|
||||||
|
<goal>verify</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
<configuration>
|
||||||
|
<forkMode>always</forkMode>
|
||||||
|
<forkCount>999</forkCount>
|
||||||
|
<reuseForks>true</reuseForks>
|
||||||
|
<trimStackTrace>false</trimStackTrace>
|
||||||
|
<systemPropertyVariables>
|
||||||
|
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
|
||||||
|
</systemPropertyVariables>
|
||||||
|
<redirectTestOutputToFile>false</redirectTestOutputToFile>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
<reporting>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-surefire-report-plugin</artifactId>
|
||||||
|
<reportSets>
|
||||||
|
<reportSet>
|
||||||
|
<id>integration-tests</id>
|
||||||
|
<reports>
|
||||||
|
<report>failsafe-report-only</report>
|
||||||
|
</reports>
|
||||||
|
</reportSet>
|
||||||
|
</reportSets>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</reporting>
|
||||||
|
</profile>
|
||||||
|
|
||||||
|
<profile>
|
||||||
|
<id>run-its-in-remote-wildfly-pgsql</id>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.wildfly.arquillian</groupId>
|
||||||
|
<artifactId>wildfly-arquillian-container-remote</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.sf.saxon</groupId>
|
||||||
|
<artifactId>Saxon-HE</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<testResources>
|
||||||
|
<testResource>
|
||||||
|
<directory>src/test/resources</directory>
|
||||||
|
</testResource>
|
||||||
|
<testResource>
|
||||||
|
<directory>src/test/resources-wildfly-pgsql</directory>
|
||||||
|
</testResource>
|
||||||
|
<testResource>
|
||||||
|
<directory>${project.build.directory}/generated-resources</directory>
|
||||||
|
</testResource>
|
||||||
|
</testResources>
|
||||||
|
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>de.jpdigital</groupId>
|
||||||
|
<artifactId>hibernate53-ddl-maven-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<dialects>
|
||||||
|
<param>h2</param>
|
||||||
|
<param>postgresql9</param>
|
||||||
|
</dialects>
|
||||||
|
<packages>
|
||||||
|
<param>org.libreccm</param>
|
||||||
|
</packages>
|
||||||
|
<useEnvers>true</useEnvers>
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>gen-ddl</goal>
|
||||||
|
</goals>
|
||||||
|
<phase>process-classes</phase>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-failsafe-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>integration-test</goal>
|
||||||
|
<goal>verify</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
<configuration>
|
<configuration>
|
||||||
<trimStackTrace>false</trimStackTrace>
|
<trimStackTrace>false</trimStackTrace>
|
||||||
<forkMode>always</forkMode>
|
<forkMode>always</forkMode>
|
||||||
|
|
@ -677,18 +837,29 @@
|
||||||
<reuseForks>true</reuseForks>
|
<reuseForks>true</reuseForks>
|
||||||
<systemPropertyVariables>
|
<systemPropertyVariables>
|
||||||
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
|
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
|
||||||
<!--<jboss.home>${project.basedir}/target/wildfly-8.2.0.Final</jboss.home>
|
|
||||||
<module.path>${project.basedir}/target/wildfly-8.2.0.Final/modules</module.path>-->
|
|
||||||
</systemPropertyVariables>
|
</systemPropertyVariables>
|
||||||
<redirectTestOutputToFile>false</redirectTestOutputToFile>
|
<redirectTestOutputToFile>false</redirectTestOutputToFile>
|
||||||
<groups>
|
|
||||||
org.libreccm.tests.categories.UnitTest,
|
|
||||||
org.libreccm.tests.categories.IntegrationTest
|
|
||||||
</groups>
|
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
|
<reporting>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-surefire-report-plugin</artifactId>
|
||||||
|
<reportSets>
|
||||||
|
<reportSet>
|
||||||
|
<id>integration-tests</id>
|
||||||
|
<reports>
|
||||||
|
<report>failsafe-report-only</report>
|
||||||
|
</reports>
|
||||||
|
</reportSet>
|
||||||
|
</reportSets>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</reporting>
|
||||||
</profile>
|
</profile>
|
||||||
|
|
||||||
</profiles>
|
</profiles>
|
||||||
|
|
|
||||||
|
|
@ -129,15 +129,15 @@ public class MultiPartArticleEditForm extends MultiPartArticleForm
|
||||||
.selectedLocale(state, selectedLanguageParam);
|
.selectedLocale(state, selectedLanguageParam);
|
||||||
|
|
||||||
final String newName = (String) data.get(MultiPartArticleForm.NAME);
|
final String newName = (String) data.get(MultiPartArticleForm.NAME);
|
||||||
final String oldName = article.getName().getValue(selectedLocale);
|
final MultiPartArticleFormController controller = CdiUtil
|
||||||
|
.createCdiUtil()
|
||||||
|
.findBean(MultiPartArticleFormController.class);
|
||||||
|
final String oldName = controller.getName(article, selectedLocale);
|
||||||
|
|
||||||
final boolean valid;
|
final boolean valid;
|
||||||
if (newName.equalsIgnoreCase(oldName)) {
|
if (newName.equalsIgnoreCase(oldName)) {
|
||||||
valid = true;
|
valid = true;
|
||||||
} else {
|
} else {
|
||||||
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
|
|
||||||
final MultiPartArticleFormController controller = cdiUtil
|
|
||||||
.findBean(MultiPartArticleFormController.class);
|
|
||||||
final Optional<Folder> folder = controller.getArticleFolder(article);
|
final Optional<Folder> folder = controller.getArticleFolder(article);
|
||||||
if (folder.isPresent()) {
|
if (folder.isPresent()) {
|
||||||
valid = validateNameUniqueness(folder.get(), event);
|
valid = validateNameUniqueness(folder.get(), event);
|
||||||
|
|
|
||||||
|
|
@ -233,14 +233,17 @@ public abstract class MultiPartArticleForm
|
||||||
|
|
||||||
final Locale selectedLocale = SelectedLanguageUtil
|
final Locale selectedLocale = SelectedLanguageUtil
|
||||||
.selectedLocale(state, selectedLanguageParam);
|
.selectedLocale(state, selectedLanguageParam);
|
||||||
|
final MultiPartArticleFormController controller = CdiUtil
|
||||||
|
.createCdiUtil()
|
||||||
|
.findBean(MultiPartArticleFormController.class);
|
||||||
|
|
||||||
if (article != null) {
|
if (article != null) {
|
||||||
data.put(NAME, article.getName().getValue(selectedLocale));
|
data.put(NAME, controller.getName(article, selectedLocale));
|
||||||
data.put(TITLE, article.getTitle().getValue(selectedLocale));
|
data.put(TITLE, controller.getTitle(article, selectedLocale));
|
||||||
if (!CMSConfig.getConfig().isHideLaunchDate()) {
|
if (!CMSConfig.getConfig().isHideLaunchDate()) {
|
||||||
data.put(LAUNCH_DATE, article.getLaunchDate());
|
data.put(LAUNCH_DATE, article.getLaunchDate());
|
||||||
}
|
}
|
||||||
data.put(SUMMARY, article.getSummary().getValue(selectedLocale));
|
data.put(SUMMARY, controller.getSummary(article, selectedLocale));
|
||||||
}
|
}
|
||||||
|
|
||||||
return article;
|
return article;
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,8 @@ import org.librecms.contentsection.ContentItemRepository;
|
||||||
import org.librecms.contentsection.Folder;
|
import org.librecms.contentsection.Folder;
|
||||||
import org.librecms.contenttypes.MultiPartArticle;
|
import org.librecms.contenttypes.MultiPartArticle;
|
||||||
|
|
||||||
|
import java.util.Locale;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
import javax.enterprise.context.RequestScoped;
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
|
@ -46,8 +48,9 @@ public class MultiPartArticleFormController {
|
||||||
@Transactional(Transactional.TxType.REQUIRED)
|
@Transactional(Transactional.TxType.REQUIRED)
|
||||||
protected Optional<Folder> getArticleFolder(final MultiPartArticle article) {
|
protected Optional<Folder> getArticleFolder(final MultiPartArticle article) {
|
||||||
|
|
||||||
final Optional<ContentItem> mpa = itemRepo
|
final Optional<ContentItem> mpa = itemRepo.findById(
|
||||||
.findById(article.getObjectId());
|
article.getObjectId()
|
||||||
|
);
|
||||||
|
|
||||||
if (mpa.isPresent()) {
|
if (mpa.isPresent()) {
|
||||||
return itemManager.getItemFolder(mpa.get());
|
return itemManager.getItemFolder(mpa.get());
|
||||||
|
|
@ -56,4 +59,62 @@ public class MultiPartArticleFormController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Transactional(Transactional.TxType.REQUIRED)
|
||||||
|
public String getName(
|
||||||
|
final MultiPartArticle fromMpa, final Locale forLocale
|
||||||
|
) {
|
||||||
|
Objects.requireNonNull(fromMpa);
|
||||||
|
Objects.requireNonNull(forLocale);
|
||||||
|
final MultiPartArticle mpa = itemRepo
|
||||||
|
.findById(fromMpa.getObjectId(), MultiPartArticle.class)
|
||||||
|
.orElseThrow(
|
||||||
|
() -> new IllegalArgumentException(
|
||||||
|
String.format(
|
||||||
|
"No MultiPartArticle with ID %d available",
|
||||||
|
fromMpa.getObjectId()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
return mpa.getName().getValue(forLocale);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(Transactional.TxType.REQUIRED)
|
||||||
|
public String getTitle(
|
||||||
|
final MultiPartArticle fromMpa, final Locale forLocale
|
||||||
|
) {
|
||||||
|
Objects.requireNonNull(fromMpa);
|
||||||
|
Objects.requireNonNull(forLocale);
|
||||||
|
final MultiPartArticle mpa = itemRepo
|
||||||
|
.findById(fromMpa.getObjectId(), MultiPartArticle.class)
|
||||||
|
.orElseThrow(
|
||||||
|
() -> new IllegalArgumentException(
|
||||||
|
String.format(
|
||||||
|
"No MultiPartArticle with ID %d available",
|
||||||
|
fromMpa.getObjectId()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return mpa.getTitle().getValue(forLocale);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(Transactional.TxType.REQUIRED)
|
||||||
|
public String getSummary(
|
||||||
|
final MultiPartArticle fromMpa, final Locale forLocale
|
||||||
|
) {
|
||||||
|
Objects.requireNonNull(fromMpa);
|
||||||
|
Objects.requireNonNull(forLocale);
|
||||||
|
final MultiPartArticle mpa = itemRepo
|
||||||
|
.findById(fromMpa.getObjectId(), MultiPartArticle.class)
|
||||||
|
.orElseThrow(
|
||||||
|
() -> new IllegalArgumentException(
|
||||||
|
String.format(
|
||||||
|
"No MultiPartArticle with ID %d available",
|
||||||
|
fromMpa.getObjectId()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
return mpa.getSummary().getValue(forLocale);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,8 @@ import org.librecms.contenttypes.MultiPartArticleSectionManager;
|
||||||
import org.librecms.contenttypes.MultiPartArticleSectionRepository;
|
import org.librecms.contenttypes.MultiPartArticleSectionRepository;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import javax.enterprise.context.RequestScoped;
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
|
@ -138,4 +140,70 @@ class MultiPartArticleSectionStepController {
|
||||||
sectionManager.moveSectionAfter(theArticle, section, after);
|
sectionManager.moveSectionAfter(theArticle, section, after);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Transactional(Transactional.TxType.REQUIRED)
|
||||||
|
public String getSectionTitle(
|
||||||
|
final MultiPartArticleSection ofSection, final Locale forLocale
|
||||||
|
) {
|
||||||
|
Objects.requireNonNull(ofSection);
|
||||||
|
Objects.requireNonNull(forLocale);
|
||||||
|
|
||||||
|
final MultiPartArticleSection section = sectionRepo
|
||||||
|
.findById(ofSection.getSectionId())
|
||||||
|
.orElseThrow(
|
||||||
|
() -> new IllegalArgumentException(
|
||||||
|
String.format(
|
||||||
|
"No section with ID %d available.", ofSection
|
||||||
|
.getSectionId()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
return section.getTitle().getValue(forLocale);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(Transactional.TxType.REQUIRED)
|
||||||
|
public String getSectionText(
|
||||||
|
final MultiPartArticleSection ofSection, final Locale forLocale
|
||||||
|
) {
|
||||||
|
Objects.requireNonNull(ofSection);
|
||||||
|
Objects.requireNonNull(forLocale);
|
||||||
|
|
||||||
|
final MultiPartArticleSection section = sectionRepo
|
||||||
|
.findById(ofSection.getSectionId())
|
||||||
|
.orElseThrow(
|
||||||
|
() -> new IllegalArgumentException(
|
||||||
|
String.format(
|
||||||
|
"No section with ID %d available.", ofSection
|
||||||
|
.getSectionId()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
return section.getText().getValue(forLocale);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(Transactional.TxType.REQUIRED)
|
||||||
|
public void updateSection(
|
||||||
|
final MultiPartArticleSection section,
|
||||||
|
final String title,
|
||||||
|
final String text,
|
||||||
|
final boolean pageBreak,
|
||||||
|
final Locale locale
|
||||||
|
) {
|
||||||
|
Objects.requireNonNull(section);
|
||||||
|
Objects.requireNonNull(locale);
|
||||||
|
|
||||||
|
final MultiPartArticleSection update = sectionRepo
|
||||||
|
.findById(section.getSectionId())
|
||||||
|
.orElseThrow(
|
||||||
|
() -> new IllegalArgumentException(
|
||||||
|
String.format(
|
||||||
|
"No section with ID %d available.",
|
||||||
|
section.getSectionId()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
update.getTitle().addValue(locale, title);
|
||||||
|
update.getText().addValue(locale, title);
|
||||||
|
update.setPageBreak(pageBreak);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -158,11 +158,16 @@ public class MultiPartArticleSectionsStep extends ResettableContainer {
|
||||||
final Locale selectedLocale = SelectedLanguageUtil
|
final Locale selectedLocale = SelectedLanguageUtil
|
||||||
.selectedLocale(state, selectedLanguageParam);
|
.selectedLocale(state, selectedLanguageParam);
|
||||||
|
|
||||||
|
final MultiPartArticleSectionStepController controller = CdiUtil
|
||||||
|
.createCdiUtil()
|
||||||
|
.findBean(MultiPartArticleSectionStepController.class);
|
||||||
|
|
||||||
final Object[] parameterObj = {
|
final Object[] parameterObj = {
|
||||||
|
controller.getSectionTitle(
|
||||||
moveSectionModel
|
moveSectionModel
|
||||||
.getSelectedSection(state)
|
.getSelectedSection(state),
|
||||||
.getTitle()
|
selectedLocale
|
||||||
.getValue(selectedLocale)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
target.setLabel(new GlobalizedMessage(
|
target.setLabel(new GlobalizedMessage(
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,6 @@ import com.arsdigita.globalization.GlobalizedMessage;
|
||||||
|
|
||||||
import org.librecms.contenttypes.MultiPartArticle;
|
import org.librecms.contenttypes.MultiPartArticle;
|
||||||
|
|
||||||
|
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
import org.libreccm.cdi.utils.CdiUtil;
|
import org.libreccm.cdi.utils.CdiUtil;
|
||||||
|
|
@ -110,9 +109,14 @@ public class SectionDeleteForm extends Form
|
||||||
final Locale selectedLocale = SelectedLanguageUtil
|
final Locale selectedLocale = SelectedLanguageUtil
|
||||||
.selectedLocale(state, selectedLanguageParam);
|
.selectedLocale(state, selectedLanguageParam);
|
||||||
|
|
||||||
|
final MultiPartArticleSectionStepController controller = CdiUtil
|
||||||
|
.createCdiUtil()
|
||||||
|
.findBean(MultiPartArticleSectionStepController.class);
|
||||||
|
|
||||||
sectionNameLabel.setLabel(
|
sectionNameLabel.setLabel(
|
||||||
section.getTitle().getValue(selectedLocale),
|
controller.getSectionTitle(section, selectedLocale),
|
||||||
state);
|
state
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -198,12 +198,19 @@ public class SectionEditForm extends Form {
|
||||||
|
|
||||||
final Locale selectedLocale = SelectedLanguageUtil
|
final Locale selectedLocale = SelectedLanguageUtil
|
||||||
.selectedLocale(state, selectedLanguageParam);
|
.selectedLocale(state, selectedLanguageParam);
|
||||||
|
final MultiPartArticleSectionStepController controller = CdiUtil
|
||||||
|
.createCdiUtil()
|
||||||
|
.findBean(MultiPartArticleSectionStepController.class);
|
||||||
|
|
||||||
final MultiPartArticleSection section = selectedSectionModel
|
final MultiPartArticleSection section = selectedSectionModel
|
||||||
.getSelectedSection(state);
|
.getSelectedSection(state);
|
||||||
|
|
||||||
data.put(TITLE, section.getTitle().getValue(selectedLocale));
|
data.put(
|
||||||
data.put(TEXT, section.getText().getValue(selectedLocale));
|
TITLE, controller.getSectionTitle(section, selectedLocale)
|
||||||
|
);
|
||||||
|
data.put(
|
||||||
|
TEXT, controller.getSectionText(section, selectedLocale)
|
||||||
|
);
|
||||||
|
|
||||||
if (section.isPageBreak()) {
|
if (section.isPageBreak()) {
|
||||||
data.put(PAGE_BREAK, new Object[]{"true"});
|
data.put(PAGE_BREAK, new Object[]{"true"});
|
||||||
|
|
@ -281,9 +288,8 @@ public class SectionEditForm extends Form {
|
||||||
section = selectedSectionModel.getSelectedSection(state);
|
section = selectedSectionModel.getSelectedSection(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
section.getTitle().addValue(selectedLocale,
|
// section.getTitle().addValue(selectedLocale,
|
||||||
(String) data.get(TITLE));
|
// (String) data.get(TITLE));
|
||||||
|
|
||||||
final Object[] pageBreakVal = (Object[]) data.get(PAGE_BREAK);
|
final Object[] pageBreakVal = (Object[]) data.get(PAGE_BREAK);
|
||||||
final boolean pageBreak;
|
final boolean pageBreak;
|
||||||
if (pageBreakVal == null
|
if (pageBreakVal == null
|
||||||
|
|
@ -293,7 +299,7 @@ public class SectionEditForm extends Form {
|
||||||
} else {
|
} else {
|
||||||
pageBreak = true;
|
pageBreak = true;
|
||||||
}
|
}
|
||||||
section.setPageBreak(pageBreak);
|
// section.setPageBreak(pageBreak);
|
||||||
|
|
||||||
final String text;
|
final String text;
|
||||||
if (data.get(TEXT) == null) {
|
if (data.get(TEXT) == null) {
|
||||||
|
|
@ -301,12 +307,24 @@ public class SectionEditForm extends Form {
|
||||||
} else {
|
} else {
|
||||||
text = (String) data.get(TEXT);
|
text = (String) data.get(TEXT);
|
||||||
}
|
}
|
||||||
section.getText().addValue(selectedLocale, text);
|
// section.getText().addValue(selectedLocale, text);
|
||||||
|
|
||||||
sectionRepo.save(section);
|
|
||||||
|
|
||||||
|
// sectionRepo.save(section);
|
||||||
if (selectedSectionModel.getSelectedKey(state) == null) {
|
if (selectedSectionModel.getSelectedKey(state) == null) {
|
||||||
|
section.getTitle().addValue(selectedLocale,
|
||||||
|
(String) data.get(TITLE));
|
||||||
|
section.setPageBreak(pageBreak);
|
||||||
|
section.getText().addValue(selectedLocale, text);
|
||||||
|
|
||||||
controller.addSection(article, section);
|
controller.addSection(article, section);
|
||||||
|
} else {
|
||||||
|
controller.updateSection(
|
||||||
|
section,
|
||||||
|
(String) data.get(TITLE),
|
||||||
|
text,
|
||||||
|
pageBreak,
|
||||||
|
selectedLocale
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sectionsStep != null) {
|
if (sectionsStep != null) {
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ import org.librecms.contenttypes.MultiPartArticleSection;
|
||||||
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
class SectionTableModel implements TableModel {
|
class SectionTableModel implements TableModel {
|
||||||
|
|
||||||
|
|
@ -110,12 +111,19 @@ class SectionTableModel implements TableModel {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final MultiPartArticleSectionStepController controller = CdiUtil
|
||||||
|
.createCdiUtil()
|
||||||
|
.findBean(MultiPartArticleSectionStepController.class);
|
||||||
|
|
||||||
switch (columnIndex) {
|
switch (columnIndex) {
|
||||||
case SectionTable.COL_INDEX_TITLE:
|
case SectionTable.COL_INDEX_TITLE:
|
||||||
return currentSection
|
return controller.getSectionTitle(
|
||||||
.getTitle()
|
currentSection,
|
||||||
.getValue(SelectedLanguageUtil
|
SelectedLanguageUtil.selectedLocale(
|
||||||
.selectedLocale(pageState, selectedLanguageParam));
|
pageState, selectedLanguageParam
|
||||||
|
)
|
||||||
|
)
|
||||||
|
;
|
||||||
case SectionTable.COL_PAGE_BREAK:
|
case SectionTable.COL_PAGE_BREAK:
|
||||||
if (currentSection.isPageBreak()) {
|
if (currentSection.isPageBreak()) {
|
||||||
return new Label(
|
return new Label(
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.cms.ui.type;
|
package com.arsdigita.cms.ui.type;
|
||||||
|
|
||||||
import com.ibm.icu.impl.IllegalIcuArgumentException;
|
|
||||||
import org.libreccm.workflow.Workflow;
|
import org.libreccm.workflow.Workflow;
|
||||||
import org.librecms.contentsection.ContentSection;
|
import org.librecms.contentsection.ContentSection;
|
||||||
import org.librecms.contentsection.ContentSectionManager;
|
import org.librecms.contentsection.ContentSectionManager;
|
||||||
|
|
@ -90,7 +89,7 @@ class ContentTypeAdminPaneController {
|
||||||
ofSection.getObjectId()
|
ofSection.getObjectId()
|
||||||
)
|
)
|
||||||
.orElseThrow(
|
.orElseThrow(
|
||||||
() -> new IllegalIcuArgumentException(
|
() -> new IllegalArgumentException(
|
||||||
String.format(
|
String.format(
|
||||||
"No ContentSection with ID %d found.",
|
"No ContentSection with ID %d found.",
|
||||||
ofSection.getObjectId()
|
ofSection.getObjectId()
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,150 @@
|
||||||
|
package db.migrations.org.librecms.ccm_cms;
|
||||||
|
|
||||||
|
import org.flywaydb.core.api.migration.BaseJavaMigration;
|
||||||
|
import org.flywaydb.core.api.migration.Context;
|
||||||
|
|
||||||
|
import java.sql.Connection;
|
||||||
|
import java.sql.PreparedStatement;
|
||||||
|
import java.sql.ResultSet;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
public class V7_0_0_24__add_lifecycle_uuid extends BaseJavaMigration {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void migrate(final Context context) throws Exception {
|
||||||
|
|
||||||
|
final Connection connection = context.getConnection();
|
||||||
|
|
||||||
|
final List<Long> lifecycleIds = retrieveLifecycleIds(connection);
|
||||||
|
final List<Long> definitionIds = retrieveDefinitionIds(
|
||||||
|
connection
|
||||||
|
);
|
||||||
|
|
||||||
|
addLifecycleUuidCol(connection);
|
||||||
|
addDefinitionLifecycleCol(connection);
|
||||||
|
|
||||||
|
setLifecycleUuid(connection, lifecycleIds);
|
||||||
|
setDefinitionUuid(connection, definitionIds);
|
||||||
|
|
||||||
|
addLifecycleUniqueConstraint(connection);
|
||||||
|
addDefinitionUniqueConstraint(connection);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Long> retrieveLifecycleIds(final Connection connection)
|
||||||
|
throws Exception {
|
||||||
|
final List<Long> result = new ArrayList<>();
|
||||||
|
try (PreparedStatement stmt = connection
|
||||||
|
.prepareStatement("select LIFECYCLE_ID from LIFECYCLES");
|
||||||
|
ResultSet resultSet = stmt.executeQuery()) {
|
||||||
|
|
||||||
|
while (resultSet.next()) {
|
||||||
|
result.add(resultSet.getLong("LIFECYCLE_ID"));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Long> retrieveDefinitionIds(final Connection connection)
|
||||||
|
throws Exception {
|
||||||
|
final List<Long> result = new ArrayList<>();
|
||||||
|
try (PreparedStatement stmt = connection
|
||||||
|
.prepareStatement(
|
||||||
|
"select LIFECYCLE_DEFINITION_ID "
|
||||||
|
+ "from LIFECYLE_DEFINITIONS"
|
||||||
|
);
|
||||||
|
ResultSet resultSet = stmt.executeQuery()) {
|
||||||
|
|
||||||
|
while (resultSet.next()) {
|
||||||
|
result.add(resultSet.getLong("LIFECYCLE_ID"));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addLifecycleUuidCol(final Connection connection)
|
||||||
|
throws Exception {
|
||||||
|
try (PreparedStatement stmt = connection.prepareStatement(
|
||||||
|
"alter table LIFECYCLES add column UUID varchar(255)"
|
||||||
|
)) {
|
||||||
|
stmt.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addDefinitionLifecycleCol(final Connection connection)
|
||||||
|
throws Exception {
|
||||||
|
try (PreparedStatement stmt = connection.prepareStatement(
|
||||||
|
"alter table lifecyle_definitions "
|
||||||
|
+ "add column UUID varchar(255)"
|
||||||
|
)) {
|
||||||
|
stmt.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setLifecycleUuid(
|
||||||
|
final Connection connection, final List<Long> lifecycleIds
|
||||||
|
) throws Exception {
|
||||||
|
try (PreparedStatement stmt = connection.prepareStatement(
|
||||||
|
"update LIFECYCLES set UUID = ? where LIFECYCLE_ID = ?"
|
||||||
|
)) {
|
||||||
|
for (final Long lifecycleId : lifecycleIds) {
|
||||||
|
stmt.setString(1, UUID.randomUUID().toString());
|
||||||
|
stmt.setLong(2, lifecycleId);
|
||||||
|
stmt.executeUpdate();
|
||||||
|
stmt.clearParameters();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setDefinitionUuid(
|
||||||
|
final Connection connection, final List<Long> definitionIds
|
||||||
|
) throws Exception {
|
||||||
|
try (PreparedStatement stmt = connection.prepareStatement(
|
||||||
|
"update LIFECYLE_DEFINITIONS set UUID = ? "
|
||||||
|
+ "where LIFECYCLE_DEFINITION_ID = ?"
|
||||||
|
)) {
|
||||||
|
for (final Long lifecycleId : definitionIds) {
|
||||||
|
stmt.setString(1, UUID.randomUUID().toString());
|
||||||
|
stmt.setLong(2, lifecycleId);
|
||||||
|
stmt.executeUpdate();
|
||||||
|
stmt.clearParameters();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addLifecycleUniqueConstraint(
|
||||||
|
final Connection connection
|
||||||
|
) throws Exception {
|
||||||
|
try (PreparedStatement stmt = connection.prepareStatement(
|
||||||
|
"alter table LIFECYCLES "
|
||||||
|
+ "add constraint UK_40o4njo54m8c4xlwq6ctnsimd "
|
||||||
|
+ "unique (UUID)"
|
||||||
|
)) {
|
||||||
|
stmt.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addDefinitionUniqueConstraint(
|
||||||
|
final Connection connection
|
||||||
|
) throws Exception {
|
||||||
|
try (PreparedStatement stmt = connection.prepareStatement(
|
||||||
|
"alter table LIFECYLE_DEFINITIONS "
|
||||||
|
+ "add constraint UK_n6ki3s5im2k2nccpocuctqqe3 "
|
||||||
|
+ "unique (UUID)"
|
||||||
|
)) {
|
||||||
|
stmt.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
/*
|
||||||
|
* To change this license header, choose License Headers in Project Properties.
|
||||||
|
* To change this template file, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
package db.migrations.org.librecms.ccm_cms.h2;
|
||||||
|
|
||||||
|
import org.flywaydb.core.api.migration.Context;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
public class V7_0_0_24__add_lifecycle_uuid
|
||||||
|
extends db.migrations.org.librecms.ccm_cms.V7_0_0_24__add_lifecycle_uuid {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void migrate(final Context context) throws Exception {
|
||||||
|
super.migrate(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
/*
|
||||||
|
* To change this license header, choose License Headers in Project Properties.
|
||||||
|
* To change this template file, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
package db.migrations.org.librecms.ccm_cms.pgsql;
|
||||||
|
|
||||||
|
import org.flywaydb.core.api.migration.Context;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
public class V7_0_0_24__add_lifecycle_uuid
|
||||||
|
extends db.migrations.org.librecms.ccm_cms.V7_0_0_24__add_lifecycle_uuid {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void migrate(final Context context) throws Exception {
|
||||||
|
super.migrate(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -313,7 +313,7 @@ import static org.librecms.CmsConstants.*;
|
||||||
+ " '" + AssetPrivileges.VIEW + "' "
|
+ " '" + AssetPrivileges.VIEW + "' "
|
||||||
+ " ) "
|
+ " ) "
|
||||||
+ " OR true = :isSystemUser OR true = :isAdmin"
|
+ " OR true = :isSystemUser OR true = :isAdmin"
|
||||||
+ ")")
|
+ ") ORDER BY a.displayName")
|
||||||
,
|
,
|
||||||
@NamedQuery(
|
@NamedQuery(
|
||||||
name = "Asset.countFilterByFolderAndTitle",
|
name = "Asset.countFilterByFolderAndTitle",
|
||||||
|
|
|
||||||
|
|
@ -268,9 +268,11 @@ public class ContentSectionSetup extends AbstractCcmApplicationSetup {
|
||||||
section.addRole(contentReader);
|
section.addRole(contentReader);
|
||||||
|
|
||||||
final LifecycleDefinition lifecycleDefinition = new LifecycleDefinition();
|
final LifecycleDefinition lifecycleDefinition = new LifecycleDefinition();
|
||||||
|
lifecycleDefinition.setUuid(UUID.randomUUID().toString());
|
||||||
lifecycleDefinition.getLabel().addValue(Locale.ENGLISH, "Standard");
|
lifecycleDefinition.getLabel().addValue(Locale.ENGLISH, "Standard");
|
||||||
|
|
||||||
final Workflow workflow = new Workflow();
|
final Workflow workflow = new Workflow();
|
||||||
|
workflow.setUuid(UUID.randomUUID().toString());
|
||||||
workflow.setAbstractWorkflow(true);
|
workflow.setAbstractWorkflow(true);
|
||||||
workflow.getName().addValue(Locale.ENGLISH, "Standard");
|
workflow.getName().addValue(Locale.ENGLISH, "Standard");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,9 @@
|
||||||
*/
|
*/
|
||||||
package org.librecms.lifecycle;
|
package org.librecms.lifecycle;
|
||||||
|
|
||||||
|
import org.hibernate.search.annotations.Field;
|
||||||
|
import org.libreccm.core.Identifiable;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
|
@ -36,6 +39,8 @@ import javax.persistence.OneToOne;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
import javax.persistence.Temporal;
|
import javax.persistence.Temporal;
|
||||||
import javax.persistence.TemporalType;
|
import javax.persistence.TemporalType;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
|
|
||||||
import static org.librecms.CmsConstants.*;
|
import static org.librecms.CmsConstants.*;
|
||||||
|
|
||||||
|
|
@ -45,7 +50,7 @@ import static org.librecms.CmsConstants.*;
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "LIFECYCLES", schema = DB_SCHEMA)
|
@Table(name = "LIFECYCLES", schema = DB_SCHEMA)
|
||||||
public class Lifecycle implements Serializable {
|
public class Lifecycle implements Identifiable, Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 184357562249530038L;
|
private static final long serialVersionUID = 184357562249530038L;
|
||||||
|
|
||||||
|
|
@ -54,6 +59,15 @@ public class Lifecycle implements Serializable {
|
||||||
@Column(name = "LIFECYCLE_ID")
|
@Column(name = "LIFECYCLE_ID")
|
||||||
private long lifecycleId;
|
private long lifecycleId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Column(name = "UUID", unique = true)
|
||||||
|
@NotNull
|
||||||
|
@Field
|
||||||
|
@XmlElement(name = "uuid")
|
||||||
|
private String uuid;
|
||||||
|
|
||||||
@Column(name = "START_DATE_TIME")
|
@Column(name = "START_DATE_TIME")
|
||||||
@Temporal(TemporalType.DATE)
|
@Temporal(TemporalType.DATE)
|
||||||
private Date startDateTime;
|
private Date startDateTime;
|
||||||
|
|
@ -90,6 +104,15 @@ public class Lifecycle implements Serializable {
|
||||||
this.lifecycleId = lifecycleId;
|
this.lifecycleId = lifecycleId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUuid() {
|
||||||
|
return uuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUuid(final String uuid) {
|
||||||
|
this.uuid = uuid;
|
||||||
|
}
|
||||||
|
|
||||||
public Date getStartDateTime() {
|
public Date getStartDateTime() {
|
||||||
return new Date(startDateTime.getTime());
|
return new Date(startDateTime.getTime());
|
||||||
}
|
}
|
||||||
|
|
@ -214,14 +237,14 @@ public class Lifecycle implements Serializable {
|
||||||
|
|
||||||
public String toString(final String data) {
|
public String toString(final String data) {
|
||||||
return String.format("%s{ "
|
return String.format("%s{ "
|
||||||
+ "lifecycleId = %d, "
|
+ "lifecycleId = %d, "
|
||||||
+ "startDateTime = %tF %<tT, "
|
+ "startDateTime = %tF %<tT, "
|
||||||
+ "endDateTime = %tF %<tT, "
|
+ "endDateTime = %tF %<tT, "
|
||||||
+ "listener = \"%s\", "
|
+ "listener = \"%s\", "
|
||||||
+ "started = %b, "
|
+ "started = %b, "
|
||||||
+ "finished = %b, "
|
+ "finished = %b, "
|
||||||
+ "definition = %s%s"
|
+ "definition = %s%s"
|
||||||
+ " }",
|
+ " }",
|
||||||
super.toString(),
|
super.toString(),
|
||||||
lifecycleId,
|
lifecycleId,
|
||||||
startDateTime,
|
startDateTime,
|
||||||
|
|
@ -232,4 +255,5 @@ public class Lifecycle implements Serializable {
|
||||||
Objects.toString(definition),
|
Objects.toString(definition),
|
||||||
data);
|
data);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,8 @@
|
||||||
*/
|
*/
|
||||||
package org.librecms.lifecycle;
|
package org.librecms.lifecycle;
|
||||||
|
|
||||||
|
import org.hibernate.search.annotations.Field;
|
||||||
|
import org.libreccm.core.Identifiable;
|
||||||
import org.libreccm.l10n.LocalizedString;
|
import org.libreccm.l10n.LocalizedString;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
@ -37,6 +39,8 @@ import javax.persistence.JoinColumn;
|
||||||
import javax.persistence.JoinTable;
|
import javax.persistence.JoinTable;
|
||||||
import javax.persistence.OneToMany;
|
import javax.persistence.OneToMany;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
|
|
||||||
import static org.librecms.CmsConstants.*;
|
import static org.librecms.CmsConstants.*;
|
||||||
|
|
||||||
|
|
@ -46,7 +50,7 @@ import static org.librecms.CmsConstants.*;
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "LIFECYLE_DEFINITIONS", schema = DB_SCHEMA)
|
@Table(name = "LIFECYLE_DEFINITIONS", schema = DB_SCHEMA)
|
||||||
public class LifecycleDefinition implements Serializable {
|
public class LifecycleDefinition implements Identifiable, Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1291162870555527717L;
|
private static final long serialVersionUID = 1291162870555527717L;
|
||||||
|
|
||||||
|
|
@ -55,6 +59,12 @@ public class LifecycleDefinition implements Serializable {
|
||||||
@Column(name = "LIFECYCLE_DEFINITION_ID")
|
@Column(name = "LIFECYCLE_DEFINITION_ID")
|
||||||
private long definitionId;
|
private long definitionId;
|
||||||
|
|
||||||
|
@Column(name = "UUID", unique = true)
|
||||||
|
@NotNull
|
||||||
|
@Field
|
||||||
|
@XmlElement(name = "uuid")
|
||||||
|
private String uuid;
|
||||||
|
|
||||||
@Embedded
|
@Embedded
|
||||||
@AssociationOverride(
|
@AssociationOverride(
|
||||||
name = "values",
|
name = "values",
|
||||||
|
|
@ -96,6 +106,15 @@ public class LifecycleDefinition implements Serializable {
|
||||||
this.definitionId = definitionId;
|
this.definitionId = definitionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUuid() {
|
||||||
|
return uuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUuid(final String uuid) {
|
||||||
|
this.uuid = uuid;
|
||||||
|
}
|
||||||
|
|
||||||
public LocalizedString getLabel() {
|
public LocalizedString getLabel() {
|
||||||
return label;
|
return label;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,8 @@ package org.librecms.lifecycle;
|
||||||
|
|
||||||
import org.libreccm.core.AbstractEntityRepository;
|
import org.libreccm.core.AbstractEntityRepository;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
import javax.enterprise.context.RequestScoped;
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -52,4 +54,12 @@ public class LifecycleDefinitionRepository
|
||||||
return lifecycleDefinition.getDefinitionId() == 0;
|
return lifecycleDefinition.getDefinitionId() == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void initNewEntity(final LifecycleDefinition entity) {
|
||||||
|
super.initNewEntity(entity);
|
||||||
|
entity.setUuid(UUID.randomUUID().toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,8 @@ package org.librecms.lifecycle;
|
||||||
|
|
||||||
import org.libreccm.core.AbstractEntityRepository;
|
import org.libreccm.core.AbstractEntityRepository;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
import javax.enterprise.context.RequestScoped;
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -30,6 +32,8 @@ import javax.enterprise.context.RequestScoped;
|
||||||
public class LifecycleRepository
|
public class LifecycleRepository
|
||||||
extends AbstractEntityRepository<Long, Lifecycle> {
|
extends AbstractEntityRepository<Long, Lifecycle> {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class<Lifecycle> getEntityClass() {
|
public Class<Lifecycle> getEntityClass() {
|
||||||
return Lifecycle.class;
|
return Lifecycle.class;
|
||||||
|
|
@ -50,4 +54,10 @@ public class LifecycleRepository
|
||||||
return lifecycle.getLifecycleId() == 0;
|
return lifecycle.getLifecycleId() == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void initNewEntity(final Lifecycle entity) {
|
||||||
|
super.initNewEntity(entity);
|
||||||
|
entity.setUuid(UUID.randomUUID().toString());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,22 +21,18 @@ 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 java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
import javax.persistence.EntityManager;
|
import javax.persistence.EntityManager;
|
||||||
import javax.persistence.PersistenceContext;
|
import javax.persistence.PersistenceContext;
|
||||||
|
|
||||||
|
|
||||||
@Category(IntegrationTest.class)
|
|
||||||
@RunWith(Arquillian.class)
|
@RunWith(Arquillian.class)
|
||||||
@PersistenceTest
|
@PersistenceTest
|
||||||
@Transactional(TransactionMode.COMMIT)
|
@Transactional(TransactionMode.COMMIT)
|
||||||
@CreateSchema({"create_ccm-cms_schema.sql"})
|
@CreateSchema({"create_ccm-cms_schema.sql"})
|
||||||
public class CmsTest {
|
public class CmsIT {
|
||||||
|
|
||||||
@PersistenceContext(name = "LibreCCM")
|
@PersistenceContext(name = "LibreCCM")
|
||||||
private EntityManager entityManager;
|
private EntityManager entityManager;
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
*/
|
*/
|
||||||
package org.librecms.contentsection;
|
package org.librecms.contentsection;
|
||||||
|
|
||||||
import nl.jqno.equalsverifier.EqualsVerifierApi;
|
import nl.jqno.equalsverifier.api.SingleTypeEqualsVerifierApi;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.junit.runners.Parameterized;
|
import org.junit.runners.Parameterized;
|
||||||
import org.libreccm.categorization.Category;
|
import org.libreccm.categorization.Category;
|
||||||
|
|
@ -26,7 +26,6 @@ import org.libreccm.core.CcmObject;
|
||||||
import org.libreccm.security.Group;
|
import org.libreccm.security.Group;
|
||||||
import org.libreccm.security.Role;
|
import org.libreccm.security.Role;
|
||||||
import org.libreccm.security.User;
|
import org.libreccm.security.User;
|
||||||
import org.libreccm.tests.categories.UnitTest;
|
|
||||||
import org.libreccm.testutils.EqualsVerifier;
|
import org.libreccm.testutils.EqualsVerifier;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
@ -40,7 +39,6 @@ import java.util.UUID;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@RunWith(Parameterized.class)
|
@RunWith(Parameterized.class)
|
||||||
@org.junit.experimental.categories.Category(UnitTest.class)
|
|
||||||
public class AssetEqualsAndHashCodeTest extends EqualsVerifier {
|
public class AssetEqualsAndHashCodeTest extends EqualsVerifier {
|
||||||
|
|
||||||
@Parameterized.Parameters(name = "{0}")
|
@Parameterized.Parameters(name = "{0}")
|
||||||
|
|
@ -55,7 +53,7 @@ public class AssetEqualsAndHashCodeTest extends EqualsVerifier {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void addPrefabValues(final EqualsVerifierApi<?> verifier) {
|
protected void addPrefabValues(final SingleTypeEqualsVerifierApi<?> verifier) {
|
||||||
|
|
||||||
final CcmObject object1 = new CcmObject();
|
final CcmObject object1 = new CcmObject();
|
||||||
object1.setDisplayName("Object 1");
|
object1.setDisplayName("Object 1");
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,6 @@ import org.junit.BeforeClass;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.libreccm.security.Shiro;
|
import org.libreccm.security.Shiro;
|
||||||
import org.libreccm.tests.categories.IntegrationTest;
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
|
@ -57,15 +56,18 @@ import org.jboss.arquillian.persistence.CleanupUsingScript;
|
||||||
|
|
||||||
import org.librecms.assets.FileAsset;
|
import org.librecms.assets.FileAsset;
|
||||||
|
|
||||||
import static org.hamcrest.CoreMatchers.*;
|
import static org.hamcrest.CoreMatchers.equalTo;
|
||||||
import static org.junit.Assert.*;
|
import static org.hamcrest.CoreMatchers.is;
|
||||||
|
import static org.hamcrest.CoreMatchers.not;
|
||||||
|
import static org.hamcrest.CoreMatchers.nullValue;
|
||||||
|
import static org.junit.Assert.assertThat;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for the {@link AssetManager}.
|
* Tests for the {@link AssetManager}.
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@org.junit.experimental.categories.Category(IntegrationTest.class)
|
|
||||||
@RunWith(Arquillian.class)
|
@RunWith(Arquillian.class)
|
||||||
@PersistenceTest
|
@PersistenceTest
|
||||||
@Transactional(TransactionMode.COMMIT)
|
@Transactional(TransactionMode.COMMIT)
|
||||||
|
|
@ -81,7 +83,7 @@ import static org.junit.Assert.*;
|
||||||
"999_cleanup.sql"
|
"999_cleanup.sql"
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
public class AssetManagerTest {
|
public class AssetManagerIT {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private AssetRepository assetRepo;
|
private AssetRepository assetRepo;
|
||||||
|
|
@ -95,7 +97,7 @@ public class AssetManagerTest {
|
||||||
@Inject
|
@Inject
|
||||||
private Shiro shiro;
|
private Shiro shiro;
|
||||||
|
|
||||||
public AssetManagerTest() {
|
public AssetManagerIT() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
|
|
@ -119,56 +121,7 @@ public class AssetManagerTest {
|
||||||
return ShrinkWrap
|
return ShrinkWrap
|
||||||
.create(WebArchive.class,
|
.create(WebArchive.class,
|
||||||
"LibreCCM-org.librecms.assets.AssetManagerTest.war")
|
"LibreCCM-org.librecms.assets.AssetManagerTest.war")
|
||||||
.addPackage(org.libreccm.auditing.CcmRevision.class.getPackage())
|
.addPackages(true, "com.arsdigita", "org.libreccm", "org.librecms")
|
||||||
.addPackage(org.libreccm.categorization.Categorization.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.cdi.utils.CdiUtil.class.getPackage())
|
|
||||||
.addPackage(org.libreccm.configuration.Configuration.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.core.CcmCore.class.getPackage())
|
|
||||||
.addPackage(org.libreccm.jpa.EntityManagerProducer.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.jpa.utils.MimeTypeConverter.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.l10n.LocalizedString.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.security.Permission.class.getPackage())
|
|
||||||
.addPackage(org.libreccm.web.CcmApplication.class.getPackage())
|
|
||||||
.addPackage(org.libreccm.workflow.Workflow.class.getPackage())
|
|
||||||
.addPackage(com.arsdigita.bebop.Component.class.getPackage())
|
|
||||||
.addPackage(com.arsdigita.bebop.util.BebopConstants.class
|
|
||||||
.getPackage())
|
|
||||||
.addClass(com.arsdigita.kernel.KernelConfig.class)
|
|
||||||
.addClass(com.arsdigita.runtime.CCMResourceManager.class)
|
|
||||||
.addClass(com.arsdigita.dispatcher.RequestContext.class)
|
|
||||||
.addClass(com.arsdigita.dispatcher.AccessDeniedException.class)
|
|
||||||
.addClass(com.arsdigita.cms.dispatcher.ContentItemDispatcher.class)
|
|
||||||
.addClass(com.arsdigita.dispatcher.Dispatcher.class)
|
|
||||||
.addClass(
|
|
||||||
com.arsdigita.ui.admin.applications.AbstractAppInstanceForm.class)
|
|
||||||
.addClass(
|
|
||||||
com.arsdigita.ui.admin.applications.AbstractAppSettingsPane.class)
|
|
||||||
.addClass(
|
|
||||||
com.arsdigita.ui.admin.applications.DefaultApplicationInstanceForm.class)
|
|
||||||
.addClass(
|
|
||||||
com.arsdigita.ui.admin.applications.DefaultApplicationSettingsPane.class)
|
|
||||||
.addClass(org.librecms.dispatcher.ItemResolver.class)
|
|
||||||
.addPackage(com.arsdigita.util.Lockable.class.getPackage())
|
|
||||||
.addPackage(com.arsdigita.web.BaseServlet.class.getPackage())
|
|
||||||
.addPackage(org.librecms.Cms.class.getPackage())
|
|
||||||
.addPackage(org.librecms.contentsection.Asset.class.getPackage())
|
|
||||||
.addPackage(org.librecms.assets.BinaryAsset.class.getPackage())
|
|
||||||
.addPackage(org.librecms.contentsection.AttachmentList.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.librecms.lifecycle.Lifecycle.class.getPackage())
|
|
||||||
.addPackage(org.librecms.contentsection.ContentSection.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.librecms.contenttypes.Article.class.getPackage())
|
|
||||||
.addClass(com.arsdigita.kernel.security.SecurityConfig.class)
|
|
||||||
.addPackage(org.libreccm.tests.categories.IntegrationTest.class
|
|
||||||
.getPackage())
|
|
||||||
.addClass(org.libreccm.imexport.Exportable.class)
|
|
||||||
// .addAsLibraries(getModuleDependencies())
|
|
||||||
.addAsLibraries(getCcmCoreDependencies())
|
.addAsLibraries(getCcmCoreDependencies())
|
||||||
.addAsResource("configs/shiro.ini", "shiro.ini")
|
.addAsResource("configs/shiro.ini", "shiro.ini")
|
||||||
.addAsResource(
|
.addAsResource(
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
*/
|
*/
|
||||||
package org.librecms.contentsection;
|
package org.librecms.contentsection;
|
||||||
|
|
||||||
import static org.libreccm.testutils.DependenciesHelpers.*;
|
import static org.libreccm.testutils.DependenciesHelpers.getCcmCoreDependencies;
|
||||||
|
|
||||||
import org.apache.shiro.subject.ExecutionException;
|
import org.apache.shiro.subject.ExecutionException;
|
||||||
import org.apache.shiro.subject.Subject;
|
import org.apache.shiro.subject.Subject;
|
||||||
|
|
@ -42,7 +42,6 @@ import org.junit.BeforeClass;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.libreccm.security.Shiro;
|
import org.libreccm.security.Shiro;
|
||||||
import org.libreccm.tests.categories.IntegrationTest;
|
|
||||||
import org.librecms.assets.BinaryAsset;
|
import org.librecms.assets.BinaryAsset;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -57,17 +56,18 @@ import org.librecms.assets.Image;
|
||||||
import org.librecms.assets.VideoAsset;
|
import org.librecms.assets.VideoAsset;
|
||||||
import org.librecms.contentsection.rs.Assets;
|
import org.librecms.contentsection.rs.Assets;
|
||||||
|
|
||||||
import java.util.concurrent.Callable;
|
import static org.hamcrest.CoreMatchers.equalTo;
|
||||||
|
import static org.hamcrest.CoreMatchers.instanceOf;
|
||||||
import static org.hamcrest.CoreMatchers.*;
|
import static org.hamcrest.CoreMatchers.is;
|
||||||
import static org.junit.Assert.*;
|
import static org.hamcrest.CoreMatchers.not;
|
||||||
|
import static org.hamcrest.CoreMatchers.nullValue;
|
||||||
|
import static org.junit.Assert.assertThat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for the {@link AssetRepository}.
|
* Tests for the {@link AssetRepository}.
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@org.junit.experimental.categories.Category(IntegrationTest.class)
|
|
||||||
@RunWith(Arquillian.class)
|
@RunWith(Arquillian.class)
|
||||||
@PersistenceTest
|
@PersistenceTest
|
||||||
@Transactional(TransactionMode.COMMIT)
|
@Transactional(TransactionMode.COMMIT)
|
||||||
|
|
@ -83,7 +83,7 @@ import static org.junit.Assert.*;
|
||||||
"999_cleanup.sql"
|
"999_cleanup.sql"
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
public class AssetRepositoryTest {
|
public class AssetRepositoryIT {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private AssetRepository assetRepo;
|
private AssetRepository assetRepo;
|
||||||
|
|
@ -94,7 +94,7 @@ public class AssetRepositoryTest {
|
||||||
@Inject
|
@Inject
|
||||||
private Shiro shiro;
|
private Shiro shiro;
|
||||||
|
|
||||||
public AssetRepositoryTest() {
|
public AssetRepositoryIT() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
|
|
@ -118,56 +118,7 @@ public class AssetRepositoryTest {
|
||||||
return ShrinkWrap
|
return ShrinkWrap
|
||||||
.create(WebArchive.class,
|
.create(WebArchive.class,
|
||||||
"LibreCCM-org.librecms.contentsection.AssetRepositoryTest.war")
|
"LibreCCM-org.librecms.contentsection.AssetRepositoryTest.war")
|
||||||
.addPackage(org.libreccm.auditing.CcmRevision.class.getPackage())
|
.addPackages(true, "com.arsdigita", "org.libreccm", "org.librecms")
|
||||||
.addPackage(org.libreccm.categorization.Categorization.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.cdi.utils.CdiUtil.class.getPackage())
|
|
||||||
.addPackage(org.libreccm.configuration.Configuration.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.core.CcmCore.class.getPackage())
|
|
||||||
.addPackage(org.libreccm.jpa.EntityManagerProducer.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.jpa.utils.MimeTypeConverter.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.l10n.LocalizedString.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.security.Permission.class.getPackage())
|
|
||||||
.addPackage(org.libreccm.web.CcmApplication.class.getPackage())
|
|
||||||
.addPackage(org.libreccm.workflow.Workflow.class.getPackage())
|
|
||||||
.addPackage(com.arsdigita.bebop.Component.class.getPackage())
|
|
||||||
.addPackage(com.arsdigita.bebop.util.BebopConstants.class
|
|
||||||
.getPackage())
|
|
||||||
.addClass(com.arsdigita.kernel.KernelConfig.class)
|
|
||||||
.addClass(com.arsdigita.runtime.CCMResourceManager.class)
|
|
||||||
.addClass(com.arsdigita.dispatcher.RequestContext.class)
|
|
||||||
.addClass(com.arsdigita.dispatcher.AccessDeniedException.class)
|
|
||||||
.addClass(com.arsdigita.cms.dispatcher.ContentItemDispatcher.class)
|
|
||||||
.addClass(com.arsdigita.dispatcher.Dispatcher.class)
|
|
||||||
.addClass(
|
|
||||||
com.arsdigita.ui.admin.applications.AbstractAppInstanceForm.class)
|
|
||||||
.addClass(
|
|
||||||
com.arsdigita.ui.admin.applications.AbstractAppSettingsPane.class)
|
|
||||||
.addClass(
|
|
||||||
com.arsdigita.ui.admin.applications.DefaultApplicationInstanceForm.class)
|
|
||||||
.addClass(
|
|
||||||
com.arsdigita.ui.admin.applications.DefaultApplicationSettingsPane.class)
|
|
||||||
.addClass(org.librecms.dispatcher.ItemResolver.class)
|
|
||||||
.addClass(org.libreccm.imexport.Exportable.class)
|
|
||||||
.addPackage(com.arsdigita.util.Lockable.class.getPackage())
|
|
||||||
.addPackage(com.arsdigita.web.BaseServlet.class.getPackage())
|
|
||||||
.addPackage(org.librecms.Cms.class.getPackage())
|
|
||||||
.addPackage(org.librecms.contentsection.Asset.class.getPackage())
|
|
||||||
.addPackage(org.librecms.assets.BinaryAsset.class.getPackage())
|
|
||||||
.addPackage(org.librecms.contentsection.AttachmentList.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.librecms.lifecycle.Lifecycle.class.getPackage())
|
|
||||||
.addPackage(org.librecms.contentsection.ContentSection.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.librecms.contenttypes.Article.class.getPackage()).
|
|
||||||
addClass(com.arsdigita.kernel.security.SecurityConfig.class)
|
|
||||||
.addPackage(org.libreccm.tests.categories.IntegrationTest.class
|
|
||||||
.getPackage())
|
|
||||||
// .addAsLibraries(getModuleDependencies())
|
|
||||||
.addAsLibraries(getCcmCoreDependencies())
|
.addAsLibraries(getCcmCoreDependencies())
|
||||||
.addAsResource("configs/shiro.ini", "shiro.ini")
|
.addAsResource("configs/shiro.ini", "shiro.ini")
|
||||||
.addAsResource(
|
.addAsResource(
|
||||||
|
|
@ -447,6 +398,9 @@ public class AssetRepositoryTest {
|
||||||
assertThat(result2.size(), is(0));
|
assertThat(result2.size(), is(0));
|
||||||
|
|
||||||
assertThat(result1.get(0).getDisplayName(), is(equalTo("header.png")));
|
assertThat(result1.get(0).getDisplayName(), is(equalTo("header.png")));
|
||||||
|
assertThat(
|
||||||
|
result1.get(1).getDisplayName(), is(equalTo("services-header.png"))
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
*/
|
*/
|
||||||
package org.librecms.contentsection;
|
package org.librecms.contentsection;
|
||||||
|
|
||||||
import static org.libreccm.testutils.DependenciesHelpers.*;
|
import static org.libreccm.testutils.DependenciesHelpers.getCcmCoreDependencies;
|
||||||
|
|
||||||
import org.apache.shiro.subject.Subject;
|
import org.apache.shiro.subject.Subject;
|
||||||
import org.jboss.arquillian.container.test.api.Deployment;
|
import org.jboss.arquillian.container.test.api.Deployment;
|
||||||
|
|
@ -41,24 +41,25 @@ import org.junit.BeforeClass;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.libreccm.security.Shiro;
|
import org.libreccm.security.Shiro;
|
||||||
import org.libreccm.tests.categories.IntegrationTest;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
import org.jboss.arquillian.persistence.CleanupUsingScript;
|
import org.jboss.arquillian.persistence.CleanupUsingScript;
|
||||||
import org.jboss.arquillian.persistence.TestExecutionPhase;
|
import org.jboss.arquillian.persistence.TestExecutionPhase;
|
||||||
|
|
||||||
import static org.hamcrest.CoreMatchers.*;
|
import static org.hamcrest.CoreMatchers.is;
|
||||||
import static org.junit.Assert.*;
|
import static org.hamcrest.CoreMatchers.not;
|
||||||
|
import static org.hamcrest.CoreMatchers.nullValue;
|
||||||
|
import static org.junit.Assert.assertThat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for the {@link AttachmentListManager}.
|
* Tests for the {@link AttachmentListManager}.
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@org.junit.experimental.categories.Category(IntegrationTest.class)
|
|
||||||
@RunWith(Arquillian.class)
|
@RunWith(Arquillian.class)
|
||||||
@PersistenceTest
|
@PersistenceTest
|
||||||
@Transactional(TransactionMode.COMMIT)
|
@Transactional(TransactionMode.COMMIT)
|
||||||
|
|
@ -75,7 +76,7 @@ import static org.junit.Assert.*;
|
||||||
},
|
},
|
||||||
phase = TestExecutionPhase.BEFORE
|
phase = TestExecutionPhase.BEFORE
|
||||||
)
|
)
|
||||||
public class AttachmentListManagerTest {
|
public class AttachmentListManagerIT {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private ContentItemRepository itemRepo;
|
private ContentItemRepository itemRepo;
|
||||||
|
|
@ -86,7 +87,7 @@ public class AttachmentListManagerTest {
|
||||||
@Inject
|
@Inject
|
||||||
private Shiro shiro;
|
private Shiro shiro;
|
||||||
|
|
||||||
public AttachmentListManagerTest() {
|
public AttachmentListManagerIT() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
|
|
@ -110,54 +111,7 @@ public class AttachmentListManagerTest {
|
||||||
return ShrinkWrap
|
return ShrinkWrap
|
||||||
.create(WebArchive.class,
|
.create(WebArchive.class,
|
||||||
"LibreCCM-org.librecms.assets.AssetManagerTest.war")
|
"LibreCCM-org.librecms.assets.AssetManagerTest.war")
|
||||||
.addPackage(org.libreccm.auditing.CcmRevision.class.getPackage())
|
.addPackages(true, "com.arsdigita", "org.libreccm", "org.librecms")
|
||||||
.addPackage(org.libreccm.categorization.Categorization.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.cdi.utils.CdiUtil.class.getPackage())
|
|
||||||
.addPackage(org.libreccm.configuration.Configuration.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.core.CcmCore.class.getPackage())
|
|
||||||
.addPackage(org.libreccm.jpa.EntityManagerProducer.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.jpa.utils.MimeTypeConverter.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.l10n.LocalizedString.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.security.Permission.class.getPackage())
|
|
||||||
.addPackage(org.libreccm.web.CcmApplication.class.getPackage())
|
|
||||||
.addPackage(org.libreccm.workflow.Workflow.class.getPackage())
|
|
||||||
.addPackage(com.arsdigita.bebop.Component.class.getPackage())
|
|
||||||
.addPackage(com.arsdigita.bebop.util.BebopConstants.class
|
|
||||||
.getPackage())
|
|
||||||
.addClass(com.arsdigita.kernel.KernelConfig.class)
|
|
||||||
.addClass(com.arsdigita.runtime.CCMResourceManager.class)
|
|
||||||
.addClass(com.arsdigita.dispatcher.RequestContext.class)
|
|
||||||
.addClass(com.arsdigita.dispatcher.AccessDeniedException.class)
|
|
||||||
.addClass(com.arsdigita.cms.dispatcher.ContentItemDispatcher.class)
|
|
||||||
.addClass(com.arsdigita.dispatcher.Dispatcher.class)
|
|
||||||
.addClass(
|
|
||||||
com.arsdigita.ui.admin.applications.AbstractAppInstanceForm.class)
|
|
||||||
.addClass(
|
|
||||||
com.arsdigita.ui.admin.applications.AbstractAppSettingsPane.class)
|
|
||||||
.addClass(
|
|
||||||
com.arsdigita.ui.admin.applications.DefaultApplicationInstanceForm.class)
|
|
||||||
.addClass(
|
|
||||||
com.arsdigita.ui.admin.applications.DefaultApplicationSettingsPane.class)
|
|
||||||
.addClass(org.librecms.dispatcher.ItemResolver.class)
|
|
||||||
.addClass(org.libreccm.imexport.Exportable.class)
|
|
||||||
.addPackage(com.arsdigita.util.Lockable.class.getPackage())
|
|
||||||
.addPackage(com.arsdigita.web.BaseServlet.class.getPackage())
|
|
||||||
.addPackage(org.librecms.Cms.class.getPackage())
|
|
||||||
.addPackage(org.librecms.assets.BinaryAsset.class.getPackage())
|
|
||||||
.addPackage(org.librecms.contentsection.Asset.class.getPackage())
|
|
||||||
.addPackage(org.librecms.lifecycle.Lifecycle.class.getPackage())
|
|
||||||
.addPackage(org.librecms.contentsection.ContentSection.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.librecms.contenttypes.Article.class.getPackage()).
|
|
||||||
addClass(com.arsdigita.kernel.security.SecurityConfig.class)
|
|
||||||
.addPackage(org.libreccm.tests.categories.IntegrationTest.class
|
|
||||||
.getPackage())
|
|
||||||
// .addAsLibraries(getModuleDependencies())
|
|
||||||
.addAsLibraries(getCcmCoreDependencies())
|
.addAsLibraries(getCcmCoreDependencies())
|
||||||
.addAsResource("configs/shiro.ini", "shiro.ini")
|
.addAsResource("configs/shiro.ini", "shiro.ini")
|
||||||
.addAsResource(
|
.addAsResource(
|
||||||
|
|
@ -373,8 +327,8 @@ public class AttachmentListManagerTest {
|
||||||
+ "data.xml")
|
+ "data.xml")
|
||||||
@ShouldMatchDataSet(
|
@ShouldMatchDataSet(
|
||||||
value
|
value
|
||||||
= "datasets/org/librecms/contentsection/AttachmentListManagerTest/"
|
= "datasets/org/librecms/contentsection/AttachmentListManagerTest/"
|
||||||
+ "after-create.xml",
|
+ "after-create.xml",
|
||||||
excludeColumns = {"timestamp",
|
excludeColumns = {"timestamp",
|
||||||
"object_id",
|
"object_id",
|
||||||
"list_id",
|
"list_id",
|
||||||
|
|
@ -18,13 +18,12 @@
|
||||||
*/
|
*/
|
||||||
package org.librecms.contentsection;
|
package org.librecms.contentsection;
|
||||||
|
|
||||||
import nl.jqno.equalsverifier.EqualsVerifierApi;
|
import nl.jqno.equalsverifier.api.SingleTypeEqualsVerifierApi;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.junit.runners.Parameterized;
|
import org.junit.runners.Parameterized;
|
||||||
import org.libreccm.core.CcmObject;
|
import org.libreccm.core.CcmObject;
|
||||||
import org.libreccm.security.Group;
|
import org.libreccm.security.Group;
|
||||||
import org.libreccm.security.Role;
|
import org.libreccm.security.Role;
|
||||||
import org.libreccm.tests.categories.UnitTest;
|
|
||||||
import org.libreccm.testutils.EqualsVerifier;
|
import org.libreccm.testutils.EqualsVerifier;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
@ -38,7 +37,6 @@ import java.util.UUID;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@RunWith(Parameterized.class)
|
@RunWith(Parameterized.class)
|
||||||
@org.junit.experimental.categories.Category(UnitTest.class)
|
|
||||||
public class AttachmentsEqualsAndHashCodeTest extends EqualsVerifier {
|
public class AttachmentsEqualsAndHashCodeTest extends EqualsVerifier {
|
||||||
|
|
||||||
@Parameterized.Parameters(name = "{0}")
|
@Parameterized.Parameters(name = "{0}")
|
||||||
|
|
@ -55,7 +53,7 @@ public class AttachmentsEqualsAndHashCodeTest extends EqualsVerifier {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void addPrefabValues(final EqualsVerifierApi<?> verifier) {
|
protected void addPrefabValues(final SingleTypeEqualsVerifierApi<?> verifier) {
|
||||||
|
|
||||||
final ContentSection section1 = new ContentSection();
|
final ContentSection section1 = new ContentSection();
|
||||||
section1.setDisplayName("section1");
|
section1.setDisplayName("section1");
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
*/
|
*/
|
||||||
package org.librecms.contentsection;
|
package org.librecms.contentsection;
|
||||||
|
|
||||||
import static org.libreccm.testutils.DependenciesHelpers.*;
|
import static org.libreccm.testutils.DependenciesHelpers.getCcmCoreDependencies;
|
||||||
|
|
||||||
import org.jboss.arquillian.container.test.api.Deployment;
|
import org.jboss.arquillian.container.test.api.Deployment;
|
||||||
import org.jboss.arquillian.container.test.api.ShouldThrowException;
|
import org.jboss.arquillian.container.test.api.ShouldThrowException;
|
||||||
|
|
@ -40,24 +40,25 @@ import org.junit.BeforeClass;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.libreccm.security.Shiro;
|
import org.libreccm.security.Shiro;
|
||||||
import org.libreccm.tests.categories.IntegrationTest;
|
|
||||||
|
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
import org.jboss.arquillian.persistence.CleanupUsingScript;
|
import org.jboss.arquillian.persistence.CleanupUsingScript;
|
||||||
import org.jboss.arquillian.persistence.TestExecutionPhase;
|
import org.jboss.arquillian.persistence.TestExecutionPhase;
|
||||||
|
|
||||||
import static org.hamcrest.CoreMatchers.*;
|
import static org.hamcrest.CoreMatchers.is;
|
||||||
import static org.junit.Assert.*;
|
import static org.hamcrest.CoreMatchers.not;
|
||||||
|
import static org.hamcrest.CoreMatchers.nullValue;
|
||||||
|
import static org.junit.Assert.assertThat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Verifies the methods of the {@link ContentItemL10NManager}.
|
* Verifies the methods of the {@link ContentItemL10NManager}.
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@org.junit.experimental.categories.Category(IntegrationTest.class)
|
|
||||||
@RunWith(Arquillian.class)
|
@RunWith(Arquillian.class)
|
||||||
@PersistenceTest
|
@PersistenceTest
|
||||||
@Transactional(TransactionMode.COMMIT)
|
@Transactional(TransactionMode.COMMIT)
|
||||||
|
|
@ -74,7 +75,7 @@ import static org.junit.Assert.*;
|
||||||
},
|
},
|
||||||
phase = TestExecutionPhase.BEFORE
|
phase = TestExecutionPhase.BEFORE
|
||||||
)
|
)
|
||||||
public class ContentItemL10NManagerTest {
|
public class ContentItemL10NManagerIT {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private ContentItemRepository itemRepo;
|
private ContentItemRepository itemRepo;
|
||||||
|
|
@ -88,7 +89,7 @@ public class ContentItemL10NManagerTest {
|
||||||
@Inject
|
@Inject
|
||||||
private Shiro shiro;
|
private Shiro shiro;
|
||||||
|
|
||||||
public ContentItemL10NManagerTest() {
|
public ContentItemL10NManagerIT() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
|
|
@ -112,56 +113,7 @@ public class ContentItemL10NManagerTest {
|
||||||
return ShrinkWrap
|
return ShrinkWrap
|
||||||
.create(WebArchive.class,
|
.create(WebArchive.class,
|
||||||
"LibreCCM-org.librecms.contentsection.ContentItemManagerTest.war")
|
"LibreCCM-org.librecms.contentsection.ContentItemManagerTest.war")
|
||||||
.addPackage(org.libreccm.auditing.CcmRevision.class.getPackage())
|
.addPackages(true, "com.arsdigita", "org.libreccm", "org.librecms")
|
||||||
.addPackage(org.libreccm.categorization.Categorization.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.cdi.utils.CdiUtil.class.getPackage())
|
|
||||||
.addPackage(org.libreccm.configuration.Configuration.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.core.CcmCore.class.getPackage())
|
|
||||||
.addPackage(org.libreccm.jpa.EntityManagerProducer.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.jpa.utils.MimeTypeConverter.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.l10n.LocalizedString.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.security.Permission.class.getPackage())
|
|
||||||
.addPackage(org.libreccm.web.CcmApplication.class.getPackage())
|
|
||||||
.addPackage(org.libreccm.workflow.Workflow.class.getPackage())
|
|
||||||
.addPackage(com.arsdigita.bebop.Component.class.getPackage())
|
|
||||||
.addPackage(com.arsdigita.bebop.util.BebopConstants.class
|
|
||||||
.getPackage())
|
|
||||||
.addClass(com.arsdigita.kernel.KernelConfig.class)
|
|
||||||
.addClass(com.arsdigita.runtime.CCMResourceManager.class)
|
|
||||||
.addClass(com.arsdigita.dispatcher.RequestContext.class)
|
|
||||||
.addClass(com.arsdigita.dispatcher.AccessDeniedException.class)
|
|
||||||
.addClass(
|
|
||||||
com.arsdigita.cms.dispatcher.ContentItemDispatcher.class).
|
|
||||||
addClass(com.arsdigita.dispatcher.Dispatcher.class)
|
|
||||||
.addClass(
|
|
||||||
com.arsdigita.ui.admin.applications.AbstractAppInstanceForm.class)
|
|
||||||
.addClass(
|
|
||||||
com.arsdigita.ui.admin.applications.AbstractAppSettingsPane.class)
|
|
||||||
.addClass(
|
|
||||||
com.arsdigita.ui.admin.applications.DefaultApplicationInstanceForm.class)
|
|
||||||
.addClass(
|
|
||||||
com.arsdigita.ui.admin.applications.DefaultApplicationSettingsPane.class)
|
|
||||||
.addClass(org.librecms.dispatcher.ItemResolver.class)
|
|
||||||
.addClass(org.libreccm.imexport.Exportable.class)
|
|
||||||
.addPackage(com.arsdigita.util.Lockable.class.getPackage())
|
|
||||||
.addPackage(com.arsdigita.web.BaseServlet.class.getPackage())
|
|
||||||
.addPackage(org.librecms.Cms.class.getPackage())
|
|
||||||
.addPackage(org.librecms.contentsection.Asset.class.getPackage()).
|
|
||||||
addPackage(org.librecms.contentsection.AttachmentList.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.librecms.lifecycle.Lifecycle.class.getPackage())
|
|
||||||
.addPackage(org.librecms.contentsection.ContentSection.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.librecms.contenttypes.Article.class.getPackage()).
|
|
||||||
addClass(com.arsdigita.kernel.security.SecurityConfig.class)
|
|
||||||
.addPackage(org.libreccm.tests.categories.IntegrationTest.class
|
|
||||||
.getPackage())
|
|
||||||
// .addAsLibraries(getModuleDependencies())
|
|
||||||
.addAsLibraries(getCcmCoreDependencies())
|
.addAsLibraries(getCcmCoreDependencies())
|
||||||
.addAsResource("configs/shiro.ini", "shiro.ini")
|
.addAsResource("configs/shiro.ini", "shiro.ini")
|
||||||
.addAsResource(
|
.addAsResource(
|
||||||
|
|
@ -18,6 +18,8 @@
|
||||||
*/
|
*/
|
||||||
package org.librecms.contentsection;
|
package org.librecms.contentsection;
|
||||||
|
|
||||||
|
import static org.libreccm.testutils.DependenciesHelpers.getCcmCoreDependencies;
|
||||||
|
|
||||||
import org.jboss.arquillian.container.test.api.Deployment;
|
import org.jboss.arquillian.container.test.api.Deployment;
|
||||||
import org.jboss.arquillian.container.test.api.ShouldThrowException;
|
import org.jboss.arquillian.container.test.api.ShouldThrowException;
|
||||||
import org.jboss.arquillian.junit.Arquillian;
|
import org.jboss.arquillian.junit.Arquillian;
|
||||||
|
|
@ -38,7 +40,6 @@ import org.junit.BeforeClass;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.libreccm.security.Shiro;
|
import org.libreccm.security.Shiro;
|
||||||
import org.libreccm.tests.categories.IntegrationTest;
|
|
||||||
import org.librecms.contenttypes.Article;
|
import org.librecms.contenttypes.Article;
|
||||||
import org.librecms.contenttypes.Event;
|
import org.librecms.contenttypes.Event;
|
||||||
import org.librecms.lifecycle.LifecycleDefinition;
|
import org.librecms.lifecycle.LifecycleDefinition;
|
||||||
|
|
@ -54,20 +55,21 @@ import javax.persistence.TypedQuery;
|
||||||
import org.jboss.arquillian.persistence.CleanupUsingScript;
|
import org.jboss.arquillian.persistence.CleanupUsingScript;
|
||||||
import org.jboss.arquillian.persistence.TestExecutionPhase;
|
import org.jboss.arquillian.persistence.TestExecutionPhase;
|
||||||
|
|
||||||
import static org.hamcrest.CoreMatchers.*;
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
import static org.libreccm.testutils.DependenciesHelpers.*;
|
|
||||||
|
|
||||||
import org.libreccm.workflow.Workflow;
|
import org.libreccm.workflow.Workflow;
|
||||||
import org.libreccm.workflow.WorkflowRepository;
|
import org.libreccm.workflow.WorkflowRepository;
|
||||||
|
|
||||||
|
import static org.hamcrest.CoreMatchers.equalTo;
|
||||||
|
import static org.hamcrest.CoreMatchers.is;
|
||||||
|
import static org.hamcrest.CoreMatchers.not;
|
||||||
|
import static org.hamcrest.CoreMatchers.nullValue;
|
||||||
|
import static org.junit.Assert.assertThat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for the {@link ContentItemManager}.
|
* Tests for the {@link ContentItemManager}.
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@org.junit.experimental.categories.Category(IntegrationTest.class)
|
|
||||||
@RunWith(Arquillian.class)
|
@RunWith(Arquillian.class)
|
||||||
@PersistenceTest
|
@PersistenceTest
|
||||||
@Transactional(TransactionMode.COMMIT)
|
@Transactional(TransactionMode.COMMIT)
|
||||||
|
|
@ -84,7 +86,7 @@ import org.libreccm.workflow.WorkflowRepository;
|
||||||
},
|
},
|
||||||
phase = TestExecutionPhase.BEFORE
|
phase = TestExecutionPhase.BEFORE
|
||||||
)
|
)
|
||||||
public class ContentItemManagerTest {
|
public class ContentItemManagerIT {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private ContentSectionRepository sectionRepo;
|
private ContentSectionRepository sectionRepo;
|
||||||
|
|
@ -110,7 +112,7 @@ public class ContentItemManagerTest {
|
||||||
@Inject
|
@Inject
|
||||||
private EntityManager entityManager;
|
private EntityManager entityManager;
|
||||||
|
|
||||||
public ContentItemManagerTest() {
|
public ContentItemManagerIT() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
|
|
@ -134,56 +136,7 @@ public class ContentItemManagerTest {
|
||||||
return ShrinkWrap
|
return ShrinkWrap
|
||||||
.create(WebArchive.class,
|
.create(WebArchive.class,
|
||||||
"LibreCCM-org.librecms.contentsection.ContentItemManagerTest.war")
|
"LibreCCM-org.librecms.contentsection.ContentItemManagerTest.war")
|
||||||
.addPackage(org.libreccm.auditing.CcmRevision.class.getPackage())
|
.addPackages(true, "com.arsdigita", "org.libreccm", "org.librecms")
|
||||||
.addPackage(org.libreccm.categorization.Categorization.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.cdi.utils.CdiUtil.class.getPackage())
|
|
||||||
.addPackage(org.libreccm.configuration.Configuration.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.core.CcmCore.class.getPackage())
|
|
||||||
.addPackage(org.libreccm.jpa.EntityManagerProducer.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.jpa.utils.MimeTypeConverter.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.l10n.LocalizedString.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.security.Permission.class.getPackage())
|
|
||||||
.addPackage(org.libreccm.web.CcmApplication.class.getPackage())
|
|
||||||
.addPackage(org.libreccm.workflow.Workflow.class.getPackage())
|
|
||||||
.addPackage(com.arsdigita.bebop.Component.class.getPackage())
|
|
||||||
.addPackage(com.arsdigita.bebop.util.BebopConstants.class
|
|
||||||
.getPackage())
|
|
||||||
.addClass(com.arsdigita.kernel.KernelConfig.class)
|
|
||||||
.addClass(com.arsdigita.runtime.CCMResourceManager.class)
|
|
||||||
.addClass(com.arsdigita.dispatcher.RequestContext.class)
|
|
||||||
.addClass(com.arsdigita.dispatcher.AccessDeniedException.class)
|
|
||||||
.addClass(com.arsdigita.cms.dispatcher.ContentItemDispatcher.class)
|
|
||||||
.addClass(com.arsdigita.dispatcher.Dispatcher.class)
|
|
||||||
.addClass(
|
|
||||||
com.arsdigita.ui.admin.applications.AbstractAppInstanceForm.class)
|
|
||||||
.addClass(
|
|
||||||
com.arsdigita.ui.admin.applications.AbstractAppSettingsPane.class)
|
|
||||||
.addClass(
|
|
||||||
com.arsdigita.ui.admin.applications.DefaultApplicationInstanceForm.class)
|
|
||||||
.addClass(
|
|
||||||
com.arsdigita.ui.admin.applications.DefaultApplicationSettingsPane.class)
|
|
||||||
.addClass(org.librecms.dispatcher.ItemResolver.class)
|
|
||||||
.addClass(org.libreccm.imexport.Exportable.class)
|
|
||||||
.addPackage(com.arsdigita.util.Lockable.class.getPackage())
|
|
||||||
.addPackage(com.arsdigita.web.BaseServlet.class.getPackage())
|
|
||||||
.addPackage(org.librecms.Cms.class.getPackage())
|
|
||||||
.addPackage(org.librecms.contentsection.Asset.class.getPackage())
|
|
||||||
.addPackage(org.librecms.contentsection.AttachmentList.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.librecms.assets.BinaryAsset.class.getPackage())
|
|
||||||
.addPackage(org.librecms.lifecycle.Lifecycle.class.getPackage())
|
|
||||||
.addPackage(org.librecms.contentsection.ContentSection.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.librecms.contenttypes.Article.class.getPackage()).
|
|
||||||
addClass(com.arsdigita.kernel.security.SecurityConfig.class)
|
|
||||||
.addPackage(org.libreccm.tests.categories.IntegrationTest.class
|
|
||||||
.getPackage())
|
|
||||||
// .addAsLibraries(getModuleDependencies())
|
|
||||||
.addAsLibraries(getCcmCoreDependencies())
|
.addAsLibraries(getCcmCoreDependencies())
|
||||||
.addAsResource("configs/shiro.ini", "shiro.ini")
|
.addAsResource("configs/shiro.ini", "shiro.ini")
|
||||||
.addAsResource(
|
.addAsResource(
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
*/
|
*/
|
||||||
package org.librecms.contentsection;
|
package org.librecms.contentsection;
|
||||||
|
|
||||||
import static org.libreccm.testutils.DependenciesHelpers.*;
|
import static org.libreccm.testutils.DependenciesHelpers.getCcmCoreDependencies;
|
||||||
|
|
||||||
import org.apache.shiro.authc.UsernamePasswordToken;
|
import org.apache.shiro.authc.UsernamePasswordToken;
|
||||||
import org.apache.shiro.subject.Subject;
|
import org.apache.shiro.subject.Subject;
|
||||||
|
|
@ -44,7 +44,6 @@ import org.junit.runner.RunWith;
|
||||||
import org.libreccm.security.Role;
|
import org.libreccm.security.Role;
|
||||||
import org.libreccm.security.Shiro;
|
import org.libreccm.security.Shiro;
|
||||||
import org.libreccm.security.User;
|
import org.libreccm.security.User;
|
||||||
import org.libreccm.tests.categories.IntegrationTest;
|
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -56,14 +55,16 @@ import javax.inject.Inject;
|
||||||
import javax.persistence.EntityManager;
|
import javax.persistence.EntityManager;
|
||||||
import javax.persistence.TypedQuery;
|
import javax.persistence.TypedQuery;
|
||||||
|
|
||||||
import static org.hamcrest.CoreMatchers.*;
|
import static org.hamcrest.CoreMatchers.equalTo;
|
||||||
|
import static org.hamcrest.CoreMatchers.is;
|
||||||
|
import static org.hamcrest.CoreMatchers.not;
|
||||||
|
import static org.hamcrest.CoreMatchers.nullValue;
|
||||||
import static org.junit.Assert.*;
|
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>
|
||||||
*/
|
*/
|
||||||
@org.junit.experimental.categories.Category(IntegrationTest.class)
|
|
||||||
@RunWith(Arquillian.class)
|
@RunWith(Arquillian.class)
|
||||||
@PersistenceTest
|
@PersistenceTest
|
||||||
@Transactional(TransactionMode.COMMIT)
|
@Transactional(TransactionMode.COMMIT)
|
||||||
|
|
@ -80,7 +81,7 @@ import static org.junit.Assert.*;
|
||||||
},
|
},
|
||||||
phase = TestExecutionPhase.BEFORE
|
phase = TestExecutionPhase.BEFORE
|
||||||
)
|
)
|
||||||
public class ContentItemPermissionTest {
|
public class ContentItemPermissionIT {
|
||||||
|
|
||||||
private static final String QUERY = "SELECT DISTINCT i FROM ContentItem i "
|
private static final String QUERY = "SELECT DISTINCT i FROM ContentItem i "
|
||||||
+ "JOIN i.permissions p "
|
+ "JOIN i.permissions p "
|
||||||
|
|
@ -118,135 +119,7 @@ public class ContentItemPermissionTest {
|
||||||
public static WebArchive createDeployment() {
|
public static WebArchive createDeployment() {
|
||||||
return ShrinkWrap
|
return ShrinkWrap
|
||||||
.create(WebArchive.class,
|
.create(WebArchive.class,
|
||||||
"LibreCCM-org.librecms.contentsection.ContentItemPermissionTest.war") //Classes imported by this class
|
"LibreCCM-org.librecms.contentsection.ContentItemPermissionTest.war") .addPackages(true, "com.arsdigita", "org.libreccm", "org.librecms")
|
||||||
.
|
|
||||||
addClass(Role.class)
|
|
||||||
.addClass(Shiro.class)
|
|
||||||
.addClass(User.class)
|
|
||||||
.addClass(ContentItem.class)
|
|
||||||
.addClass(IntegrationTest.class)
|
|
||||||
//Classes used by Role.class
|
|
||||||
.addClass(org.libreccm.l10n.LocalizedString.class)
|
|
||||||
.addClass(org.libreccm.security.Permission.class)
|
|
||||||
.addClass(org.libreccm.security.RoleMembership.class)
|
|
||||||
.addClass(org.libreccm.workflow.TaskAssignment.class)
|
|
||||||
//Classes used by Role.class, User.class,
|
|
||||||
//org.libreccm.core.CcmObject.class
|
|
||||||
//Classes used by Shiro.class
|
|
||||||
.addClass(org.libreccm.security.UserRepository.class)
|
|
||||||
//Class used by User.class
|
|
||||||
.addClass(org.libreccm.core.EmailAddress.class)
|
|
||||||
.addClass(org.libreccm.security.GroupMembership.class)
|
|
||||||
.addClass(org.libreccm.security.Party.class)
|
|
||||||
//Classes required by org.libreccm.security.Permission.class
|
|
||||||
.addClass(org.libreccm.core.CcmObject.class)
|
|
||||||
//Classes required by org.libreccm.workflow.TaskAssignment.class
|
|
||||||
.addClass(org.libreccm.workflow.AssignableTask.class)
|
|
||||||
//Classes required by org.libreccm.security.UserRepository
|
|
||||||
.addClass(org.libreccm.core.AbstractEntityRepository.class)
|
|
||||||
.addClass(org.libreccm.security.AuthorizationRequired.class)
|
|
||||||
.addClass(org.libreccm.security.RequiresPrivilege.class)
|
|
||||||
//Classes required by org.libreccm.secuirty.GroupMembership
|
|
||||||
.addClass(org.libreccm.security.Group.class)
|
|
||||||
//Classes required by org.libreccm.core.CcmObject
|
|
||||||
.addClass(org.libreccm.categorization.Categorization.class)
|
|
||||||
.addClass(org.libreccm.core.Identifiable.class)
|
|
||||||
//Classes required by org.libreccm.workflow.AssignableTask
|
|
||||||
.addClass(org.libreccm.workflow.Task.class)
|
|
||||||
//Classes required by org.libreccm.categorization.Categorization.class
|
|
||||||
.addClass(org.libreccm.categorization.Category.class)
|
|
||||||
.addClass(org.libreccm.security.Relation.class)
|
|
||||||
//Classes required by org.libreccm.workflow.Task.class
|
|
||||||
.addClass(org.libreccm.workflow.TaskComment.class)
|
|
||||||
.addClass(org.libreccm.workflow.TaskDependency.class)
|
|
||||||
.addClass(org.libreccm.workflow.TaskState.class)
|
|
||||||
.addClass(org.libreccm.workflow.Workflow.class)
|
|
||||||
.addClass(org.libreccm.workflow.AbstractWorkflowException.class)
|
|
||||||
//Classes required by org.libreccm.categorization.Category
|
|
||||||
.addClass(org.libreccm.security.RecursivePermissions.class)
|
|
||||||
//Classes required by org.libreccm.workflow.Workflow.class
|
|
||||||
.addClass(org.libreccm.workflow.WorkflowState.class)
|
|
||||||
//Classes required by org.librecms.contentsection.ContentItem
|
|
||||||
.addClass(org.librecms.contentsection.AttachmentList.class)
|
|
||||||
.addClass(org.librecms.contentsection.ContentItemVersion.class)
|
|
||||||
.addClass(org.librecms.contentsection.ContentType.class)
|
|
||||||
.addClass(org.librecms.lifecycle.Lifecycle.class)
|
|
||||||
//Classes required by org.librecms.contentsection.AttachmentList
|
|
||||||
.addClass(org.librecms.contentsection.ItemAttachment.class)
|
|
||||||
//Classes required by org.librecms.contentsection.ContentType
|
|
||||||
.addClass(org.librecms.contentsection.ContentSection.class)
|
|
||||||
.addClass(org.librecms.contentsection.ContentTypeMode.class)
|
|
||||||
.addClass(org.librecms.lifecycle.LifecycleDefinition.class)
|
|
||||||
//Classes required by org.librecms.lifecycle.Lifecycle
|
|
||||||
.addClass(org.librecms.lifecycle.Phase.class)
|
|
||||||
//Classes required by org.librecms.contentsection.ItemAttachment
|
|
||||||
.addClass(org.librecms.contentsection.Asset.class)
|
|
||||||
//Classes required by org.librecms.contentsection.ContentSection
|
|
||||||
.addClass(org.libreccm.web.CcmApplication.class)
|
|
||||||
.addClass(org.librecms.contentsection.Folder.class)
|
|
||||||
//Classes required by org.librecms.lifecycle.LifecycleDefinition
|
|
||||||
.addClass(org.librecms.lifecycle.PhaseDefinition.class)
|
|
||||||
//Classes required by org.librecms.contentsection.Asset
|
|
||||||
.addClass(org.librecms.CmsConstants.class)
|
|
||||||
//Classes required by org.librecms.contentsection.Folder
|
|
||||||
.addClass(org.librecms.contentsection.FolderType.class)
|
|
||||||
//Classes required by org.libreccm.web.CcmApplication
|
|
||||||
.addClass(org.libreccm.categorization.DomainOwnership.class)
|
|
||||||
.addClass(org.libreccm.core.Resource.class)
|
|
||||||
//Classes required by org.libreccm.categorization.DomainOwnership
|
|
||||||
.addClass(org.libreccm.categorization.Domain.class)
|
|
||||||
//Classes required by org.libreccm.core.Resource
|
|
||||||
.addClass(org.libreccm.core.ResourceType.class)
|
|
||||||
//Required for CDI injection of EntityManager
|
|
||||||
.addClass(org.libreccm.jpa.EntityManagerProducer.class)
|
|
||||||
.addClass(org.libreccm.jpa.AuditReaderProducer.class)
|
|
||||||
//Required for Authentication and Authorization
|
|
||||||
.addClass(org.libreccm.security.CcmShiroRealm.class)
|
|
||||||
//Required by org.libreccm.security.CcmShiroRealm
|
|
||||||
.addClass(org.libreccm.cdi.utils.CdiUtil.class)
|
|
||||||
.addClass("org.libreccm.security.CcmShiroRealmController")
|
|
||||||
.addClass(org.libreccm.core.CcmObject.class)
|
|
||||||
//Required by org.libreccm.security.CcmShiroRealmController
|
|
||||||
.addClass(com.arsdigita.kernel.KernelConfig.class)
|
|
||||||
.addClass(org.libreccm.security.GroupRepository.class)
|
|
||||||
.addClass(org.libreccm.security.PermissionManager.class)
|
|
||||||
.addClass(org.libreccm.security.PermissionRepository.class)
|
|
||||||
.addClass(org.libreccm.security.RoleRepository.class)
|
|
||||||
.addClass(org.libreccm.security.UserRepository.class)
|
|
||||||
.addClass(org.libreccm.security.Shiro.class)
|
|
||||||
.addClass(org.libreccm.core.UnexpectedErrorException.class)
|
|
||||||
//Required by org.libreccm.kernel.KernelConfig
|
|
||||||
.addClass(org.libreccm.configuration.Configuration.class)
|
|
||||||
.addClass(org.libreccm.configuration.ConfigurationManager.class)
|
|
||||||
.addClass(org.libreccm.configuration.Setting.class)
|
|
||||||
//Required by org.libreccm.configuration.ConfigurationManager
|
|
||||||
.addClass(org.libreccm.configuration.AbstractSetting.class)
|
|
||||||
.addClass(org.libreccm.configuration.ConfigurationInfo.class)
|
|
||||||
.addClass("org.libreccm.configuration.SettingConverter")
|
|
||||||
.addClass(org.libreccm.configuration.SettingInfo.class)
|
|
||||||
.addClass(org.libreccm.configuration.SettingManager.class)
|
|
||||||
.addClass(org.libreccm.modules.CcmModule.class)
|
|
||||||
//Required by org.libreccm.configuration.SettingConverter.class
|
|
||||||
.addClass(org.libreccm.configuration.BigDecimalSetting.class)
|
|
||||||
.addClass(org.libreccm.configuration.BooleanSetting.class)
|
|
||||||
.addClass(org.libreccm.configuration.DoubleSetting.class)
|
|
||||||
.addClass(org.libreccm.configuration.EnumSetting.class)
|
|
||||||
.addClass(org.libreccm.configuration.LocalizedStringSetting.class)
|
|
||||||
.addClass(org.libreccm.configuration.LongSetting.class)
|
|
||||||
.addClass(org.libreccm.configuration.StringListSetting.class)
|
|
||||||
.addClass(org.libreccm.configuration.StringSetting.class)
|
|
||||||
//Required by org.libreccm.modules.CcmModule
|
|
||||||
.addClass(org.libreccm.modules.ModuleEvent.class)
|
|
||||||
.addClass(org.libreccm.modules.InitEvent.class)
|
|
||||||
.addClass(org.libreccm.modules.InstallEvent.class)
|
|
||||||
.addClass(org.libreccm.modules.ShutdownEvent.class)
|
|
||||||
.addClass(org.libreccm.modules.UnInstallEvent.class)
|
|
||||||
//Required by org.libreccm.security.PermissionManager
|
|
||||||
.addClass(org.libreccm.core.CcmObjectRepository.class)
|
|
||||||
//Required by org.libreccm.core.CcmObjectRepository
|
|
||||||
.addClass(org.libreccm.core.CoreConstants.class)
|
|
||||||
.addClass(org.libreccm.imexport.Exportable.class)
|
|
||||||
//Dependencies from other modules and resources
|
|
||||||
.addAsLibraries(getCcmCoreDependencies())
|
.addAsLibraries(getCcmCoreDependencies())
|
||||||
.addAsResource("test-persistence.xml",
|
.addAsResource("test-persistence.xml",
|
||||||
"META-INF/persistence.xml")
|
"META-INF/persistence.xml")
|
||||||
|
|
@ -18,6 +18,8 @@
|
||||||
*/
|
*/
|
||||||
package org.librecms.contentsection;
|
package org.librecms.contentsection;
|
||||||
|
|
||||||
|
import static org.libreccm.testutils.DependenciesHelpers.getCcmCoreDependencies;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
@ -46,24 +48,22 @@ import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.libreccm.categorization.Category;
|
import org.libreccm.categorization.Category;
|
||||||
import org.libreccm.categorization.CategoryRepository;
|
import org.libreccm.categorization.CategoryRepository;
|
||||||
import org.libreccm.tests.categories.IntegrationTest;
|
|
||||||
import org.librecms.contenttypes.Article;
|
import org.librecms.contenttypes.Article;
|
||||||
import org.librecms.contenttypes.News;
|
import org.librecms.contenttypes.News;
|
||||||
|
|
||||||
import static org.hamcrest.CoreMatchers.*;
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
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 static org.hamcrest.CoreMatchers.equalTo;
|
||||||
|
import static org.hamcrest.CoreMatchers.is;
|
||||||
|
import static org.hamcrest.CoreMatchers.not;
|
||||||
|
import static org.hamcrest.CoreMatchers.nullValue;
|
||||||
|
import static org.junit.Assert.assertThat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@org.junit.experimental.categories.Category(IntegrationTest.class)
|
|
||||||
@RunWith(Arquillian.class)
|
@RunWith(Arquillian.class)
|
||||||
@PersistenceTest
|
@PersistenceTest
|
||||||
@Transactional(TransactionMode.COMMIT)
|
@Transactional(TransactionMode.COMMIT)
|
||||||
|
|
@ -80,7 +80,7 @@ import org.libreccm.security.Shiro;
|
||||||
},
|
},
|
||||||
phase = TestExecutionPhase.BEFORE
|
phase = TestExecutionPhase.BEFORE
|
||||||
)
|
)
|
||||||
public class ContentItemRepositoryTest {
|
public class ContentItemRepositoryIT {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private ContentItemRepository itemRepo;
|
private ContentItemRepository itemRepo;
|
||||||
|
|
@ -91,7 +91,7 @@ public class ContentItemRepositoryTest {
|
||||||
@Inject
|
@Inject
|
||||||
private Shiro shiro;
|
private Shiro shiro;
|
||||||
|
|
||||||
public ContentItemRepositoryTest() {
|
public ContentItemRepositoryIT() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
|
|
@ -116,54 +116,7 @@ public class ContentItemRepositoryTest {
|
||||||
return ShrinkWrap
|
return ShrinkWrap
|
||||||
.create(WebArchive.class,
|
.create(WebArchive.class,
|
||||||
"LibreCCM-org.librecms.contentsection.ContentItemRepositoryTest.war")
|
"LibreCCM-org.librecms.contentsection.ContentItemRepositoryTest.war")
|
||||||
.addPackage(org.libreccm.auditing.CcmRevision.class.getPackage())
|
.addPackages(true, "com.arsdigita", "org.libreccm", "org.librecms")
|
||||||
.addPackage(org.libreccm.categorization.Categorization.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.cdi.utils.CdiUtil.class.getPackage())
|
|
||||||
.addPackage(org.libreccm.configuration.Configuration.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.core.CcmCore.class.getPackage())
|
|
||||||
.addPackage(org.libreccm.jpa.EntityManagerProducer.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.jpa.utils.MimeTypeConverter.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.l10n.LocalizedString.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.security.Permission.class.getPackage())
|
|
||||||
.addPackage(org.libreccm.web.CcmApplication.class.getPackage())
|
|
||||||
.addPackage(org.libreccm.workflow.Workflow.class.getPackage())
|
|
||||||
.addPackage(com.arsdigita.bebop.Component.class.getPackage())
|
|
||||||
.addPackage(com.arsdigita.bebop.util.BebopConstants.class
|
|
||||||
.getPackage())
|
|
||||||
.addClass(com.arsdigita.kernel.KernelConfig.class)
|
|
||||||
.addClass(com.arsdigita.runtime.CCMResourceManager.class)
|
|
||||||
.addClass(com.arsdigita.dispatcher.RequestContext.class)
|
|
||||||
.addClass(com.arsdigita.dispatcher.AccessDeniedException.class)
|
|
||||||
.addClass(com.arsdigita.cms.dispatcher.ContentItemDispatcher.class)
|
|
||||||
.addClass(com.arsdigita.dispatcher.Dispatcher.class)
|
|
||||||
.addClass(
|
|
||||||
com.arsdigita.ui.admin.applications.AbstractAppInstanceForm.class)
|
|
||||||
.addClass(
|
|
||||||
com.arsdigita.ui.admin.applications.AbstractAppSettingsPane.class)
|
|
||||||
.addClass(
|
|
||||||
com.arsdigita.ui.admin.applications.DefaultApplicationInstanceForm.class)
|
|
||||||
.addClass(
|
|
||||||
com.arsdigita.ui.admin.applications.DefaultApplicationSettingsPane.class)
|
|
||||||
.addClass(org.librecms.dispatcher.ItemResolver.class)
|
|
||||||
.addPackage(com.arsdigita.util.Lockable.class.getPackage())
|
|
||||||
.addPackage(com.arsdigita.web.BaseServlet.class.getPackage())
|
|
||||||
.addPackage(org.librecms.Cms.class.getPackage())
|
|
||||||
.addPackage(org.librecms.contentsection.Asset.class.getPackage())
|
|
||||||
.addPackage(org.librecms.contentsection.AttachmentList.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.librecms.lifecycle.Lifecycle.class.getPackage())
|
|
||||||
.addPackage(org.librecms.contentsection.ContentSection.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.librecms.contenttypes.Article.class.getPackage())
|
|
||||||
.addPackage(org.libreccm.tests.categories.IntegrationTest.class
|
|
||||||
.getPackage())
|
|
||||||
.addClass(org.libreccm.imexport.Exportable.class)
|
|
||||||
// .addAsLibraries(getModuleDependencies())
|
|
||||||
.addAsLibraries(getCcmCoreDependencies())
|
.addAsLibraries(getCcmCoreDependencies())
|
||||||
.addAsResource("test-persistence.xml",
|
.addAsResource("test-persistence.xml",
|
||||||
"META-INF/persistence.xml")
|
"META-INF/persistence.xml")
|
||||||
|
|
@ -19,6 +19,8 @@ package org.librecms.contentsection;
|
||||||
|
|
||||||
import com.arsdigita.kernel.KernelConfig;
|
import com.arsdigita.kernel.KernelConfig;
|
||||||
|
|
||||||
|
import static org.libreccm.testutils.DependenciesHelpers.getCcmCoreDependencies;
|
||||||
|
|
||||||
import org.jboss.arquillian.container.test.api.Deployment;
|
import org.jboss.arquillian.container.test.api.Deployment;
|
||||||
import org.jboss.arquillian.junit.Arquillian;
|
import org.jboss.arquillian.junit.Arquillian;
|
||||||
import org.jboss.arquillian.junit.InSequence;
|
import org.jboss.arquillian.junit.InSequence;
|
||||||
|
|
@ -36,23 +38,16 @@ 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.categorization.CategoryRepository;
|
import org.libreccm.categorization.CategoryRepository;
|
||||||
import org.libreccm.configuration.ConfigurationManager;
|
import org.libreccm.configuration.ConfigurationManager;
|
||||||
import org.libreccm.security.Role;
|
import org.libreccm.security.Role;
|
||||||
import org.libreccm.security.RoleRepository;
|
import org.libreccm.security.RoleRepository;
|
||||||
import org.libreccm.tests.categories.IntegrationTest;
|
|
||||||
|
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
import static org.hamcrest.CoreMatchers.*;
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
import static org.libreccm.testutils.DependenciesHelpers.*;
|
|
||||||
|
|
||||||
import org.jboss.arquillian.container.test.api.ShouldThrowException;
|
import org.jboss.arquillian.container.test.api.ShouldThrowException;
|
||||||
import org.jboss.arquillian.persistence.CleanupUsingScript;
|
import org.jboss.arquillian.persistence.CleanupUsingScript;
|
||||||
import org.jboss.arquillian.persistence.TestExecutionPhase;
|
import org.jboss.arquillian.persistence.TestExecutionPhase;
|
||||||
|
|
@ -65,12 +60,16 @@ import org.librecms.contenttypes.News;
|
||||||
import org.librecms.lifecycle.LifecycleDefinition;
|
import org.librecms.lifecycle.LifecycleDefinition;
|
||||||
import org.librecms.lifecycle.LifecycleDefinitionRepository;
|
import org.librecms.lifecycle.LifecycleDefinitionRepository;
|
||||||
|
|
||||||
|
import static org.hamcrest.CoreMatchers.is;
|
||||||
|
import static org.hamcrest.CoreMatchers.not;
|
||||||
|
import static org.hamcrest.CoreMatchers.nullValue;
|
||||||
|
import static org.junit.Assert.assertThat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for the {@link ContentSectionManager}.
|
* Tests for the {@link ContentSectionManager}.
|
||||||
*
|
*
|
||||||
* @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)
|
|
||||||
@RunWith(Arquillian.class)
|
@RunWith(Arquillian.class)
|
||||||
@PersistenceTest
|
@PersistenceTest
|
||||||
@Transactional(TransactionMode.COMMIT)
|
@Transactional(TransactionMode.COMMIT)
|
||||||
|
|
@ -87,7 +86,7 @@ import org.librecms.lifecycle.LifecycleDefinitionRepository;
|
||||||
},
|
},
|
||||||
phase = TestExecutionPhase.BEFORE
|
phase = TestExecutionPhase.BEFORE
|
||||||
)
|
)
|
||||||
public class ContentSectionManagerTest {
|
public class ContentSectionManagerIT {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private ContentSectionRepository repository;
|
private ContentSectionRepository repository;
|
||||||
|
|
@ -113,7 +112,7 @@ public class ContentSectionManagerTest {
|
||||||
@Inject
|
@Inject
|
||||||
private WorkflowRepository workflowRepo;
|
private WorkflowRepository workflowRepo;
|
||||||
|
|
||||||
public ContentSectionManagerTest() {
|
public ContentSectionManagerIT() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
|
|
@ -137,55 +136,7 @@ public class ContentSectionManagerTest {
|
||||||
return ShrinkWrap
|
return ShrinkWrap
|
||||||
.create(WebArchive.class,
|
.create(WebArchive.class,
|
||||||
"LibreCCM-org.libreccm.cms.contentsection.ContentSectionManagerTest.war")
|
"LibreCCM-org.libreccm.cms.contentsection.ContentSectionManagerTest.war")
|
||||||
.addPackage(org.libreccm.auditing.CcmRevision.class.getPackage())
|
.addPackages(true, "com.arsdigita", "org.libreccm", "org.librecms")
|
||||||
.addPackage(org.libreccm.categorization.Categorization.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.cdi.utils.CdiUtil.class.getPackage())
|
|
||||||
.addPackage(org.libreccm.configuration.Configuration.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.core.CcmCore.class.getPackage())
|
|
||||||
.addPackage(org.libreccm.jpa.EntityManagerProducer.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.l10n.LocalizedString.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.jpa.utils.MimeTypeConverter.class.
|
|
||||||
getPackage())
|
|
||||||
.addPackage(org.libreccm.security.Permission.class.getPackage())
|
|
||||||
.addPackage(org.libreccm.web.CcmApplication.class.getPackage())
|
|
||||||
.addPackage(org.libreccm.workflow.Workflow.class.getPackage())
|
|
||||||
.addPackage(com.arsdigita.bebop.Component.class.getPackage())
|
|
||||||
.addPackage(com.arsdigita.bebop.util.BebopConstants.class
|
|
||||||
.getPackage())
|
|
||||||
.addClass(com.arsdigita.kernel.KernelConfig.class)
|
|
||||||
.addClass(com.arsdigita.runtime.CCMResourceManager.class)
|
|
||||||
.addClass(com.arsdigita.dispatcher.RequestContext.class)
|
|
||||||
.addClass(com.arsdigita.dispatcher.AccessDeniedException.class)
|
|
||||||
.addClass(com.arsdigita.cms.dispatcher.ContentItemDispatcher.class)
|
|
||||||
.addClass(com.arsdigita.dispatcher.Dispatcher.class)
|
|
||||||
.addClass(
|
|
||||||
com.arsdigita.ui.admin.applications.AbstractAppInstanceForm.class)
|
|
||||||
.addClass(
|
|
||||||
com.arsdigita.ui.admin.applications.AbstractAppSettingsPane.class)
|
|
||||||
.addClass(
|
|
||||||
com.arsdigita.ui.admin.applications.DefaultApplicationInstanceForm.class)
|
|
||||||
.addClass(
|
|
||||||
com.arsdigita.ui.admin.applications.DefaultApplicationSettingsPane.class)
|
|
||||||
.addClass(org.libreccm.modules.Module.class)
|
|
||||||
.addClass(org.libreccm.modules.RequiredModule.class)
|
|
||||||
.addClass(org.libreccm.imexport.Exportable.class)
|
|
||||||
.addPackage(org.librecms.dispatcher.ItemResolver.class.getPackage())
|
|
||||||
.addPackage(com.arsdigita.util.Lockable.class.getPackage())
|
|
||||||
.addPackage(com.arsdigita.web.BaseServlet.class.getPackage())
|
|
||||||
.addPackage(org.librecms.Cms.class.getPackage())
|
|
||||||
.addPackage(org.librecms.contentsection.Asset.class.getPackage())
|
|
||||||
.addPackage(org.librecms.contentsection.AttachmentList.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.librecms.lifecycle.Lifecycle.class.getPackage())
|
|
||||||
.addPackage(ContentSection.class.getPackage())
|
|
||||||
.addPackage(org.librecms.contenttypes.Article.class.getPackage())
|
|
||||||
.addPackage(org.libreccm.tests.categories.IntegrationTest.class
|
|
||||||
.getPackage())
|
|
||||||
//.addAsLibraries(getModuleDependencies())
|
|
||||||
.addAsLibraries(getCcmCoreDependencies())
|
.addAsLibraries(getCcmCoreDependencies())
|
||||||
.addAsResource("test-persistence.xml",
|
.addAsResource("test-persistence.xml",
|
||||||
"META-INF/persistence.xml")
|
"META-INF/persistence.xml")
|
||||||
|
|
@ -0,0 +1,399 @@
|
||||||
|
/*
|
||||||
|
* 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
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
|
* MA 02110-1301 USA
|
||||||
|
*/
|
||||||
|
package org.librecms.contentsection;
|
||||||
|
|
||||||
|
|
||||||
|
import static org.libreccm.testutils.DependenciesHelpers.getCcmCoreDependencies;
|
||||||
|
|
||||||
|
import org.apache.shiro.authz.UnauthorizedException;
|
||||||
|
import org.jboss.arquillian.container.test.api.Deployment;
|
||||||
|
import org.jboss.arquillian.container.test.api.ShouldThrowException;
|
||||||
|
import org.jboss.arquillian.junit.Arquillian;
|
||||||
|
import org.jboss.arquillian.junit.InSequence;
|
||||||
|
import org.jboss.arquillian.persistence.CreateSchema;
|
||||||
|
import org.jboss.arquillian.persistence.PersistenceTest;
|
||||||
|
import org.jboss.arquillian.persistence.ShouldMatchDataSet;
|
||||||
|
import org.jboss.arquillian.persistence.UsingDataSet;
|
||||||
|
import org.jboss.arquillian.transaction.api.annotation.TransactionMode;
|
||||||
|
import org.jboss.arquillian.transaction.api.annotation.Transactional;
|
||||||
|
import org.jboss.shrinkwrap.api.ShrinkWrap;
|
||||||
|
import org.jboss.shrinkwrap.api.spec.WebArchive;
|
||||||
|
import org.junit.After;
|
||||||
|
import org.junit.AfterClass;
|
||||||
|
import org.junit.Before;
|
||||||
|
import org.junit.BeforeClass;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.libreccm.security.Shiro;
|
||||||
|
import org.librecms.contenttypes.Article;
|
||||||
|
import org.librecms.contenttypes.News;
|
||||||
|
import org.librecms.contenttypes.Event;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import org.jboss.arquillian.persistence.CleanupUsingScript;
|
||||||
|
import org.jboss.arquillian.persistence.TestExecutionPhase;
|
||||||
|
|
||||||
|
import static org.hamcrest.CoreMatchers.equalTo;
|
||||||
|
import static org.hamcrest.CoreMatchers.is;
|
||||||
|
import static org.hamcrest.CoreMatchers.not;
|
||||||
|
import static org.hamcrest.CoreMatchers.nullValue;
|
||||||
|
import static org.junit.Assert.assertThat;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
@RunWith(Arquillian.class)
|
||||||
|
@PersistenceTest
|
||||||
|
@Transactional(TransactionMode.COMMIT)
|
||||||
|
@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 ContentTypeRepositoryIT {
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private ContentTypeRepository contentTypeRepo;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private ContentSectionRepository contentSectionRepo;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private Shiro shiro;
|
||||||
|
|
||||||
|
public ContentTypeRepositoryIT() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@BeforeClass
|
||||||
|
public static void setUpClass() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@AfterClass
|
||||||
|
public static void tearDownClass() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Before
|
||||||
|
public void setUp() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@After
|
||||||
|
public void tearDown() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Deployment
|
||||||
|
public static WebArchive createDeployment() {
|
||||||
|
return ShrinkWrap
|
||||||
|
.create(WebArchive.class,
|
||||||
|
"LibreCCM-org.librecms.contentsection.ContentTypeRepositoryTest.war")
|
||||||
|
.addPackages(true, "com.arsdigita", "org.libreccm", "org.librecms")
|
||||||
|
.addAsLibraries(getCcmCoreDependencies())
|
||||||
|
.addAsResource("test-persistence.xml",
|
||||||
|
"META-INF/persistence.xml")
|
||||||
|
.addAsWebInfResource("test-web.xml", "web.xml")
|
||||||
|
.addAsResource("configs/shiro.ini", "shiro.ini")
|
||||||
|
.addAsWebInfResource("META-INF/beans.xml", "beans.xml");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if all injected beans are available.
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
@InSequence(1)
|
||||||
|
public void checkInjection() {
|
||||||
|
assertThat(contentTypeRepo, is(not(nullValue())));
|
||||||
|
assertThat(contentSectionRepo, is(not(nullValue())));
|
||||||
|
assertThat(shiro, is(not(nullValue())));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if
|
||||||
|
* {@link ContentTypeRepository#findByContentSection(org.librecms.contentsection.ContentSection)}
|
||||||
|
* returns all content types of the given content section.
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
@InSequence(1100)
|
||||||
|
@UsingDataSet("datasets/org/librecms/contentsection/"
|
||||||
|
+ "ContentTypeRepositoryTest/data.xml")
|
||||||
|
public void findByContentSection() {
|
||||||
|
final ContentSection section = contentSectionRepo.findById(1001L).get();
|
||||||
|
final List<ContentType> types = contentTypeRepo.findByContentSection(
|
||||||
|
section);
|
||||||
|
|
||||||
|
assertThat(types, is(not(nullValue())));
|
||||||
|
assertThat(types.isEmpty(), is(false));
|
||||||
|
assertThat(types.size(), is(2));
|
||||||
|
|
||||||
|
assertThat(types.get(0).getContentItemClass(),
|
||||||
|
is(equalTo(Article.class.getName())));
|
||||||
|
assertThat(types.get(0).getContentSection().getDisplayName(),
|
||||||
|
is(equalTo("info")));
|
||||||
|
|
||||||
|
assertThat(types.get(1).getContentItemClass(),
|
||||||
|
is(equalTo(News.class.getName())));
|
||||||
|
assertThat(types.get(1).getContentSection().getDisplayName(),
|
||||||
|
is(equalTo("info")));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if
|
||||||
|
* {@link ContentTypeRepository#findByContentSection(org.librecms.contentsection.ContentSection)}
|
||||||
|
* throws all {@link IllegalArgumentException} if called with {@code null}
|
||||||
|
* for the content section.
|
||||||
|
*/
|
||||||
|
@Test(expected = IllegalArgumentException.class)
|
||||||
|
@InSequence(1110)
|
||||||
|
@UsingDataSet("datasets/org/librecms/contentsection/"
|
||||||
|
+ "ContentTypeRepositoryTest/data.xml")
|
||||||
|
@ShouldThrowException(IllegalArgumentException.class)
|
||||||
|
public void findByContentSectionNull() {
|
||||||
|
contentTypeRepo.findByContentSection(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if {@link ContentTypeRepository#findByContentSectionAndClass(org.librecms.contentsection.ContentSection, java.lang.Class)
|
||||||
|
* returns the expected values.
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
@InSequence(1200)
|
||||||
|
@UsingDataSet("datasets/org/librecms/contentsection/"
|
||||||
|
+ "ContentTypeRepositoryTest/data.xml")
|
||||||
|
public void findByContentSectionAndClass() {
|
||||||
|
final ContentSection section = contentSectionRepo.findById(1001L).get();
|
||||||
|
final Optional<ContentType> articleType = contentTypeRepo
|
||||||
|
.findByContentSectionAndClass(section, Article.class);
|
||||||
|
final Optional<ContentType> newsType = contentTypeRepo
|
||||||
|
.findByContentSectionAndClass(section, News.class);
|
||||||
|
final Optional<ContentType> eventType = contentTypeRepo
|
||||||
|
.findByContentSectionAndClass(section, Event.class);
|
||||||
|
|
||||||
|
assertThat(articleType.isPresent(), is(true));
|
||||||
|
assertThat(articleType.get().getContentItemClass(),
|
||||||
|
is(equalTo(Article.class.getName())));
|
||||||
|
assertThat(articleType.get().getContentSection().getDisplayName(),
|
||||||
|
is(equalTo("info")));
|
||||||
|
|
||||||
|
assertThat(newsType.isPresent(), is(true));
|
||||||
|
assertThat(newsType.get().getContentItemClass(),
|
||||||
|
is(equalTo(News.class.getName())));
|
||||||
|
assertThat(newsType.get().getContentSection().getDisplayName(),
|
||||||
|
is(equalTo("info")));
|
||||||
|
|
||||||
|
assertThat(eventType.isPresent(), is(false));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if
|
||||||
|
* {@link ContentTypeRepository#findByContentSectionAndClass(org.librecms.contentsection.ContentSection, java.lang.Class)}
|
||||||
|
* throws a {@link IllegalArgumentException} when called with {@code null}
|
||||||
|
* for the content section.
|
||||||
|
*/
|
||||||
|
@Test(expected = IllegalArgumentException.class)
|
||||||
|
@InSequence(1210)
|
||||||
|
@UsingDataSet("datasets/org/librecms/contentsection/"
|
||||||
|
+ "ContentTypeRepositoryTest/data.xml")
|
||||||
|
@ShouldThrowException(IllegalArgumentException.class)
|
||||||
|
public void findByContentSectionNullAndClass() {
|
||||||
|
|
||||||
|
contentTypeRepo.findByContentSectionAndClass(null, Article.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if
|
||||||
|
* {@link ContentTypeRepository#findByContentSectionAndClass(org.librecms.contentsection.ContentSection, java.lang.Class)}
|
||||||
|
* throws a {@link IllegalArgumentException} when called with {@code null}
|
||||||
|
* for the class.
|
||||||
|
*/
|
||||||
|
@Test(expected = IllegalArgumentException.class)
|
||||||
|
@InSequence(1220)
|
||||||
|
@UsingDataSet("datasets/org/librecms/contentsection/"
|
||||||
|
+ "ContentTypeRepositoryTest/data.xml")
|
||||||
|
@ShouldThrowException(IllegalArgumentException.class)
|
||||||
|
public void findByContentSectionAndClassNull() {
|
||||||
|
final ContentSection section = contentSectionRepo.findById(1001L).get();
|
||||||
|
final Class<? extends ContentItem> type = null;
|
||||||
|
contentTypeRepo.findByContentSectionAndClass(section, type);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if
|
||||||
|
* {@link ContentTypeRepository#findByContentSectionAndClass(org.librecms.contentsection.ContentSection, java.lang.String)}
|
||||||
|
* returns the expected values.
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
@InSequence(1300)
|
||||||
|
@UsingDataSet("datasets/org/librecms/contentsection/"
|
||||||
|
+ "ContentTypeRepositoryTest/data.xml")
|
||||||
|
public void findByContentSectionAndClassName() {
|
||||||
|
final ContentSection section = contentSectionRepo.findById(1001L).get();
|
||||||
|
final Optional<ContentType> articleType = contentTypeRepo
|
||||||
|
.findByContentSectionAndClass(section, Article.class.getName());
|
||||||
|
final Optional<ContentType> newsType = contentTypeRepo
|
||||||
|
.findByContentSectionAndClass(section, News.class.getName());
|
||||||
|
final Optional<ContentType> eventType = contentTypeRepo
|
||||||
|
.findByContentSectionAndClass(section, Event.class.getName());
|
||||||
|
|
||||||
|
assertThat(articleType.isPresent(), is(true));
|
||||||
|
assertThat(articleType.get().getContentItemClass(),
|
||||||
|
is(equalTo(Article.class.getName())));
|
||||||
|
assertThat(articleType.get().getContentSection().getDisplayName(),
|
||||||
|
is(equalTo("info")));
|
||||||
|
|
||||||
|
assertThat(newsType.isPresent(), is(true));
|
||||||
|
assertThat(newsType.get().getContentItemClass(),
|
||||||
|
is(equalTo(News.class.getName())));
|
||||||
|
assertThat(newsType.get().getContentSection().getDisplayName(),
|
||||||
|
is(equalTo("info")));
|
||||||
|
|
||||||
|
assertThat(eventType.isPresent(), is(false));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if
|
||||||
|
* {@link ContentTypeRepository#findByContentSectionAndClass(org.librecms.contentsection.ContentSection, java.lang.String) }
|
||||||
|
* throws a {@link IllegalArgumentException} when called with {@code null}
|
||||||
|
* for the content section.
|
||||||
|
*/
|
||||||
|
@Test(expected = IllegalArgumentException.class)
|
||||||
|
@InSequence(1210)
|
||||||
|
@UsingDataSet("datasets/org/librecms/contentsection/"
|
||||||
|
+ "ContentTypeRepositoryTest/data.xml")
|
||||||
|
@ShouldThrowException(IllegalArgumentException.class)
|
||||||
|
public void findByContentSectionNullAndClassName() {
|
||||||
|
|
||||||
|
contentTypeRepo.findByContentSectionAndClass(null, Article.class
|
||||||
|
.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if
|
||||||
|
* {@link ContentTypeRepository#findByContentSectionAndClass(org.librecms.contentsection.ContentSection, java.lang.String) }
|
||||||
|
* throws a {@link IllegalArgumentException} when called with {@code null}
|
||||||
|
* for the class.
|
||||||
|
*/
|
||||||
|
@Test(expected = IllegalArgumentException.class)
|
||||||
|
@InSequence(1220)
|
||||||
|
@UsingDataSet("datasets/org/librecms/contentsection/"
|
||||||
|
+ "ContentTypeRepositoryTest/data.xml")
|
||||||
|
@ShouldThrowException(IllegalArgumentException.class)
|
||||||
|
public void findByContentSectionAndClassNameNull() {
|
||||||
|
final ContentSection section = contentSectionRepo.findById(1001L).get();
|
||||||
|
final String type = null;
|
||||||
|
contentTypeRepo.findByContentSectionAndClass(section, type);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Verifies the return value of
|
||||||
|
* {@link ContentTypeRepository#isContentTypeInUse(org.librecms.contentsection.ContentType)}.
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
@InSequence(2000)
|
||||||
|
@UsingDataSet("datasets/org/librecms/contentsection/"
|
||||||
|
+ "ContentTypeRepositoryTest/data.xml")
|
||||||
|
public void verifyIsContentTypeInUse() {
|
||||||
|
final ContentSection section = contentSectionRepo.findById(1001L).get();
|
||||||
|
final Optional<ContentType> articleType = contentTypeRepo
|
||||||
|
.findByContentSectionAndClass(section, Article.class);
|
||||||
|
final Optional<ContentType> newsType = contentTypeRepo
|
||||||
|
.findByContentSectionAndClass(section, News.class);
|
||||||
|
|
||||||
|
assertThat(articleType.isPresent(), is(true));
|
||||||
|
assertThat(newsType.isPresent(), is(true));
|
||||||
|
|
||||||
|
assertThat(contentTypeRepo.isContentTypeInUse(articleType.get()),
|
||||||
|
is(true));
|
||||||
|
assertThat(contentTypeRepo.isContentTypeInUse(newsType.get()),
|
||||||
|
is(false));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Verifies that an unused content type can be deleted.
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
@InSequence(2000)
|
||||||
|
@UsingDataSet("datasets/org/librecms/contentsection/"
|
||||||
|
+ "ContentTypeRepositoryTest/data.xml")
|
||||||
|
@ShouldMatchDataSet("datasets/org/librecms/contentsection/"
|
||||||
|
+ "ContentTypeRepositoryTest/after-delete.xml")
|
||||||
|
public void deleteUnusedContentType() {
|
||||||
|
final ContentSection section = contentSectionRepo.findById(1001L).get();
|
||||||
|
final Optional<ContentType> newsType = contentTypeRepo
|
||||||
|
.findByContentSectionAndClass(section, News.class);
|
||||||
|
assertThat(newsType.isPresent(), is(true));
|
||||||
|
|
||||||
|
shiro.getSystemUser()
|
||||||
|
.execute(() -> contentTypeRepo.delete(newsType.get()));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Verifies that an unused content type can be deleted.
|
||||||
|
*/
|
||||||
|
@Test(expected = UnauthorizedException.class)
|
||||||
|
@InSequence(2000)
|
||||||
|
@UsingDataSet("datasets/org/librecms/contentsection/"
|
||||||
|
+ "ContentTypeRepositoryTest/data.xml")
|
||||||
|
@ShouldMatchDataSet("datasets/org/librecms/contentsection/"
|
||||||
|
+ "ContentTypeRepositoryTest/data.xml")
|
||||||
|
@ShouldThrowException(UnauthorizedException.class)
|
||||||
|
public void deleteUnusedContentTypeUnauthorized() {
|
||||||
|
|
||||||
|
final ContentSection section = contentSectionRepo.findById(1001L).get();
|
||||||
|
final Optional<ContentType> newsType = contentTypeRepo
|
||||||
|
.findByContentSectionAndClass(section, News.class);
|
||||||
|
assertThat(newsType.isPresent(), is(true));
|
||||||
|
|
||||||
|
contentTypeRepo.delete(newsType.get());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Verifies that content types which are in use can't be deleted.
|
||||||
|
*/
|
||||||
|
@Test(expected = IllegalArgumentException.class)
|
||||||
|
@InSequence(2200)
|
||||||
|
@UsingDataSet("datasets/org/librecms/contentsection/"
|
||||||
|
+ "ContentTypeRepositoryTest/data.xml")
|
||||||
|
@ShouldMatchDataSet("datasets/org/librecms/contentsection/"
|
||||||
|
+ "ContentTypeRepositoryTest/data.xml")
|
||||||
|
@ShouldThrowException(IllegalArgumentException.class)
|
||||||
|
public void deleteContentTypeInUse() {
|
||||||
|
final ContentSection section = contentSectionRepo.findById(1001L).get();
|
||||||
|
final Optional<ContentType> articleType = contentTypeRepo
|
||||||
|
.findByContentSectionAndClass(section, Article.class);
|
||||||
|
assertThat(articleType.isPresent(), is(true));
|
||||||
|
|
||||||
|
shiro.getSystemUser()
|
||||||
|
.execute(() -> contentTypeRepo.delete(articleType.get()));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,710 +0,0 @@
|
||||||
/*
|
|
||||||
* 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
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
|
||||||
* MA 02110-1301 USA
|
|
||||||
*/
|
|
||||||
package org.librecms.contentsection;
|
|
||||||
|
|
||||||
import static org.libreccm.testutils.DependenciesHelpers.*;
|
|
||||||
|
|
||||||
import org.apache.shiro.authz.UnauthorizedException;
|
|
||||||
import org.jboss.arquillian.container.test.api.Deployment;
|
|
||||||
import org.jboss.arquillian.container.test.api.ShouldThrowException;
|
|
||||||
import org.jboss.arquillian.junit.Arquillian;
|
|
||||||
import org.jboss.arquillian.junit.InSequence;
|
|
||||||
import org.jboss.arquillian.persistence.CreateSchema;
|
|
||||||
import org.jboss.arquillian.persistence.PersistenceTest;
|
|
||||||
import org.jboss.arquillian.persistence.ShouldMatchDataSet;
|
|
||||||
import org.jboss.arquillian.persistence.UsingDataSet;
|
|
||||||
import org.jboss.arquillian.transaction.api.annotation.TransactionMode;
|
|
||||||
import org.jboss.arquillian.transaction.api.annotation.Transactional;
|
|
||||||
import org.jboss.shrinkwrap.api.ShrinkWrap;
|
|
||||||
import org.jboss.shrinkwrap.api.spec.WebArchive;
|
|
||||||
import org.junit.After;
|
|
||||||
import org.junit.AfterClass;
|
|
||||||
import org.junit.Before;
|
|
||||||
import org.junit.BeforeClass;
|
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
import org.libreccm.security.Shiro;
|
|
||||||
import org.libreccm.tests.categories.IntegrationTest;
|
|
||||||
import org.librecms.contenttypes.Article;
|
|
||||||
import org.librecms.contenttypes.News;
|
|
||||||
import org.librecms.contenttypes.Event;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
|
|
||||||
import org.jboss.arquillian.persistence.CleanupUsingScript;
|
|
||||||
import org.jboss.arquillian.persistence.TestExecutionPhase;
|
|
||||||
|
|
||||||
import static org.hamcrest.CoreMatchers.*;
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
|
||||||
*/
|
|
||||||
@org.junit.experimental.categories.Category(IntegrationTest.class)
|
|
||||||
@RunWith(Arquillian.class)
|
|
||||||
@PersistenceTest
|
|
||||||
@Transactional(TransactionMode.COMMIT)
|
|
||||||
@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
|
|
||||||
private ContentTypeRepository contentTypeRepo;
|
|
||||||
|
|
||||||
@Inject
|
|
||||||
private ContentSectionRepository contentSectionRepo;
|
|
||||||
|
|
||||||
@Inject
|
|
||||||
private Shiro shiro;
|
|
||||||
|
|
||||||
public ContentTypeRepositoryTest() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@BeforeClass
|
|
||||||
public static void setUpClass() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@AfterClass
|
|
||||||
public static void tearDownClass() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Before
|
|
||||||
public void setUp() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@After
|
|
||||||
public void tearDown() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deployment
|
|
||||||
public static WebArchive createDeployment() {
|
|
||||||
return ShrinkWrap
|
|
||||||
.create(WebArchive.class,
|
|
||||||
"LibreCCM-org.librecms.contentsection.ContentTypeRepositoryTest.war")
|
|
||||||
.addClass(com.arsdigita.bebop.AbstractSingleSelectionModel.class)
|
|
||||||
.addClass(com.arsdigita.bebop.BaseLink.class)
|
|
||||||
.addClass(com.arsdigita.bebop.BasePage.class)
|
|
||||||
.addClass(com.arsdigita.bebop.BebopConfig.class)
|
|
||||||
.addClass(com.arsdigita.bebop.BoxPanel.class)
|
|
||||||
.addClass(com.arsdigita.bebop.ColumnPanel.class)
|
|
||||||
.addClass(com.arsdigita.bebop.Completable.class)
|
|
||||||
.addClass(com.arsdigita.bebop.Component.class)
|
|
||||||
.addClass(com.arsdigita.bebop.ConfirmPage.class)
|
|
||||||
.addClass(com.arsdigita.bebop.Container.class)
|
|
||||||
.addClass(com.arsdigita.bebop.ControlLink.class)
|
|
||||||
.addClass(com.arsdigita.bebop.DescriptiveComponent.class)
|
|
||||||
.addClass(com.arsdigita.bebop.ElementComponent.class)
|
|
||||||
.addClass(com.arsdigita.bebop.Form.class)
|
|
||||||
.addClass(com.arsdigita.bebop.FormData.class)
|
|
||||||
.addClass(com.arsdigita.bebop.FormModel.class)
|
|
||||||
.addClass(com.arsdigita.bebop.FormProcessException.class)
|
|
||||||
.addClass(com.arsdigita.bebop.FormSection.class)
|
|
||||||
.addClass(com.arsdigita.bebop.GridPanel.class)
|
|
||||||
.addClass(com.arsdigita.bebop.Label.class)
|
|
||||||
.addClass(com.arsdigita.bebop.Link.class)
|
|
||||||
.addClass(com.arsdigita.bebop.List.class)
|
|
||||||
.addClass(com.arsdigita.bebop.ListPanel.class)
|
|
||||||
.addClass(com.arsdigita.bebop.Page.class)
|
|
||||||
.addClass(com.arsdigita.bebop.PageErrorDisplay.class)
|
|
||||||
.addClass(com.arsdigita.bebop.PageFactory.class)
|
|
||||||
.addClass(com.arsdigita.bebop.PageState.class)
|
|
||||||
.addClass(com.arsdigita.bebop.ParameterSingleSelectionModel.class)
|
|
||||||
.addClass(com.arsdigita.bebop.RequestLocal.class)
|
|
||||||
.addClass(com.arsdigita.bebop.SaveCancelSection.class)
|
|
||||||
.addClass(com.arsdigita.bebop.SessionExpiredException.class)
|
|
||||||
.addClass(com.arsdigita.bebop.SimpleComponent.class)
|
|
||||||
.addClass(com.arsdigita.bebop.SimpleContainer.class)
|
|
||||||
.addClass(com.arsdigita.bebop.SingleSelectionModel.class)
|
|
||||||
.addClass(com.arsdigita.bebop.event.ActionEvent.class)
|
|
||||||
.addClass(com.arsdigita.bebop.event.ActionListener.class)
|
|
||||||
.addClass(com.arsdigita.bebop.event.ChangeEvent.class)
|
|
||||||
.addClass(com.arsdigita.bebop.event.ChangeListener.class)
|
|
||||||
.addClass(com.arsdigita.bebop.event.EventListenerList.class)
|
|
||||||
.addClass(com.arsdigita.bebop.event.FormCancelListener.class)
|
|
||||||
.addClass(com.arsdigita.bebop.event.FormInitListener.class)
|
|
||||||
.addClass(com.arsdigita.bebop.event.FormProcessListener.class)
|
|
||||||
.addClass(com.arsdigita.bebop.event.FormSectionEvent.class)
|
|
||||||
.addClass(com.arsdigita.bebop.event.FormSubmissionListener.class)
|
|
||||||
.addClass(com.arsdigita.bebop.event.FormValidationListener.class)
|
|
||||||
.addClass(com.arsdigita.bebop.event.PageEvent.class)
|
|
||||||
.addClass(com.arsdigita.bebop.event.ParameterEvent.class)
|
|
||||||
.addClass(com.arsdigita.bebop.event.ParameterListener.class)
|
|
||||||
.addClass(com.arsdigita.bebop.event.PrintEvent.class)
|
|
||||||
.addClass(com.arsdigita.bebop.event.PrintListener.class)
|
|
||||||
.addClass(com.arsdigita.bebop.event.RequestEvent.class)
|
|
||||||
.addClass(com.arsdigita.bebop.event.RequestListener.class)
|
|
||||||
.addClass(com.arsdigita.bebop.form.CheckboxGroup.class)
|
|
||||||
.addClass(com.arsdigita.bebop.form.Hidden.class)
|
|
||||||
.addClass(com.arsdigita.bebop.form.Option.class)
|
|
||||||
.addClass(com.arsdigita.bebop.form.OptionGroup.class)
|
|
||||||
.addClass(com.arsdigita.bebop.form.Password.class)
|
|
||||||
.addClass(com.arsdigita.bebop.form.Submit.class)
|
|
||||||
.addClass(com.arsdigita.bebop.form.TextArea.class)
|
|
||||||
.addClass(com.arsdigita.bebop.form.TextField.class)
|
|
||||||
.addClass(com.arsdigita.bebop.form.Widget.class)
|
|
||||||
.addClass(com.arsdigita.bebop.list.DefaultListCellRenderer.class)
|
|
||||||
.addClass(com.arsdigita.bebop.list.ListCellRenderer.class)
|
|
||||||
.addClass(com.arsdigita.bebop.list.ListModel.class)
|
|
||||||
.addClass(com.arsdigita.bebop.list.ListModelBuilder.class)
|
|
||||||
.addClass(com.arsdigita.bebop.page.BebopApplicationServlet.class)
|
|
||||||
.addClass(com.arsdigita.bebop.page.PageTransformer.class)
|
|
||||||
.addClass(com.arsdigita.bebop.parameters.ArrayParameter.class)
|
|
||||||
.addClass(com.arsdigita.bebop.parameters.BitSetParameter.class)
|
|
||||||
.addClass(com.arsdigita.bebop.parameters.EmailParameter.class)
|
|
||||||
.addClass(
|
|
||||||
com.arsdigita.bebop.parameters.GlobalizedParameterListener.class)
|
|
||||||
.addClass(
|
|
||||||
com.arsdigita.bebop.parameters.NotEmptyValidationListener.class)
|
|
||||||
.addClass(
|
|
||||||
com.arsdigita.bebop.parameters.NotNullValidationListener.class)
|
|
||||||
.addClass(com.arsdigita.bebop.parameters.ParameterData.class)
|
|
||||||
.addClass(com.arsdigita.bebop.parameters.ParameterModel.class)
|
|
||||||
.addClass(
|
|
||||||
com.arsdigita.bebop.parameters.StringLengthValidationListener.class)
|
|
||||||
.addClass(com.arsdigita.bebop.parameters.StringParameter.class)
|
|
||||||
.addClass(com.arsdigita.bebop.parameters.URLParameter.class)
|
|
||||||
.addClass(com.arsdigita.bebop.util.Attributes.class)
|
|
||||||
.addClass(com.arsdigita.bebop.util.BebopConstants.class)
|
|
||||||
.addClass(com.arsdigita.bebop.util.GlobalizationUtil.class)
|
|
||||||
.addClass(com.arsdigita.bebop.util.PanelConstraints.class)
|
|
||||||
.addClass(com.arsdigita.bebop.util.Traversal.class)
|
|
||||||
.addClass(com.arsdigita.dispatcher.AbortRequestSignal.class)
|
|
||||||
.addClass(com.arsdigita.dispatcher.DirectoryListingException.class)
|
|
||||||
.addClass(com.arsdigita.dispatcher.DispatcherConfig.class)
|
|
||||||
.addClass("com.arsdigita.dispatcher.DispatcherConstants")
|
|
||||||
.addClass(com.arsdigita.dispatcher.DispatcherHelper.class)
|
|
||||||
.addClass(com.arsdigita.dispatcher.InitialRequestContext.class)
|
|
||||||
.addClass(com.arsdigita.dispatcher.MultipartHttpServletRequest.class)
|
|
||||||
.addClass(com.arsdigita.dispatcher.RedirectException.class)
|
|
||||||
.addClass(com.arsdigita.dispatcher.RequestContext.class)
|
|
||||||
.addClass(com.arsdigita.globalization.Globalization.class)
|
|
||||||
.addClass(com.arsdigita.globalization.Globalized.class)
|
|
||||||
.addClass(com.arsdigita.globalization.GlobalizedMessage.class)
|
|
||||||
.addClass(com.arsdigita.kernel.KernelConfig.class)
|
|
||||||
.addClass(com.arsdigita.kernel.security.DefaultSecurityHelper.class)
|
|
||||||
.addClass(com.arsdigita.kernel.security.SecurityConfig.class)
|
|
||||||
.addClass(com.arsdigita.kernel.security.SecurityHelper.class)
|
|
||||||
.addClass(com.arsdigita.kernel.security.Util.class)
|
|
||||||
.addClass(com.arsdigita.mail.ByteArrayDataSource.class)
|
|
||||||
.addClass(com.arsdigita.mail.Mail.class)
|
|
||||||
.addClass(com.arsdigita.mail.MailConfig.class)
|
|
||||||
.addClass("com.arsdigita.mail.MimeMessage")
|
|
||||||
.addClass(com.arsdigita.templating.ApplicationPatternGenerator.class)
|
|
||||||
.addClass(com.arsdigita.templating.HostPatternGenerator.class)
|
|
||||||
.addClass(com.arsdigita.templating.LocalePatternGenerator.class)
|
|
||||||
.addClass("com.arsdigita.templating.LoggingErrorListener")
|
|
||||||
.addClass(com.arsdigita.templating.OutputTypePatternGenerator.class)
|
|
||||||
.addClass(com.arsdigita.templating.PatternGenerator.class)
|
|
||||||
.addClass(com.arsdigita.templating.PatternStylesheetResolver.class)
|
|
||||||
.addClass(com.arsdigita.templating.PrefixPatternGenerator.class)
|
|
||||||
.addClass(com.arsdigita.templating.PresentationManager.class)
|
|
||||||
.addClass("com.arsdigita.templating.SimpleURIResolver")
|
|
||||||
.addClass(com.arsdigita.templating.StylesheetResolver.class)
|
|
||||||
.addClass(com.arsdigita.templating.Templating.class)
|
|
||||||
.addClass(com.arsdigita.templating.TemplatingConfig.class)
|
|
||||||
.addClass(com.arsdigita.templating.URLPatternGenerator.class)
|
|
||||||
.addClass(com.arsdigita.templating.WebAppPatternGenerator.class)
|
|
||||||
.addClass(com.arsdigita.templating.WrappedTransformerException.class)
|
|
||||||
.addClass(com.arsdigita.templating.XSLParameterGenerator.class)
|
|
||||||
.addClass(com.arsdigita.templating.XSLTemplate.class)
|
|
||||||
.addClass(com.arsdigita.ui.SimplePage.class)
|
|
||||||
.addClass("com.arsdigita.ui.SimplePageLayout")
|
|
||||||
.addClass(com.arsdigita.ui.UI.class)
|
|
||||||
.addClass(com.arsdigita.ui.UIConfig.class)
|
|
||||||
.addClass(
|
|
||||||
com.arsdigita.ui.admin.applications.AbstractAppInstanceForm.class)
|
|
||||||
.addClass(
|
|
||||||
com.arsdigita.ui.admin.applications.AbstractAppSettingsPane.class)
|
|
||||||
.addClass(com.arsdigita.ui.login.ChangePasswordForm.class)
|
|
||||||
.addClass("com.arsdigita.ui.login.DynamicLink")
|
|
||||||
.addClass(com.arsdigita.ui.login.EmailInitListener.class)
|
|
||||||
.addClass(com.arsdigita.ui.login.LoginConstants.class)
|
|
||||||
.addClass(com.arsdigita.ui.login.LoginGlobalizationUtil.class)
|
|
||||||
.addClass(com.arsdigita.ui.login.LoginHelper.class)
|
|
||||||
.addClass(com.arsdigita.ui.login.LoginServlet.class)
|
|
||||||
.addClass(com.arsdigita.ui.login.PasswordValidationListener.class)
|
|
||||||
.addClass(com.arsdigita.ui.login.RecoverPasswordForm.class)
|
|
||||||
.addClass(com.arsdigita.ui.login.ResetPasswordForm.class)
|
|
||||||
.addClass(com.arsdigita.ui.login.ScreenNameInitListener.class)
|
|
||||||
.addClass(com.arsdigita.ui.login.UserAccountActivationForm.class)
|
|
||||||
.addClass(com.arsdigita.ui.login.UserAuthenticationListener.class)
|
|
||||||
.addClass(com.arsdigita.ui.login.UserEditForm.class)
|
|
||||||
.addClass(com.arsdigita.ui.login.UserForm.class)
|
|
||||||
.addClass(com.arsdigita.ui.login.UserInfo.class)
|
|
||||||
.addClass(com.arsdigita.ui.login.UserLoginForm.class)
|
|
||||||
.addClass(com.arsdigita.ui.login.UserLogoutListener.class)
|
|
||||||
.addClass(com.arsdigita.ui.login.UserNewForm.class)
|
|
||||||
.addClass(com.arsdigita.util.Assert.class)
|
|
||||||
.addClass(com.arsdigita.util.Classes.class)
|
|
||||||
.addClass(com.arsdigita.util.ExceptionUnwrapper.class)
|
|
||||||
.addClass(com.arsdigita.util.Exceptions.class)
|
|
||||||
.addClass(com.arsdigita.util.IO.class)
|
|
||||||
.addClass(com.arsdigita.util.Lockable.class)
|
|
||||||
.addClass(com.arsdigita.util.MessageType.class)
|
|
||||||
.addClass(com.arsdigita.util.OrderedMap.class)
|
|
||||||
.addClass("com.arsdigita.util.OrderingComparator")
|
|
||||||
.addClass(com.arsdigita.util.ParameterProvider.class)
|
|
||||||
.addClass(com.arsdigita.util.Record.class)
|
|
||||||
.addClass(com.arsdigita.util.StringUtils.class)
|
|
||||||
.addClass(com.arsdigita.util.SystemInformation.class)
|
|
||||||
.addClass(com.arsdigita.util.URLRewriter.class)
|
|
||||||
.addClass(com.arsdigita.util.UncheckedWrapperException.class)
|
|
||||||
.addClass(com.arsdigita.util.servlet.HttpHost.class)
|
|
||||||
.addClass(com.arsdigita.web.ApplicationFileResolver.class)
|
|
||||||
.addClass(com.arsdigita.web.BaseApplicationServlet.class)
|
|
||||||
.addClass(com.arsdigita.web.BaseServlet.class)
|
|
||||||
.addClass(com.arsdigita.web.CCMDispatcherServlet.class)
|
|
||||||
.addClass(com.arsdigita.web.Debugger.class)
|
|
||||||
.addClass(com.arsdigita.web.DefaultApplicationFileResolver.class)
|
|
||||||
.addClass(com.arsdigita.web.DynamicHostProvider.class)
|
|
||||||
.addClass("com.arsdigita.web.InternalRequestLocal")
|
|
||||||
.addClass(com.arsdigita.web.LoginSignal.class)
|
|
||||||
.addClass(com.arsdigita.web.ParameterListener.class)
|
|
||||||
.addClass(com.arsdigita.web.ParameterMap.class)
|
|
||||||
.addClass(com.arsdigita.web.RedirectSignal.class)
|
|
||||||
.addClass(com.arsdigita.web.ReturnSignal.class)
|
|
||||||
.addClass("com.arsdigita.web.TransactionSignal")
|
|
||||||
.addClass(com.arsdigita.web.TransformationDebugger.class)
|
|
||||||
.addClass(com.arsdigita.web.URL.class)
|
|
||||||
.addClass(com.arsdigita.web.Web.class)
|
|
||||||
.addClass(com.arsdigita.web.WebConfig.class)
|
|
||||||
.addClass(com.arsdigita.web.WebContext.class)
|
|
||||||
.addClass(com.arsdigita.xml.Document.class)
|
|
||||||
.addClass(com.arsdigita.xml.Element.class)
|
|
||||||
.addClass(com.arsdigita.bebop.Component.class)
|
|
||||||
.addClass(org.libreccm.categorization.Categorization.class)
|
|
||||||
.addClass(org.libreccm.categorization.Category.class)
|
|
||||||
.addClass(org.libreccm.categorization.Domain.class)
|
|
||||||
.addClass(org.libreccm.categorization.DomainOwnership.class)
|
|
||||||
.addClass(org.libreccm.cdi.utils.CdiUtil.class)
|
|
||||||
.addClass(org.libreccm.configuration.AbstractSetting.class)
|
|
||||||
.addClass(org.libreccm.configuration.BigDecimalSetting.class)
|
|
||||||
.addClass(org.libreccm.configuration.BooleanSetting.class)
|
|
||||||
.addClass(org.libreccm.configuration.Configuration.class)
|
|
||||||
.addClass(org.libreccm.configuration.ConfigurationException.class)
|
|
||||||
.addClass(org.libreccm.configuration.ConfigurationInfo.class)
|
|
||||||
.addClass(org.libreccm.configuration.ConfigurationManager.class)
|
|
||||||
.addClass(org.libreccm.configuration.DoubleSetting.class)
|
|
||||||
.addClass(org.libreccm.configuration.EnumSetting.class)
|
|
||||||
.addClass(org.libreccm.configuration.LocalizedStringSetting.class)
|
|
||||||
.addClass(org.libreccm.configuration.LongSetting.class)
|
|
||||||
.addClass(org.libreccm.configuration.Setting.class)
|
|
||||||
.addClass("org.libreccm.configuration.SettingConverter")
|
|
||||||
.addClass(org.libreccm.configuration.SettingInfo.class)
|
|
||||||
.addClass(org.libreccm.configuration.SettingManager.class)
|
|
||||||
.addClass(org.libreccm.configuration.StringListSetting.class)
|
|
||||||
.addClass(org.libreccm.configuration.StringSetting.class)
|
|
||||||
.addClass(org.libreccm.core.AbstractEntityRepository.class)
|
|
||||||
.addClass(org.libreccm.core.CcmObject.class)
|
|
||||||
.addClass(org.libreccm.core.CcmObjectRepository.class)
|
|
||||||
.addClass(org.libreccm.core.CoreConstants.class)
|
|
||||||
.addClass(org.libreccm.core.EmailAddress.class)
|
|
||||||
.addClass(org.libreccm.core.Identifiable.class)
|
|
||||||
.addClass(org.libreccm.core.Resource.class)
|
|
||||||
.addClass(org.libreccm.core.ResourceType.class)
|
|
||||||
.addClass(org.libreccm.core.UnexpectedErrorException.class)
|
|
||||||
.addClass(org.libreccm.imexport.Exportable.class)
|
|
||||||
.addClass(org.libreccm.jpa.EntityManagerProducer.class)
|
|
||||||
.addClass(org.libreccm.l10n.GlobalizationHelper.class)
|
|
||||||
.addClass(org.libreccm.l10n.GlobalizedMessagesUtil.class)
|
|
||||||
.addClass(org.libreccm.l10n.LocalizedTextsUtil.class)
|
|
||||||
.addClass(org.libreccm.l10n.LocalizedString.class)
|
|
||||||
.addClass(org.libreccm.modules.CcmModule.class)
|
|
||||||
.addClass(org.libreccm.modules.InitEvent.class)
|
|
||||||
.addClass(org.libreccm.modules.InstallEvent.class)
|
|
||||||
.addClass(org.libreccm.modules.Module.class)
|
|
||||||
.addClass(org.libreccm.modules.ModuleEvent.class)
|
|
||||||
.addClass(org.libreccm.modules.RequiredModule.class)
|
|
||||||
.addClass(org.libreccm.modules.ShutdownEvent.class)
|
|
||||||
.addClass(org.libreccm.modules.UnInstallEvent.class)
|
|
||||||
.addClass(org.libreccm.pagemodel.ComponentModel.class)
|
|
||||||
.addClass(org.libreccm.pagemodel.PageModel.class)
|
|
||||||
.addClass(org.libreccm.pagemodel.ContainerModel.class)
|
|
||||||
.addClass(org.libreccm.pagemodel.PageModelComponentModel.class)
|
|
||||||
.addClass(org.libreccm.pagemodel.PageModelVersion.class)
|
|
||||||
.addPackage(org.libreccm.pagemodel.styles.Styles.class.getPackage())
|
|
||||||
.addClass(org.libreccm.security.AuthorizationInterceptor.class)
|
|
||||||
.addClass(org.libreccm.security.AuthorizationRequired.class)
|
|
||||||
.addClass(org.libreccm.security.CcmShiroRealm.class)
|
|
||||||
.addClass("org.libreccm.security.CcmShiroRealmController")
|
|
||||||
.addClass(org.libreccm.security.ChallengeFailedException.class)
|
|
||||||
.addClass(org.libreccm.security.ChallengeManager.class)
|
|
||||||
.addClass(org.libreccm.security.EmailTemplates.class)
|
|
||||||
.addClass(org.libreccm.security.Group.class)
|
|
||||||
.addClass(org.libreccm.security.GroupManager.class)
|
|
||||||
.addClass(org.libreccm.security.GroupMembership.class)
|
|
||||||
.addClass(org.libreccm.security.GroupRepository.class)
|
|
||||||
.addClass(org.libreccm.security.OneTimeAuthConfig.class)
|
|
||||||
.addClass(org.libreccm.security.OneTimeAuthManager.class)
|
|
||||||
.addClass(org.libreccm.security.OneTimeAuthToken.class)
|
|
||||||
.addClass(org.libreccm.security.OneTimeAuthTokenPurpose.class)
|
|
||||||
.addClass(org.libreccm.security.Party.class)
|
|
||||||
.addClass(org.libreccm.security.Permission.class)
|
|
||||||
.addClass(org.libreccm.security.PermissionChecker.class)
|
|
||||||
.addClass(org.libreccm.security.PermissionManager.class)
|
|
||||||
.addClass(org.libreccm.security.PermissionRepository.class)
|
|
||||||
.addClass(org.libreccm.security.RecursivePermissions.class)
|
|
||||||
.addClass(org.libreccm.security.RegistrationManager.class)
|
|
||||||
.addClass(org.libreccm.security.Relation.class)
|
|
||||||
.addClass(org.libreccm.security.RequiresPrivilege.class)
|
|
||||||
.addClass(org.libreccm.security.RequiresRole.class)
|
|
||||||
.addClass(org.libreccm.security.Role.class)
|
|
||||||
.addClass(org.libreccm.security.RoleMembership.class)
|
|
||||||
.addClass(org.libreccm.security.RoleRepository.class)
|
|
||||||
.addClass("org.libreccm.security.SecuredHelper")
|
|
||||||
.addClass(org.libreccm.security.Shiro.class)
|
|
||||||
.addClass(org.libreccm.security.User.class)
|
|
||||||
.addClass(org.libreccm.security.UserManager.class)
|
|
||||||
.addClass(org.libreccm.security.UserRepository.class)
|
|
||||||
.addClass(org.libreccm.tests.categories.IntegrationTest.class)
|
|
||||||
.addClass(org.libreccm.testutils.DependenciesHelpers.class)
|
|
||||||
.addClass(org.libreccm.web.ApplicationCreateException.class)
|
|
||||||
.addClass(org.libreccm.web.ApplicationCreator.class)
|
|
||||||
.addClass(org.libreccm.web.ApplicationManager.class)
|
|
||||||
.addClass(org.libreccm.web.ApplicationRepository.class)
|
|
||||||
.addClass(org.libreccm.web.ApplicationType.class)
|
|
||||||
.addClass(org.libreccm.web.CcmApplication.class)
|
|
||||||
.addClass(org.libreccm.workflow.AssignableTask.class)
|
|
||||||
.addClass(org.libreccm.workflow.Task.class)
|
|
||||||
.addClass(org.libreccm.workflow.TaskAssignment.class)
|
|
||||||
.addClass(org.libreccm.workflow.TaskComment.class)
|
|
||||||
.addClass(org.libreccm.workflow.TaskDependency.class)
|
|
||||||
.addClass(org.libreccm.workflow.TaskState.class)
|
|
||||||
.addClass(org.libreccm.workflow.Workflow.class)
|
|
||||||
.addClass(org.libreccm.workflow.WorkflowState.class)
|
|
||||||
.addClass(org.libreccm.workflow.AbstractWorkflowException.class)
|
|
||||||
.addClass(org.librecms.CmsConstants.class)
|
|
||||||
.addClass(org.librecms.contentsection.Asset.class)
|
|
||||||
.addClass(org.librecms.contentsection.AttachmentList.class)
|
|
||||||
.addClass(org.librecms.contentsection.ContentItem.class)
|
|
||||||
.addClass(org.librecms.contentsection.ContentItemVersion.class)
|
|
||||||
.addClass(org.librecms.contentsection.ContentSection.class)
|
|
||||||
.addClass(org.librecms.contentsection.ContentSectionRepository.class)
|
|
||||||
.addClass(org.librecms.contentsection.ContentType.class)
|
|
||||||
.addClass(org.librecms.contentsection.ContentTypeMode.class)
|
|
||||||
.addClass(org.librecms.contentsection.ContentTypeRepository.class)
|
|
||||||
.addClass(org.librecms.contentsection.Folder.class)
|
|
||||||
.addClass(org.librecms.contentsection.FolderType.class)
|
|
||||||
.addClass(org.librecms.contentsection.ItemAttachment.class)
|
|
||||||
.addClass(org.librecms.contenttypes.Article.class)
|
|
||||||
.addClass(org.librecms.contenttypes.AuthoringKit.class)
|
|
||||||
.addClass(org.librecms.contenttypes.AuthoringStep.class)
|
|
||||||
.addClass(org.librecms.contenttypes.ContentTypeDescription.class)
|
|
||||||
.addClass(org.librecms.contenttypes.Event.class)
|
|
||||||
.addClass(org.librecms.contenttypes.News.class)
|
|
||||||
.addClass(org.librecms.lifecycle.Lifecycle.class)
|
|
||||||
.addClass(org.librecms.lifecycle.LifecycleDefinition.class)
|
|
||||||
.addClass(org.librecms.lifecycle.Phase.class)
|
|
||||||
.addClass(org.librecms.lifecycle.PhaseDefinition.class)
|
|
||||||
.addAsLibraries(getCcmCoreDependencies())
|
|
||||||
.addAsResource("test-persistence.xml",
|
|
||||||
"META-INF/persistence.xml")
|
|
||||||
.addAsWebInfResource("test-web.xml", "web.xml")
|
|
||||||
.addAsResource("configs/shiro.ini", "shiro.ini")
|
|
||||||
.addAsWebInfResource("META-INF/beans.xml", "beans.xml");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check if all injected beans are available.
|
|
||||||
*/
|
|
||||||
@Test
|
|
||||||
@InSequence(1)
|
|
||||||
public void checkInjection() {
|
|
||||||
assertThat(contentTypeRepo, is(not(nullValue())));
|
|
||||||
assertThat(contentSectionRepo, is(not(nullValue())));
|
|
||||||
assertThat(shiro, is(not(nullValue())));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if
|
|
||||||
* {@link ContentTypeRepository#findByContentSection(org.librecms.contentsection.ContentSection)}
|
|
||||||
* returns all content types of the given content section.
|
|
||||||
*/
|
|
||||||
@Test
|
|
||||||
@InSequence(1100)
|
|
||||||
@UsingDataSet("datasets/org/librecms/contentsection/"
|
|
||||||
+ "ContentTypeRepositoryTest/data.xml")
|
|
||||||
public void findByContentSection() {
|
|
||||||
final ContentSection section = contentSectionRepo.findById(1001L).get();
|
|
||||||
final List<ContentType> types = contentTypeRepo.findByContentSection(
|
|
||||||
section);
|
|
||||||
|
|
||||||
assertThat(types, is(not(nullValue())));
|
|
||||||
assertThat(types.isEmpty(), is(false));
|
|
||||||
assertThat(types.size(), is(2));
|
|
||||||
|
|
||||||
assertThat(types.get(0).getContentItemClass(),
|
|
||||||
is(equalTo(Article.class.getName())));
|
|
||||||
assertThat(types.get(0).getContentSection().getDisplayName(),
|
|
||||||
is(equalTo("info")));
|
|
||||||
|
|
||||||
assertThat(types.get(1).getContentItemClass(),
|
|
||||||
is(equalTo(News.class.getName())));
|
|
||||||
assertThat(types.get(1).getContentSection().getDisplayName(),
|
|
||||||
is(equalTo("info")));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if
|
|
||||||
* {@link ContentTypeRepository#findByContentSection(org.librecms.contentsection.ContentSection)}
|
|
||||||
* throws all {@link IllegalArgumentException} if called with {@code null}
|
|
||||||
* for the content section.
|
|
||||||
*/
|
|
||||||
@Test(expected = IllegalArgumentException.class)
|
|
||||||
@InSequence(1110)
|
|
||||||
@UsingDataSet("datasets/org/librecms/contentsection/"
|
|
||||||
+ "ContentTypeRepositoryTest/data.xml")
|
|
||||||
@ShouldThrowException(IllegalArgumentException.class)
|
|
||||||
public void findByContentSectionNull() {
|
|
||||||
contentTypeRepo.findByContentSection(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if {@link ContentTypeRepository#findByContentSectionAndClass(org.librecms.contentsection.ContentSection, java.lang.Class)
|
|
||||||
* returns the expected values.
|
|
||||||
*/
|
|
||||||
@Test
|
|
||||||
@InSequence(1200)
|
|
||||||
@UsingDataSet("datasets/org/librecms/contentsection/"
|
|
||||||
+ "ContentTypeRepositoryTest/data.xml")
|
|
||||||
public void findByContentSectionAndClass() {
|
|
||||||
final ContentSection section = contentSectionRepo.findById(1001L).get();
|
|
||||||
final Optional<ContentType> articleType = contentTypeRepo
|
|
||||||
.findByContentSectionAndClass(section, Article.class);
|
|
||||||
final Optional<ContentType> newsType = contentTypeRepo
|
|
||||||
.findByContentSectionAndClass(section, News.class);
|
|
||||||
final Optional<ContentType> eventType = contentTypeRepo
|
|
||||||
.findByContentSectionAndClass(section, Event.class);
|
|
||||||
|
|
||||||
assertThat(articleType.isPresent(), is(true));
|
|
||||||
assertThat(articleType.get().getContentItemClass(),
|
|
||||||
is(equalTo(Article.class.getName())));
|
|
||||||
assertThat(articleType.get().getContentSection().getDisplayName(),
|
|
||||||
is(equalTo("info")));
|
|
||||||
|
|
||||||
assertThat(newsType.isPresent(), is(true));
|
|
||||||
assertThat(newsType.get().getContentItemClass(),
|
|
||||||
is(equalTo(News.class.getName())));
|
|
||||||
assertThat(newsType.get().getContentSection().getDisplayName(),
|
|
||||||
is(equalTo("info")));
|
|
||||||
|
|
||||||
assertThat(eventType.isPresent(), is(false));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if
|
|
||||||
* {@link ContentTypeRepository#findByContentSectionAndClass(org.librecms.contentsection.ContentSection, java.lang.Class)}
|
|
||||||
* throws a {@link IllegalArgumentException} when called with {@code null}
|
|
||||||
* for the content section.
|
|
||||||
*/
|
|
||||||
@Test(expected = IllegalArgumentException.class)
|
|
||||||
@InSequence(1210)
|
|
||||||
@UsingDataSet("datasets/org/librecms/contentsection/"
|
|
||||||
+ "ContentTypeRepositoryTest/data.xml")
|
|
||||||
@ShouldThrowException(IllegalArgumentException.class)
|
|
||||||
public void findByContentSectionNullAndClass() {
|
|
||||||
|
|
||||||
contentTypeRepo.findByContentSectionAndClass(null, Article.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if
|
|
||||||
* {@link ContentTypeRepository#findByContentSectionAndClass(org.librecms.contentsection.ContentSection, java.lang.Class)}
|
|
||||||
* throws a {@link IllegalArgumentException} when called with {@code null}
|
|
||||||
* for the class.
|
|
||||||
*/
|
|
||||||
@Test(expected = IllegalArgumentException.class)
|
|
||||||
@InSequence(1220)
|
|
||||||
@UsingDataSet("datasets/org/librecms/contentsection/"
|
|
||||||
+ "ContentTypeRepositoryTest/data.xml")
|
|
||||||
@ShouldThrowException(IllegalArgumentException.class)
|
|
||||||
public void findByContentSectionAndClassNull() {
|
|
||||||
final ContentSection section = contentSectionRepo.findById(1001L).get();
|
|
||||||
final Class<? extends ContentItem> type = null;
|
|
||||||
contentTypeRepo.findByContentSectionAndClass(section, type);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if
|
|
||||||
* {@link ContentTypeRepository#findByContentSectionAndClass(org.librecms.contentsection.ContentSection, java.lang.String)}
|
|
||||||
* returns the expected values.
|
|
||||||
*/
|
|
||||||
@Test
|
|
||||||
@InSequence(1300)
|
|
||||||
@UsingDataSet("datasets/org/librecms/contentsection/"
|
|
||||||
+ "ContentTypeRepositoryTest/data.xml")
|
|
||||||
public void findByContentSectionAndClassName() {
|
|
||||||
final ContentSection section = contentSectionRepo.findById(1001L).get();
|
|
||||||
final Optional<ContentType> articleType = contentTypeRepo
|
|
||||||
.findByContentSectionAndClass(section, Article.class.getName());
|
|
||||||
final Optional<ContentType> newsType = contentTypeRepo
|
|
||||||
.findByContentSectionAndClass(section, News.class.getName());
|
|
||||||
final Optional<ContentType> eventType = contentTypeRepo
|
|
||||||
.findByContentSectionAndClass(section, Event.class.getName());
|
|
||||||
|
|
||||||
assertThat(articleType.isPresent(), is(true));
|
|
||||||
assertThat(articleType.get().getContentItemClass(),
|
|
||||||
is(equalTo(Article.class.getName())));
|
|
||||||
assertThat(articleType.get().getContentSection().getDisplayName(),
|
|
||||||
is(equalTo("info")));
|
|
||||||
|
|
||||||
assertThat(newsType.isPresent(), is(true));
|
|
||||||
assertThat(newsType.get().getContentItemClass(),
|
|
||||||
is(equalTo(News.class.getName())));
|
|
||||||
assertThat(newsType.get().getContentSection().getDisplayName(),
|
|
||||||
is(equalTo("info")));
|
|
||||||
|
|
||||||
assertThat(eventType.isPresent(), is(false));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if
|
|
||||||
* {@link ContentTypeRepository#findByContentSectionAndClass(org.librecms.contentsection.ContentSection, java.lang.String) }
|
|
||||||
* throws a {@link IllegalArgumentException} when called with {@code null}
|
|
||||||
* for the content section.
|
|
||||||
*/
|
|
||||||
@Test(expected = IllegalArgumentException.class)
|
|
||||||
@InSequence(1210)
|
|
||||||
@UsingDataSet("datasets/org/librecms/contentsection/"
|
|
||||||
+ "ContentTypeRepositoryTest/data.xml")
|
|
||||||
@ShouldThrowException(IllegalArgumentException.class)
|
|
||||||
public void findByContentSectionNullAndClassName() {
|
|
||||||
|
|
||||||
contentTypeRepo.findByContentSectionAndClass(null, Article.class
|
|
||||||
.getName());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if
|
|
||||||
* {@link ContentTypeRepository#findByContentSectionAndClass(org.librecms.contentsection.ContentSection, java.lang.String) }
|
|
||||||
* throws a {@link IllegalArgumentException} when called with {@code null}
|
|
||||||
* for the class.
|
|
||||||
*/
|
|
||||||
@Test(expected = IllegalArgumentException.class)
|
|
||||||
@InSequence(1220)
|
|
||||||
@UsingDataSet("datasets/org/librecms/contentsection/"
|
|
||||||
+ "ContentTypeRepositoryTest/data.xml")
|
|
||||||
@ShouldThrowException(IllegalArgumentException.class)
|
|
||||||
public void findByContentSectionAndClassNameNull() {
|
|
||||||
final ContentSection section = contentSectionRepo.findById(1001L).get();
|
|
||||||
final String type = null;
|
|
||||||
contentTypeRepo.findByContentSectionAndClass(section, type);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Verifies the return value of
|
|
||||||
* {@link ContentTypeRepository#isContentTypeInUse(org.librecms.contentsection.ContentType)}.
|
|
||||||
*/
|
|
||||||
@Test
|
|
||||||
@InSequence(2000)
|
|
||||||
@UsingDataSet("datasets/org/librecms/contentsection/"
|
|
||||||
+ "ContentTypeRepositoryTest/data.xml")
|
|
||||||
public void verifyIsContentTypeInUse() {
|
|
||||||
final ContentSection section = contentSectionRepo.findById(1001L).get();
|
|
||||||
final Optional<ContentType> articleType = contentTypeRepo
|
|
||||||
.findByContentSectionAndClass(section, Article.class);
|
|
||||||
final Optional<ContentType> newsType = contentTypeRepo
|
|
||||||
.findByContentSectionAndClass(section, News.class);
|
|
||||||
|
|
||||||
assertThat(articleType.isPresent(), is(true));
|
|
||||||
assertThat(newsType.isPresent(), is(true));
|
|
||||||
|
|
||||||
assertThat(contentTypeRepo.isContentTypeInUse(articleType.get()),
|
|
||||||
is(true));
|
|
||||||
assertThat(contentTypeRepo.isContentTypeInUse(newsType.get()),
|
|
||||||
is(false));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Verifies that an unused content type can be deleted.
|
|
||||||
*/
|
|
||||||
@Test
|
|
||||||
@InSequence(2000)
|
|
||||||
@UsingDataSet("datasets/org/librecms/contentsection/"
|
|
||||||
+ "ContentTypeRepositoryTest/data.xml")
|
|
||||||
@ShouldMatchDataSet("datasets/org/librecms/contentsection/"
|
|
||||||
+ "ContentTypeRepositoryTest/after-delete.xml")
|
|
||||||
public void deleteUnusedContentType() {
|
|
||||||
final ContentSection section = contentSectionRepo.findById(1001L).get();
|
|
||||||
final Optional<ContentType> newsType = contentTypeRepo
|
|
||||||
.findByContentSectionAndClass(section, News.class);
|
|
||||||
assertThat(newsType.isPresent(), is(true));
|
|
||||||
|
|
||||||
shiro.getSystemUser()
|
|
||||||
.execute(() -> contentTypeRepo.delete(newsType.get()));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Verifies that an unused content type can be deleted.
|
|
||||||
*/
|
|
||||||
@Test(expected = UnauthorizedException.class)
|
|
||||||
@InSequence(2000)
|
|
||||||
@UsingDataSet("datasets/org/librecms/contentsection/"
|
|
||||||
+ "ContentTypeRepositoryTest/data.xml")
|
|
||||||
@ShouldMatchDataSet("datasets/org/librecms/contentsection/"
|
|
||||||
+ "ContentTypeRepositoryTest/data.xml")
|
|
||||||
@ShouldThrowException(UnauthorizedException.class)
|
|
||||||
public void deleteUnusedContentTypeUnauthorized() {
|
|
||||||
|
|
||||||
final ContentSection section = contentSectionRepo.findById(1001L).get();
|
|
||||||
final Optional<ContentType> newsType = contentTypeRepo
|
|
||||||
.findByContentSectionAndClass(section, News.class);
|
|
||||||
assertThat(newsType.isPresent(), is(true));
|
|
||||||
|
|
||||||
contentTypeRepo.delete(newsType.get());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Verifies that content types which are in use can't be deleted.
|
|
||||||
*/
|
|
||||||
@Test(expected = IllegalArgumentException.class)
|
|
||||||
@InSequence(2200)
|
|
||||||
@UsingDataSet("datasets/org/librecms/contentsection/"
|
|
||||||
+ "ContentTypeRepositoryTest/data.xml")
|
|
||||||
@ShouldMatchDataSet("datasets/org/librecms/contentsection/"
|
|
||||||
+ "ContentTypeRepositoryTest/data.xml")
|
|
||||||
@ShouldThrowException(IllegalArgumentException.class)
|
|
||||||
public void deleteContentTypeInUse() {
|
|
||||||
final ContentSection section = contentSectionRepo.findById(1001L).get();
|
|
||||||
final Optional<ContentType> articleType = contentTypeRepo
|
|
||||||
.findByContentSectionAndClass(section, Article.class);
|
|
||||||
assertThat(articleType.isPresent(), is(true));
|
|
||||||
|
|
||||||
shiro.getSystemUser()
|
|
||||||
.execute(() -> contentTypeRepo.delete(articleType.get()));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -22,10 +22,8 @@ import org.junit.After;
|
||||||
import org.junit.AfterClass;
|
import org.junit.AfterClass;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
import org.junit.experimental.categories.Category;
|
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.junit.runners.Parameterized;
|
import org.junit.runners.Parameterized;
|
||||||
import org.libreccm.tests.categories.UnitTest;
|
|
||||||
import org.libreccm.testutils.DatasetType;
|
import org.libreccm.testutils.DatasetType;
|
||||||
import org.libreccm.testutils.DatasetsVerifier;
|
import org.libreccm.testutils.DatasetsVerifier;
|
||||||
|
|
||||||
|
|
@ -37,7 +35,6 @@ import java.util.Collection;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@RunWith(Parameterized.class)
|
@RunWith(Parameterized.class)
|
||||||
@Category(UnitTest.class)
|
|
||||||
public class DatasetsTest extends DatasetsVerifier {
|
public class DatasetsTest extends DatasetsVerifier {
|
||||||
|
|
||||||
@Parameterized.Parameters(name = "Dataset {0}")
|
@Parameterized.Parameters(name = "Dataset {0}")
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
*/
|
*/
|
||||||
package org.librecms.contentsection;
|
package org.librecms.contentsection;
|
||||||
|
|
||||||
import nl.jqno.equalsverifier.EqualsVerifierApi;
|
import nl.jqno.equalsverifier.api.SingleTypeEqualsVerifierApi;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.junit.runners.Parameterized;
|
import org.junit.runners.Parameterized;
|
||||||
import org.libreccm.categorization.Category;
|
import org.libreccm.categorization.Category;
|
||||||
|
|
@ -28,7 +28,6 @@ import org.libreccm.core.Resource;
|
||||||
import org.libreccm.security.Group;
|
import org.libreccm.security.Group;
|
||||||
import org.libreccm.security.Role;
|
import org.libreccm.security.Role;
|
||||||
import org.libreccm.security.User;
|
import org.libreccm.security.User;
|
||||||
import org.libreccm.tests.categories.UnitTest;
|
|
||||||
import org.libreccm.testutils.EqualsVerifier;
|
import org.libreccm.testutils.EqualsVerifier;
|
||||||
import org.libreccm.web.CcmApplication;
|
import org.libreccm.web.CcmApplication;
|
||||||
import org.libreccm.workflow.Workflow;
|
import org.libreccm.workflow.Workflow;
|
||||||
|
|
@ -42,7 +41,6 @@ import java.util.Collection;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@RunWith(Parameterized.class)
|
@RunWith(Parameterized.class)
|
||||||
@org.junit.experimental.categories.Category(UnitTest.class)
|
|
||||||
public class EqualsAndHashCodeTest extends EqualsVerifier {
|
public class EqualsAndHashCodeTest extends EqualsVerifier {
|
||||||
|
|
||||||
@Parameterized.Parameters(name = "{0}")
|
@Parameterized.Parameters(name = "{0}")
|
||||||
|
|
@ -59,7 +57,7 @@ public class EqualsAndHashCodeTest extends EqualsVerifier {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void addPrefabValues(final EqualsVerifierApi<?> verifier) {
|
protected void addPrefabValues(final SingleTypeEqualsVerifierApi<?> verifier) {
|
||||||
|
|
||||||
final ContentItem item1 = new ContentItem();
|
final ContentItem item1 = new ContentItem();
|
||||||
item1.setObjectId(-1100);
|
item1.setObjectId(-1100);
|
||||||
|
|
|
||||||
|
|
@ -38,25 +38,27 @@ 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 javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
import org.jboss.arquillian.persistence.CleanupUsingScript;
|
import org.jboss.arquillian.persistence.CleanupUsingScript;
|
||||||
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
import org.jboss.arquillian.persistence.TestExecutionPhase;
|
import org.jboss.arquillian.persistence.TestExecutionPhase;
|
||||||
|
|
||||||
import static org.hamcrest.CoreMatchers.*;
|
import static org.hamcrest.CoreMatchers.equalTo;
|
||||||
import static org.junit.Assert.*;
|
import static org.hamcrest.CoreMatchers.is;
|
||||||
|
import static org.hamcrest.CoreMatchers.not;
|
||||||
|
import static org.hamcrest.CoreMatchers.nullValue;
|
||||||
|
import static org.junit.Assert.assertThat;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @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)
|
|
||||||
@RunWith(Arquillian.class)
|
@RunWith(Arquillian.class)
|
||||||
@PersistenceTest
|
@PersistenceTest
|
||||||
@Transactional(TransactionMode.COMMIT)
|
@Transactional(TransactionMode.COMMIT)
|
||||||
|
|
@ -73,7 +75,7 @@ import static org.junit.Assert.*;
|
||||||
},
|
},
|
||||||
phase = TestExecutionPhase.BEFORE
|
phase = TestExecutionPhase.BEFORE
|
||||||
)
|
)
|
||||||
public class FolderManagerTest {
|
public class FolderManagerIT {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private FolderRepository folderRepo;
|
private FolderRepository folderRepo;
|
||||||
|
|
@ -81,7 +83,7 @@ public class FolderManagerTest {
|
||||||
@Inject
|
@Inject
|
||||||
private FolderManager folderManager;
|
private FolderManager folderManager;
|
||||||
|
|
||||||
public FolderManagerTest() {
|
public FolderManagerIT() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
|
|
@ -105,52 +107,7 @@ public class FolderManagerTest {
|
||||||
return ShrinkWrap
|
return ShrinkWrap
|
||||||
.create(WebArchive.class,
|
.create(WebArchive.class,
|
||||||
"LibreCCM-org.libreccm.cms.contentsection.ContentSectionManagerTest.war")
|
"LibreCCM-org.libreccm.cms.contentsection.ContentSectionManagerTest.war")
|
||||||
.addPackage(org.libreccm.auditing.CcmRevision.class.getPackage())
|
.addPackages(true, "com.arsdigita", "org.libreccm", "org.librecms")
|
||||||
.addPackage(org.libreccm.categorization.Categorization.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.cdi.utils.CdiUtil.class.getPackage())
|
|
||||||
.addPackage(org.libreccm.configuration.Configuration.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.core.CcmCore.class.getPackage())
|
|
||||||
.addPackage(org.libreccm.jpa.EntityManagerProducer.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.l10n.LocalizedString.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.jpa.utils.MimeTypeConverter.class.
|
|
||||||
getPackage())
|
|
||||||
.addPackage(org.libreccm.security.Permission.class.getPackage())
|
|
||||||
.addPackage(org.libreccm.web.CcmApplication.class.getPackage())
|
|
||||||
.addPackage(org.libreccm.workflow.Workflow.class.getPackage())
|
|
||||||
.addPackage(com.arsdigita.bebop.Component.class.getPackage())
|
|
||||||
.addPackage(com.arsdigita.bebop.util.BebopConstants.class
|
|
||||||
.getPackage())
|
|
||||||
.addClass(com.arsdigita.kernel.KernelConfig.class)
|
|
||||||
.addClass(com.arsdigita.runtime.CCMResourceManager.class)
|
|
||||||
.addClass(com.arsdigita.dispatcher.RequestContext.class)
|
|
||||||
.addClass(com.arsdigita.dispatcher.AccessDeniedException.class)
|
|
||||||
.addClass(com.arsdigita.cms.dispatcher.ContentItemDispatcher.class)
|
|
||||||
.addClass(com.arsdigita.dispatcher.Dispatcher.class)
|
|
||||||
.addClass(
|
|
||||||
com.arsdigita.ui.admin.applications.AbstractAppInstanceForm.class)
|
|
||||||
.addClass(
|
|
||||||
com.arsdigita.ui.admin.applications.AbstractAppSettingsPane.class)
|
|
||||||
.addClass(
|
|
||||||
com.arsdigita.ui.admin.applications.DefaultApplicationInstanceForm.class)
|
|
||||||
.addClass(
|
|
||||||
com.arsdigita.ui.admin.applications.DefaultApplicationSettingsPane.class)
|
|
||||||
.addClass(org.libreccm.imexport.Exportable.class)
|
|
||||||
.addPackage(org.librecms.dispatcher.ItemResolver.class.getPackage())
|
|
||||||
.addPackage(com.arsdigita.util.Lockable.class.getPackage())
|
|
||||||
.addPackage(com.arsdigita.web.BaseServlet.class.getPackage())
|
|
||||||
.addPackage(org.librecms.Cms.class.getPackage())
|
|
||||||
.addPackage(org.librecms.contentsection.Asset.class.getPackage())
|
|
||||||
.addPackage(org.librecms.contentsection.AttachmentList.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.librecms.lifecycle.Lifecycle.class.getPackage())
|
|
||||||
.addPackage(ContentSection.class.getPackage())
|
|
||||||
.addPackage(org.libreccm.tests.categories.IntegrationTest.class
|
|
||||||
.getPackage())
|
|
||||||
// .addAsLibraries(getModuleDependencies())
|
|
||||||
.addAsLibraries(getCcmCoreDependencies())
|
.addAsLibraries(getCcmCoreDependencies())
|
||||||
.addAsResource("test-persistence.xml",
|
.addAsResource("test-persistence.xml",
|
||||||
"META-INF/persistence.xml")
|
"META-INF/persistence.xml")
|
||||||
|
|
@ -38,28 +38,29 @@ import org.junit.BeforeClass;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.libreccm.security.Shiro;
|
import org.libreccm.security.Shiro;
|
||||||
import org.libreccm.tests.categories.IntegrationTest;
|
|
||||||
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
import javax.activation.MimeTypeParseException;
|
import javax.activation.MimeTypeParseException;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.persistence.EntityManager;
|
import javax.persistence.EntityManager;
|
||||||
|
|
||||||
import org.jboss.arquillian.persistence.CleanupUsingScript;
|
import org.jboss.arquillian.persistence.CleanupUsingScript;
|
||||||
import org.jboss.arquillian.persistence.TestExecutionPhase;
|
import org.jboss.arquillian.persistence.TestExecutionPhase;
|
||||||
|
|
||||||
import static org.hamcrest.CoreMatchers.*;
|
import static org.hamcrest.CoreMatchers.is;
|
||||||
import static org.junit.Assert.*;
|
import static org.hamcrest.CoreMatchers.not;
|
||||||
|
import static org.hamcrest.CoreMatchers.nullValue;
|
||||||
|
import static org.junit.Assert.assertThat;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for the {@link ItemAttachmentManager}.
|
* Tests for the {@link ItemAttachmentManager}.
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@org.junit.experimental.categories.Category(IntegrationTest.class)
|
|
||||||
@RunWith(Arquillian.class)
|
@RunWith(Arquillian.class)
|
||||||
@PersistenceTest
|
@PersistenceTest
|
||||||
//@Transactional(TransactionMode.COMMIT)
|
|
||||||
@CreateSchema(
|
@CreateSchema(
|
||||||
{
|
{
|
||||||
"001_create_schema.sql",
|
"001_create_schema.sql",
|
||||||
|
|
@ -73,7 +74,7 @@ import static org.junit.Assert.*;
|
||||||
},
|
},
|
||||||
phase = TestExecutionPhase.BEFORE
|
phase = TestExecutionPhase.BEFORE
|
||||||
)
|
)
|
||||||
public class ItemAttachmentManagerTest {
|
public class ItemAttachmentManagerIT {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private ContentItemRepository itemRepo;
|
private ContentItemRepository itemRepo;
|
||||||
|
|
@ -93,7 +94,7 @@ public class ItemAttachmentManagerTest {
|
||||||
@Inject
|
@Inject
|
||||||
private EntityManager entityManager;
|
private EntityManager entityManager;
|
||||||
|
|
||||||
public ItemAttachmentManagerTest() {
|
public ItemAttachmentManagerIT() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
|
|
@ -117,54 +118,7 @@ public class ItemAttachmentManagerTest {
|
||||||
return ShrinkWrap
|
return ShrinkWrap
|
||||||
.create(WebArchive.class,
|
.create(WebArchive.class,
|
||||||
"LibreCCM-org.librecms.assets.AssetManagerTest.war")
|
"LibreCCM-org.librecms.assets.AssetManagerTest.war")
|
||||||
.addPackage(org.libreccm.auditing.CcmRevision.class.getPackage()).
|
.addPackages(true, "com.arsdigita", "org.libreccm", "org.librecms")
|
||||||
addPackage(org.libreccm.categorization.Categorization.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.cdi.utils.CdiUtil.class.getPackage())
|
|
||||||
.addPackage(org.libreccm.configuration.Configuration.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.core.CcmCore.class.getPackage())
|
|
||||||
.addPackage(org.libreccm.jpa.EntityManagerProducer.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.jpa.utils.MimeTypeConverter.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.l10n.LocalizedString.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.security.Permission.class.getPackage())
|
|
||||||
.addPackage(org.libreccm.web.CcmApplication.class.getPackage())
|
|
||||||
.addPackage(org.libreccm.workflow.Workflow.class.getPackage())
|
|
||||||
.addPackage(com.arsdigita.bebop.Component.class.getPackage())
|
|
||||||
.addPackage(com.arsdigita.bebop.util.BebopConstants.class
|
|
||||||
.getPackage())
|
|
||||||
.addClass(com.arsdigita.kernel.KernelConfig.class)
|
|
||||||
.addClass(com.arsdigita.runtime.CCMResourceManager.class)
|
|
||||||
.addClass(com.arsdigita.dispatcher.RequestContext.class)
|
|
||||||
.addClass(com.arsdigita.dispatcher.AccessDeniedException.class)
|
|
||||||
.addClass(com.arsdigita.cms.dispatcher.ContentItemDispatcher.class)
|
|
||||||
.addClass(com.arsdigita.dispatcher.Dispatcher.class)
|
|
||||||
.addClass(
|
|
||||||
com.arsdigita.ui.admin.applications.AbstractAppInstanceForm.class)
|
|
||||||
.addClass(
|
|
||||||
com.arsdigita.ui.admin.applications.AbstractAppSettingsPane.class)
|
|
||||||
.addClass(
|
|
||||||
com.arsdigita.ui.admin.applications.DefaultApplicationInstanceForm.class)
|
|
||||||
.addClass(
|
|
||||||
com.arsdigita.ui.admin.applications.DefaultApplicationSettingsPane.class)
|
|
||||||
.addClass(org.librecms.dispatcher.ItemResolver.class)
|
|
||||||
.addClass(org.libreccm.imexport.Exportable.class)
|
|
||||||
.addPackage(com.arsdigita.util.Lockable.class.getPackage())
|
|
||||||
.addPackage(com.arsdigita.web.BaseServlet.class.getPackage())
|
|
||||||
.addPackage(org.librecms.Cms.class.getPackage())
|
|
||||||
.addPackage(org.librecms.assets.BinaryAsset.class.getPackage())
|
|
||||||
.addPackage(org.librecms.contentsection.Asset.class.getPackage()).
|
|
||||||
addPackage(org.librecms.lifecycle.Lifecycle.class.getPackage())
|
|
||||||
.addPackage(org.librecms.contentsection.ContentSection.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.librecms.contenttypes.Article.class.getPackage()).
|
|
||||||
addClass(com.arsdigita.kernel.security.SecurityConfig.class)
|
|
||||||
.addPackage(org.libreccm.tests.categories.IntegrationTest.class
|
|
||||||
.getPackage())
|
|
||||||
// .addAsLibraries(getModuleDependencies())
|
|
||||||
.addAsLibraries(getCcmCoreDependencies())
|
.addAsLibraries(getCcmCoreDependencies())
|
||||||
.addAsResource("configs/shiro.ini", "shiro.ini")
|
.addAsResource("configs/shiro.ini", "shiro.ini")
|
||||||
.addAsResource(
|
.addAsResource(
|
||||||
|
|
@ -18,14 +18,13 @@
|
||||||
*/
|
*/
|
||||||
package org.librecms.contenttypes;
|
package org.librecms.contenttypes;
|
||||||
|
|
||||||
import nl.jqno.equalsverifier.EqualsVerifierApi;
|
import nl.jqno.equalsverifier.api.SingleTypeEqualsVerifierApi;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.junit.runners.Parameterized;
|
import org.junit.runners.Parameterized;
|
||||||
import org.libreccm.tests.categories.UnitTest;
|
|
||||||
import org.libreccm.testutils.EqualsVerifier;
|
import org.libreccm.testutils.EqualsVerifier;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -33,7 +32,6 @@ import org.libreccm.testutils.EqualsVerifier;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@RunWith(Parameterized.class)
|
@RunWith(Parameterized.class)
|
||||||
@org.junit.experimental.categories.Category(UnitTest.class)
|
|
||||||
public class EqualsAndHashCodeTest extends EqualsVerifier {
|
public class EqualsAndHashCodeTest extends EqualsVerifier {
|
||||||
|
|
||||||
@Parameterized.Parameters(name = "{0}")
|
@Parameterized.Parameters(name = "{0}")
|
||||||
|
|
@ -50,7 +48,7 @@ public class EqualsAndHashCodeTest extends EqualsVerifier {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void addPrefabValues(final EqualsVerifierApi<?> verifier) {
|
protected void addPrefabValues(final SingleTypeEqualsVerifierApi<?> verifier) {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
drop schema if exists CCM_CMS;
|
drop schema if exists CCM_CMS CASCADE;
|
||||||
drop schema if exists CCM_CORE;
|
drop schema if exists CCM_CORE CASCADE;
|
||||||
|
|
||||||
drop sequence if exists HIBERNATE_SEQUENCE;
|
drop sequence if exists HIBERNATE_SEQUENCE;
|
||||||
|
|
||||||
|
|
||||||
create schema CCM_CMS;
|
create schema CCM_CMS;
|
||||||
|
|
||||||
create schema CCM_CORE;
|
create schema CCM_CORE;
|
||||||
|
|
@ -736,6 +736,7 @@
|
||||||
LISTENER varchar(1024),
|
LISTENER varchar(1024),
|
||||||
START_DATE_TIME date,
|
START_DATE_TIME date,
|
||||||
STARTED boolean,
|
STARTED boolean,
|
||||||
|
UUID varchar(255),
|
||||||
DEFINITION_ID bigint,
|
DEFINITION_ID bigint,
|
||||||
primary key (LIFECYCLE_ID)
|
primary key (LIFECYCLE_ID)
|
||||||
);
|
);
|
||||||
|
|
@ -743,6 +744,7 @@
|
||||||
create table CCM_CMS.LIFECYLE_DEFINITIONS (
|
create table CCM_CMS.LIFECYLE_DEFINITIONS (
|
||||||
LIFECYCLE_DEFINITION_ID bigint not null,
|
LIFECYCLE_DEFINITION_ID bigint not null,
|
||||||
DEFAULT_LISTENER varchar(1024),
|
DEFAULT_LISTENER varchar(1024),
|
||||||
|
UUID varchar(255),
|
||||||
primary key (LIFECYCLE_DEFINITION_ID)
|
primary key (LIFECYCLE_DEFINITION_ID)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -1040,6 +1042,12 @@
|
||||||
alter table CCM_CMS.CONTENT_SECTION_WORKFLOW_TEMPLATES
|
alter table CCM_CMS.CONTENT_SECTION_WORKFLOW_TEMPLATES
|
||||||
add constraint UK_goj42ghwu4tf1akfb2r6ensns unique (WORKFLOW_TEMPLATE_ID);
|
add constraint UK_goj42ghwu4tf1akfb2r6ensns unique (WORKFLOW_TEMPLATE_ID);
|
||||||
|
|
||||||
|
alter table CCM_CMS.LIFECYCLES
|
||||||
|
add constraint UK_40o4njo54m8c4xlwq6ctnsimd unique (UUID);
|
||||||
|
|
||||||
|
alter table CCM_CMS.LIFECYLE_DEFINITIONS
|
||||||
|
add constraint UK_n6ki3s5im2k2nccpocuctqqe3 unique (UUID);
|
||||||
|
|
||||||
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,
|
||||||
|
|
@ -1584,11 +1592,11 @@
|
||||||
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_LONG bigint,
|
|
||||||
SETTING_VALUE_BIG_DECIMAL decimal(19,2),
|
SETTING_VALUE_BIG_DECIMAL decimal(19,2),
|
||||||
SETTING_VALUE_DOUBLE double,
|
|
||||||
SETTING_VALUE_STRING varchar(1024),
|
|
||||||
SETTING_VALUE_BOOLEAN boolean,
|
SETTING_VALUE_BOOLEAN boolean,
|
||||||
|
SETTING_VALUE_LONG bigint,
|
||||||
|
SETTING_VALUE_STRING varchar(1024),
|
||||||
|
SETTING_VALUE_DOUBLE double,
|
||||||
primary key (SETTING_ID)
|
primary key (SETTING_ID)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -27,6 +27,10 @@
|
||||||
<property name="hibernate.id.new_generator_mappings" value="true"/>
|
<property name="hibernate.id.new_generator_mappings" value="true"/>
|
||||||
<property name="hibernate.connection.autocommit" value="false" />
|
<property name="hibernate.connection.autocommit" value="false" />
|
||||||
|
|
||||||
|
<property name="wildfly.jpa.hibernate.search.module"
|
||||||
|
value="org.hibernate.search.orm:main" />
|
||||||
|
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Properties for Hibernate Envers
|
Properties for Hibernate Envers
|
||||||
We are using the ValidityAuditStrategy here because it is faster
|
We are using the ValidityAuditStrategy here because it is faster
|
||||||
|
|
@ -736,6 +736,7 @@
|
||||||
LISTENER varchar(1024),
|
LISTENER varchar(1024),
|
||||||
START_DATE_TIME date,
|
START_DATE_TIME date,
|
||||||
STARTED boolean,
|
STARTED boolean,
|
||||||
|
UUID varchar(255),
|
||||||
DEFINITION_ID int8,
|
DEFINITION_ID int8,
|
||||||
primary key (LIFECYCLE_ID)
|
primary key (LIFECYCLE_ID)
|
||||||
);
|
);
|
||||||
|
|
@ -743,6 +744,7 @@
|
||||||
create table CCM_CMS.LIFECYLE_DEFINITIONS (
|
create table CCM_CMS.LIFECYLE_DEFINITIONS (
|
||||||
LIFECYCLE_DEFINITION_ID int8 not null,
|
LIFECYCLE_DEFINITION_ID int8 not null,
|
||||||
DEFAULT_LISTENER varchar(1024),
|
DEFAULT_LISTENER varchar(1024),
|
||||||
|
UUID varchar(255),
|
||||||
primary key (LIFECYCLE_DEFINITION_ID)
|
primary key (LIFECYCLE_DEFINITION_ID)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -1040,6 +1042,12 @@
|
||||||
alter table CCM_CMS.CONTENT_SECTION_WORKFLOW_TEMPLATES
|
alter table CCM_CMS.CONTENT_SECTION_WORKFLOW_TEMPLATES
|
||||||
add constraint UK_goj42ghwu4tf1akfb2r6ensns unique (WORKFLOW_TEMPLATE_ID);
|
add constraint UK_goj42ghwu4tf1akfb2r6ensns unique (WORKFLOW_TEMPLATE_ID);
|
||||||
|
|
||||||
|
alter table CCM_CMS.LIFECYCLES
|
||||||
|
add constraint UK_40o4njo54m8c4xlwq6ctnsimd unique (UUID);
|
||||||
|
|
||||||
|
alter table CCM_CMS.LIFECYLE_DEFINITIONS
|
||||||
|
add constraint UK_n6ki3s5im2k2nccpocuctqqe3 unique (UUID);
|
||||||
|
|
||||||
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,
|
||||||
|
|
@ -1584,11 +1592,11 @@
|
||||||
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_LONG int8,
|
|
||||||
SETTING_VALUE_BIG_DECIMAL numeric(19, 2),
|
SETTING_VALUE_BIG_DECIMAL numeric(19, 2),
|
||||||
SETTING_VALUE_DOUBLE float8,
|
|
||||||
SETTING_VALUE_STRING varchar(1024),
|
|
||||||
SETTING_VALUE_BOOLEAN boolean,
|
SETTING_VALUE_BOOLEAN boolean,
|
||||||
|
SETTING_VALUE_LONG int8,
|
||||||
|
SETTING_VALUE_STRING varchar(1024),
|
||||||
|
SETTING_VALUE_DOUBLE float8,
|
||||||
primary key (SETTING_ID)
|
primary key (SETTING_ID)
|
||||||
);
|
);
|
||||||
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue