Merge pull request 'replace-ccmsh-with-wildfly-maven-plugin' (#4) from replace-ccmsh-with-wildfly-maven-plugin into master
Reviewed-on: #4ccm-docs
commit
a9babd2ceb
|
|
@ -1,3 +1,4 @@
|
||||||
|
it-pgsql-datasources.properties
|
||||||
nb-configuration.xml
|
nb-configuration.xml
|
||||||
node
|
node
|
||||||
node_modules
|
node_modules
|
||||||
|
|
|
||||||
|
|
@ -1,26 +1,20 @@
|
||||||
pipeline {
|
pipeline {
|
||||||
agent any
|
agent any
|
||||||
tools {
|
tools {
|
||||||
maven 'apache-maven-3.6.0'
|
maven 'apache-maven-3.6.3'
|
||||||
}
|
}
|
||||||
stages {
|
stages {
|
||||||
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'
|
||||||
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'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
100
README.md
100
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,82 @@ 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.
|
||||||
|
|
||||||
|
## Archetypes
|
||||||
|
|
||||||
To install the archetypes in your local Maven repository run
|
To install the archetypes in your local Maven repository run
|
||||||
|
|
||||||
|
|
@ -64,15 +103,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
|
||||||
|
|
|
||||||
|
|
@ -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)
|
||||||
|
|
@ -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,209 +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>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.webjars</groupId>
|
|
||||||
<artifactId>requirejs</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.webjars</groupId>
|
|
||||||
<artifactId>requirejs-domready</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.webjars.npm</groupId>
|
|
||||||
<artifactId>tinymce</artifactId>
|
|
||||||
</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>v8.11.4</nodeVersion>
|
|
||||||
</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>
|
|
||||||
<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,199 +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 -->
|
|
||||||
<defaultLibBundleDir>lib</defaultLibBundleDir>
|
|
||||||
<outputFileNameMapping>no-version</outputFileNameMapping>
|
|
||||||
<modules>
|
|
||||||
<webModule>
|
|
||||||
<groupId>org.libreccm</groupId>
|
|
||||||
<artifactId>ccm-bundle-devel-wildfly-web</artifactId>
|
|
||||||
<contextRoot>/libreccm</contextRoot>
|
|
||||||
</webModule>
|
|
||||||
</modules>
|
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
</plugins>
|
<plugin>
|
||||||
</build>
|
<groupId>com.github.eirslett</groupId>
|
||||||
|
<artifactId>frontend-maven-plugin</artifactId>
|
||||||
|
|
||||||
<!-- Profiles for running the bundle in a development environment -->
|
<configuration>
|
||||||
<profiles>
|
<installDirectory>../node</installDirectory>
|
||||||
|
</configuration>
|
||||||
|
|
||||||
<!-- Profile which uses a H2 database. The DB file is put into the
|
<executions>
|
||||||
project build directory and therefore deleted when the clean phase
|
<execution>
|
||||||
runs.
|
<id>Install node.js and NPM</id>
|
||||||
-->
|
<goals>
|
||||||
<profile>
|
<goal>install-node-and-npm</goal>
|
||||||
<id>h2</id>
|
</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>
|
||||||
|
<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.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>
|
||||||
|
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
<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>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>
|
</configuration>
|
||||||
|
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</profile>
|
|
||||||
|
|
||||||
<!--
|
<profiles>
|
||||||
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>
|
<profile>
|
||||||
<id>pgsql</id>
|
<id>setup-runtime</id>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.postgresql</groupId>
|
<groupId>org.postgresql</groupId>
|
||||||
<artifactId>postgresql</artifactId>
|
<artifactId>postgresql</artifactId>
|
||||||
</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>
|
</configuration>
|
||||||
<users>
|
<executions>
|
||||||
<user>
|
<execution>
|
||||||
<username>admin</username>
|
<id>start-for-prepare</id>
|
||||||
<password>admin1234</password>
|
<goals>
|
||||||
</user>
|
<goal>start</goal>
|
||||||
</users>
|
</goals>
|
||||||
</add-user>
|
<phase>package</phase>
|
||||||
|
<configuration>
|
||||||
<beforeDeployment>
|
<stdout>System.out</stdout>
|
||||||
<commands>
|
</configuration>
|
||||||
<!--jdbc-drivers/postgresql-9.4.1208.jar-->
|
</execution>
|
||||||
<command>module add --name=org.postgres --resources=${project.build.directory}/${project.build.finalName}/lib/postgresql.jar --dependencies=javax.api,javax.transaction.api</command>
|
<execution>
|
||||||
<command>/subsystem=datasources/jdbc-driver=postgres:add(driver-name="postgres",driver-module-name="org.postgres",driver-class-name=org.postgresql.Driver)</command>
|
<id>deploy-jdbc-driver</id>
|
||||||
<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>
|
<configuration>
|
||||||
</commands>
|
<groupId>org.postgresql</groupId>
|
||||||
</beforeDeployment>
|
<artifactId>postgresql</artifactId>
|
||||||
|
<name>postgresql.jar</name>
|
||||||
<java-opts>
|
<force>true</force>
|
||||||
<java-opt>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8787</java-opt>
|
</configuration>
|
||||||
</java-opts>
|
<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>
|
</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 -->
|
</configuration>
|
||||||
<defaultLibBundleDir>lib</defaultLibBundleDir>
|
</plugin>
|
||||||
<fileNameMapping>no-version</fileNameMapping>
|
|
||||||
<modules>
|
<plugin>
|
||||||
<webModule>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-war-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<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-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>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
</plugins>
|
|
||||||
</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>
|
<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>true</skip>
|
||||||
|
|
||||||
<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>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</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
|
||||||
|
|
||||||
|
|
||||||
584
ccm-cms/pom.xml
584
ccm-cms/pom.xml
|
|
@ -353,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>
|
||||||
|
|
@ -547,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>
|
||||||
|
|
@ -579,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>
|
||||||
|
|
@ -630,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>
|
||||||
|
|
@ -662,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>
|
||||||
|
|
@ -670,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>
|
||||||
|
|
|
||||||
|
|
@ -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",
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
@ -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}")
|
||||||
|
|
|
||||||
|
|
@ -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(
|
||||||
|
|
@ -24,7 +24,6 @@ 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}")
|
||||||
|
|
|
||||||
|
|
@ -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}")
|
||||||
|
|
|
||||||
|
|
@ -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}")
|
||||||
|
|
|
||||||
|
|
@ -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(
|
||||||
|
|
@ -25,7 +25,6 @@ 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}")
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
608
ccm-core/pom.xml
608
ccm-core/pom.xml
|
|
@ -29,6 +29,24 @@
|
||||||
</licenses>
|
</licenses>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.seleniumhq.selenium</groupId>
|
||||||
|
<artifactId>selenium-java</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
<version>2.44.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.opera</groupId>
|
||||||
|
<artifactId>operadriver</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
<version>1.5</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.seleniumhq.selenium</groupId>
|
||||||
|
<artifactId>selenium-remote-driver</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax</groupId>
|
<groupId>javax</groupId>
|
||||||
<artifactId>javaee-api</artifactId>
|
<artifactId>javaee-api</artifactId>
|
||||||
|
|
@ -408,6 +426,14 @@
|
||||||
<configuration>
|
<configuration>
|
||||||
<trimStackTrace>false</trimStackTrace>
|
<trimStackTrace>false</trimStackTrace>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
<reportSets>
|
||||||
|
<reportSet>
|
||||||
|
<id>unit-tests</id>
|
||||||
|
<reports>
|
||||||
|
<report>report-only</report>
|
||||||
|
</reports>
|
||||||
|
</reportSet>
|
||||||
|
</reportSets>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
<plugin>
|
<plugin>
|
||||||
|
|
@ -561,7 +587,11 @@
|
||||||
</reporting>
|
</reporting>
|
||||||
|
|
||||||
<profiles>
|
<profiles>
|
||||||
<profile>
|
<!--
|
||||||
|
TomEE are temporaly disabled, TomEE support is scheduled for
|
||||||
|
version 7.1
|
||||||
|
-->
|
||||||
|
<!-- <profile>
|
||||||
<id>tomee-embedded</id>
|
<id>tomee-embedded</id>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
@ -605,7 +635,7 @@
|
||||||
<artifactId>jboss-logmanager</artifactId>
|
<artifactId>jboss-logmanager</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!--Required for WebServices and RESTful WebServices-->
|
Required for WebServices and RESTful WebServices
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.openejb</groupId>
|
<groupId>org.apache.openejb</groupId>
|
||||||
<artifactId>tomee-webservices</artifactId>
|
<artifactId>tomee-webservices</artifactId>
|
||||||
|
|
@ -672,10 +702,6 @@
|
||||||
<module.path>${project.basedir}/target/wildfly-8.2.0.Final/modules</module.path>
|
<module.path>${project.basedir}/target/wildfly-8.2.0.Final/modules</module.path>
|
||||||
</systemPropertyVariables>
|
</systemPropertyVariables>
|
||||||
<redirectTestOutputToFile>false</redirectTestOutputToFile>
|
<redirectTestOutputToFile>false</redirectTestOutputToFile>
|
||||||
<groups>
|
|
||||||
org.libreccm.tests.categories.UnitTest,
|
|
||||||
org.libreccm.tests.categories.IntegrationTest
|
|
||||||
</groups>
|
|
||||||
<additionalClasspathElements>
|
<additionalClasspathElements>
|
||||||
<additionalClasspathElement>${project.build.directory}/generated-resources</additionalClasspathElement>
|
<additionalClasspathElement>${project.build.directory}/generated-resources</additionalClasspathElement>
|
||||||
</additionalClasspathElements>
|
</additionalClasspathElements>
|
||||||
|
|
@ -749,192 +775,21 @@
|
||||||
<tomee.version>1.7.2</tomee.version>
|
<tomee.version>1.7.2</tomee.version>
|
||||||
</systemPropertyVariables>
|
</systemPropertyVariables>
|
||||||
<redirectTestOutputToFile>false</redirectTestOutputToFile>
|
<redirectTestOutputToFile>false</redirectTestOutputToFile>
|
||||||
<groups>
|
|
||||||
org.libreccm.tests.categories.UnitTest,
|
|
||||||
org.libreccm.tests.categories.IntegrationTest
|
|
||||||
</groups>
|
|
||||||
<trimStackTrace>false</trimStackTrace>
|
<trimStackTrace>false</trimStackTrace>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</profile>
|
</profile>-->
|
||||||
|
|
||||||
<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>
|
|
||||||
<systemPropertyVariables>
|
|
||||||
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
|
|
||||||
</systemPropertyVariables>
|
|
||||||
<redirectTestOutputToFile>false</redirectTestOutputToFile>
|
|
||||||
<groups>
|
|
||||||
org.libreccm.tests.categories.UnitTest,
|
|
||||||
org.libreccm.tests.categories.IntegrationTest
|
|
||||||
</groups>
|
|
||||||
<trimStackTrace>false</trimStackTrace>
|
|
||||||
</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>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>
|
|
||||||
<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>
|
|
||||||
<groups>
|
|
||||||
org.libreccm.tests.categories.UnitTest,
|
|
||||||
org.libreccm.tests.categories.IntegrationTest
|
|
||||||
</groups>
|
|
||||||
<trimStackTrace>false</trimStackTrace>
|
|
||||||
</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>
|
||||||
|
|
@ -947,7 +802,7 @@
|
||||||
<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>
|
||||||
|
|
@ -979,7 +834,15 @@
|
||||||
</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>
|
||||||
|
|
@ -988,34 +851,97 @@
|
||||||
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
|
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
|
||||||
</systemPropertyVariables>
|
</systemPropertyVariables>
|
||||||
<redirectTestOutputToFile>false</redirectTestOutputToFile>
|
<redirectTestOutputToFile>false</redirectTestOutputToFile>
|
||||||
<groups>
|
|
||||||
org.libreccm.tests.categories.UnitTest,
|
|
||||||
org.libreccm.tests.categories.IntegrationTest
|
|
||||||
</groups>
|
|
||||||
<trimStackTrace>false</trimStackTrace>
|
<trimStackTrace>false</trimStackTrace>
|
||||||
</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-core-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/libreccm/ccm-core/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>
|
<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>
|
||||||
|
|
@ -1024,7 +950,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>
|
||||||
|
|
@ -1056,7 +982,189 @@
|
||||||
</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-core-testdb-pgsql</address>
|
||||||
|
<force>true</force>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<properties>
|
||||||
|
<connection-url>${it.ccm-core.datasource.connectionUrl}</connection-url>
|
||||||
|
<jndi-name>java:/comp/env/jdbc/org/libreccm/ccm-core/pgsql</jndi-name>
|
||||||
|
<enabled>true</enabled>
|
||||||
|
<user-name>${it.ccm-core.datasource.username}</user-name>
|
||||||
|
<password>${it.ccm-core.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>
|
<configuration>
|
||||||
<forkMode>always</forkMode>
|
<forkMode>always</forkMode>
|
||||||
<forkCount>999</forkCount>
|
<forkCount>999</forkCount>
|
||||||
|
|
@ -1065,15 +1173,121 @@
|
||||||
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
|
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
|
||||||
</systemPropertyVariables>
|
</systemPropertyVariables>
|
||||||
<redirectTestOutputToFile>false</redirectTestOutputToFile>
|
<redirectTestOutputToFile>false</redirectTestOutputToFile>
|
||||||
<groups>
|
|
||||||
org.libreccm.tests.categories.UnitTest,
|
|
||||||
org.libreccm.tests.categories.IntegrationTest
|
|
||||||
</groups>
|
|
||||||
<trimStackTrace>false</trimStackTrace>
|
<trimStackTrace>false</trimStackTrace>
|
||||||
</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>
|
||||||
|
<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>
|
||||||
|
<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>
|
||||||
|
</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>
|
||||||
|
|
||||||
</profiles>
|
</profiles>
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,6 @@ import com.arsdigita.bebop.tree.TreeNode;
|
||||||
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;
|
||||||
import org.libreccm.l10n.GlobalizationHelper;
|
|
||||||
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
|
||||||
|
|
@ -24,8 +24,8 @@ import org.libreccm.configuration.ConfigurationManager;
|
||||||
import org.libreccm.core.UnexpectedErrorException;
|
import org.libreccm.core.UnexpectedErrorException;
|
||||||
|
|
||||||
import javax.enterprise.inject.Instance;
|
import javax.enterprise.inject.Instance;
|
||||||
import javax.faces.bean.RequestScoped;
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.io.Reader;
|
import java.io.Reader;
|
||||||
|
|
@ -33,6 +33,8 @@ import java.io.Writer;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class provides access to the (local) file system. If available an
|
* This class provides access to the (local) file system. If available an
|
||||||
* implementation of the {@link FileSystemAdapter} interface is used. The
|
* implementation of the {@link FileSystemAdapter} interface is used. The
|
||||||
|
|
|
||||||
|
|
@ -18,10 +18,8 @@
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.kernel;
|
package com.arsdigita.kernel;
|
||||||
|
|
||||||
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.EqualsVerifier;
|
import org.libreccm.testutils.EqualsVerifier;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
@ -33,7 +31,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 EqualsAndHashCodeTest extends EqualsVerifier {
|
public class EqualsAndHashCodeTest extends EqualsVerifier {
|
||||||
@Parameterized.Parameters(name = "{0}")
|
@Parameterized.Parameters(name = "{0}")
|
||||||
public static Collection<Class<?>> data() {
|
public static Collection<Class<?>> data() {
|
||||||
|
|
|
||||||
|
|
@ -18,10 +18,8 @@
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.kernel;
|
package com.arsdigita.kernel;
|
||||||
|
|
||||||
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.ToStringVerifier;
|
import org.libreccm.testutils.ToStringVerifier;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
@ -32,7 +30,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 ToStringTest extends ToStringVerifier {
|
public class ToStringTest extends ToStringVerifier {
|
||||||
|
|
||||||
@Parameterized.Parameters(name = "{0}")
|
@Parameterized.Parameters(name = "{0}")
|
||||||
|
|
|
||||||
|
|
@ -1,154 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2015 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 com.arsdigita.kernel.security;
|
|
||||||
|
|
||||||
import com.arsdigita.util.JavaPropertyReader;
|
|
||||||
import com.arsdigita.util.parameter.AbstractParameter;
|
|
||||||
import com.arsdigita.web.CCMApplicationContextListener;
|
|
||||||
import com.arsdigita.xml.XML;
|
|
||||||
import com.arsdigita.xml.formatters.DateFormatter;
|
|
||||||
|
|
||||||
import static org.hamcrest.Matchers.*;
|
|
||||||
|
|
||||||
import org.jboss.arquillian.container.test.api.Deployment;
|
|
||||||
import org.jboss.arquillian.junit.Arquillian;
|
|
||||||
import org.jboss.shrinkwrap.api.ShrinkWrap;
|
|
||||||
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
|
|
||||||
import org.jboss.shrinkwrap.api.spec.WebArchive;
|
|
||||||
import org.junit.After;
|
|
||||||
import org.junit.AfterClass;
|
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
import static org.libreccm.testutils.DependenciesHelpers.*;
|
|
||||||
|
|
||||||
import org.junit.Before;
|
|
||||||
import org.junit.BeforeClass;
|
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
import org.libreccm.categorization.Categorization;
|
|
||||||
import org.libreccm.core.CcmObject;
|
|
||||||
import org.libreccm.jpa.EntityManagerProducer;
|
|
||||||
import org.libreccm.jpa.utils.UriConverter;
|
|
||||||
import org.libreccm.l10n.LocalizedString;
|
|
||||||
import org.libreccm.security.PermissionChecker;
|
|
||||||
import org.libreccm.tests.categories.IntegrationTest;
|
|
||||||
import org.libreccm.web.ApplicationRepository;
|
|
||||||
import org.libreccm.workflow.Workflow;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
|
||||||
*/
|
|
||||||
@RunWith(Arquillian.class)
|
|
||||||
//@Category(IntegrationTest.class)
|
|
||||||
public class SecurityConfigTest {
|
|
||||||
|
|
||||||
public SecurityConfigTest() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@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-com.arsdigita.kernel.security.SecurityConfigTest.war")
|
|
||||||
.addPackage(CcmObject.class.getPackage())
|
|
||||||
.addPackage(Categorization.class.getPackage())
|
|
||||||
.addPackage(PermissionChecker.class.getPackage())
|
|
||||||
.addPackage(LocalizedString.class.getPackage())
|
|
||||||
.addPackage(Workflow.class.getPackage())
|
|
||||||
.addPackage(UriConverter.class.getPackage())
|
|
||||||
.addPackage(ApplicationRepository.class.getPackage())
|
|
||||||
.addPackage(EntityManagerProducer.class.getPackage())
|
|
||||||
.addPackage(SecurityConfig.class.getPackage())
|
|
||||||
.addPackage(AbstractParameter.class.getPackage())
|
|
||||||
.addPackage(JavaPropertyReader.class.getPackage())
|
|
||||||
.addPackage(CCMApplicationContextListener.class.getPackage())
|
|
||||||
.addPackage(XML.class.getPackage())
|
|
||||||
.addPackage(DateFormatter.class.getPackage())
|
|
||||||
.addPackage(IntegrationTest.class.getPackage())
|
|
||||||
.addAsLibraries(getModuleDependencies())
|
|
||||||
.addAsResource(
|
|
||||||
"configs/com/arsdigita/kernel/security/SecurityConfigTest/ccm-core.config",
|
|
||||||
"ccm-core.config")
|
|
||||||
.addAsWebInfResource(
|
|
||||||
"configs/com/arsdigita/kernel/security/SecurityConfigTest/registry.properties",
|
|
||||||
"conf/registry/registry.properties")
|
|
||||||
.addAsWebInfResource(
|
|
||||||
"configs/com/arsdigita/kernel/security/SecurityConfigTest/kernel.properties",
|
|
||||||
"conf/registry/ccm-core/kernel.properties")
|
|
||||||
.addAsWebInfResource(
|
|
||||||
"configs/com/arsdigita/kernel/security/SecurityConfigTest/security.properties",
|
|
||||||
"conf/registry/ccm-core/security.properties")
|
|
||||||
.addAsResource(
|
|
||||||
"com/arsdigita/kernel/KernelConfig_parameter.properties",
|
|
||||||
"com/arsdigita/kernel/KernelConfig_parameter.properties")
|
|
||||||
.addAsResource(
|
|
||||||
"com/arsdigita/kernel/security/SecurityConfig_parameter.properties",
|
|
||||||
"com/arsdigita/kernel/security/SecurityConfig_parameter.properties")
|
|
||||||
.addAsResource("test-persistence.xml",
|
|
||||||
"META-INF/persistence.xml")
|
|
||||||
.addAsWebInfResource("test-web.xml", "WEB-INF/web.xml")
|
|
||||||
.addAsResource("configs/shiro.ini", "shiro.ini")
|
|
||||||
.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void verifySecurityConfig() {
|
|
||||||
final SecurityConfig securityConfig = SecurityConfig.getConfig();
|
|
||||||
|
|
||||||
final List<String> excludedExtensions = securityConfig
|
|
||||||
.getExcludedExtensions();
|
|
||||||
assertThat(excludedExtensions.size(), is(4));
|
|
||||||
assertThat(excludedExtensions.get(0), is(equalTo(".jpg")));
|
|
||||||
assertThat(excludedExtensions.get(1), is(equalTo(".gif")));
|
|
||||||
assertThat(excludedExtensions.get(2), is(equalTo(".png")));
|
|
||||||
assertThat(excludedExtensions.get(3), is(equalTo(".pdf")));
|
|
||||||
|
|
||||||
assertThat(securityConfig.isAutoRegistrationEnabled(), is(false));
|
|
||||||
|
|
||||||
assertThat(securityConfig.isPasswordRecoveryEnabled(), is(true));
|
|
||||||
|
|
||||||
assertThat(securityConfig.getHashAlgorithm(), is(equalTo("SHA-512")));
|
|
||||||
|
|
||||||
assertThat(securityConfig.getSaltLength(), is(256));
|
|
||||||
|
|
||||||
assertThat(securityConfig.getHashIterations(), is(50000));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -23,17 +23,14 @@ 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.libreccm.tests.categories.UnitTest;
|
|
||||||
|
|
||||||
import static org.hamcrest.Matchers.*;
|
import static org.hamcrest.Matchers.is;
|
||||||
import static org.junit.Assert.*;
|
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(UnitTest.class)
|
|
||||||
public class AssertTest {
|
public class AssertTest {
|
||||||
|
|
||||||
public AssertTest() {
|
public AssertTest() {
|
||||||
|
|
|
||||||
|
|
@ -21,24 +21,26 @@ package com.arsdigita.util;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static junit.framework.TestCase.assertEquals;
|
import static junit.framework.TestCase.assertEquals;
|
||||||
import static junit.framework.TestCase.assertTrue;
|
import static junit.framework.TestCase.assertTrue;
|
||||||
|
|
||||||
import org.junit.After;
|
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.Test;
|
import org.junit.Test;
|
||||||
import org.junit.experimental.categories.Category;
|
|
||||||
import org.libreccm.tests.categories.UnitTest;
|
|
||||||
|
|
||||||
import static org.hamcrest.Matchers.*;
|
import static org.hamcrest.Matchers.equalTo;
|
||||||
import static org.junit.Assert.*;
|
import static org.hamcrest.Matchers.is;
|
||||||
|
import static org.junit.Assert.assertFalse;
|
||||||
|
import static org.junit.Assert.assertThat;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Konermann
|
* @author Konermann
|
||||||
*/
|
*/
|
||||||
@Category(UnitTest.class)
|
|
||||||
public class StringUtilsTest {
|
public class StringUtilsTest {
|
||||||
|
|
||||||
public StringUtilsTest() {
|
public StringUtilsTest() {
|
||||||
|
|
|
||||||
|
|
@ -23,19 +23,17 @@ 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.libreccm.tests.categories.UnitTest;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import static org.hamcrest.Matchers.*;
|
import static org.hamcrest.MatcherAssert.assertThat;
|
||||||
import static org.junit.Assert.*;
|
import static org.hamcrest.Matchers.equalTo;
|
||||||
|
import static org.hamcrest.Matchers.is;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Category(UnitTest.class)
|
|
||||||
public class WebConfigTest {
|
public class WebConfigTest {
|
||||||
|
|
||||||
public WebConfigTest() {
|
public WebConfigTest() {
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,6 @@ import org.junit.runner.RunWith;
|
||||||
import org.libreccm.core.CcmObject;
|
import org.libreccm.core.CcmObject;
|
||||||
import org.libreccm.core.CcmObjectRepository;
|
import org.libreccm.core.CcmObjectRepository;
|
||||||
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.Map;
|
import java.util.Map;
|
||||||
|
|
@ -66,7 +65,6 @@ import org.jboss.arquillian.persistence.TestExecutionPhase;
|
||||||
*
|
*
|
||||||
* @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 +73,7 @@ import org.jboss.arquillian.persistence.TestExecutionPhase;
|
||||||
"003_init_hibernate_sequence.sql"})
|
"003_init_hibernate_sequence.sql"})
|
||||||
@CleanupUsingScript(value = {"999_cleanup.sql"},
|
@CleanupUsingScript(value = {"999_cleanup.sql"},
|
||||||
phase = TestExecutionPhase.BEFORE)
|
phase = TestExecutionPhase.BEFORE)
|
||||||
public class CategoryManagerTest {
|
public class CategoryManagerIT {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private CategoryRepository categoryRepo;
|
private CategoryRepository categoryRepo;
|
||||||
|
|
@ -101,7 +99,7 @@ public class CategoryManagerTest {
|
||||||
@PersistenceContext(name = "LibreCCM")
|
@PersistenceContext(name = "LibreCCM")
|
||||||
private EntityManager entityManager;
|
private EntityManager entityManager;
|
||||||
|
|
||||||
public CategoryManagerTest() {
|
public CategoryManagerIT() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
|
|
@ -124,29 +122,9 @@ public class CategoryManagerTest {
|
||||||
public static WebArchive createDeployment() {
|
public static WebArchive createDeployment() {
|
||||||
return ShrinkWrap
|
return ShrinkWrap
|
||||||
.create(WebArchive.class,
|
.create(WebArchive.class,
|
||||||
"LibreCCM-org.libreccm.categorization.CategoryManagerTest.war")
|
"LibreCCM-org.libreccm.categorization.CategoryManagerTest.war"
|
||||||
.addPackage(org.libreccm.categorization.Categorization.class
|
)
|
||||||
.getPackage())
|
.addPackages(true, "com.arsdigita", "org.libreccm")
|
||||||
.addPackage(org.libreccm.configuration.Configuration.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.core.CcmObject.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.PermissionChecker.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.testutils.EqualsVerifier.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.tests.categories.IntegrationTest.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.web.CcmApplication.class.getPackage())
|
|
||||||
.addPackage(org.libreccm.workflow.Workflow.class.getPackage())
|
|
||||||
.addPackage(org.libreccm.cdi.utils.CdiUtil.class.getPackage())
|
|
||||||
.addClass(org.libreccm.imexport.Exportable.class)
|
|
||||||
.addClass(com.arsdigita.kernel.KernelConfig.class)
|
|
||||||
.addClass(com.arsdigita.kernel.security.SecurityConfig.class)
|
|
||||||
.addAsLibraries(getModuleDependencies())
|
.addAsLibraries(getModuleDependencies())
|
||||||
.addAsResource("configs/shiro.ini", "shiro.ini")
|
.addAsResource("configs/shiro.ini", "shiro.ini")
|
||||||
.addAsResource("test-persistence.xml",
|
.addAsResource("test-persistence.xml",
|
||||||
|
|
@ -397,8 +375,7 @@ public class CategoryManagerTest {
|
||||||
@UsingDataSet("datasets/org/libreccm/categorization/CategoryManagerTest"
|
@UsingDataSet("datasets/org/libreccm/categorization/CategoryManagerTest"
|
||||||
+ "/data.yml")
|
+ "/data.yml")
|
||||||
@ShouldMatchDataSet(
|
@ShouldMatchDataSet(
|
||||||
excludeColumns = {
|
excludeColumns = {},
|
||||||
},
|
|
||||||
value = "datasets/org/libreccm/categorization/CategoryManagerTest"
|
value = "datasets/org/libreccm/categorization/CategoryManagerTest"
|
||||||
+ "/after-remove-obj-from-category.yml"
|
+ "/after-remove-obj-from-category.yml"
|
||||||
)
|
)
|
||||||
|
|
@ -751,7 +728,7 @@ public class CategoryManagerTest {
|
||||||
/**
|
/**
|
||||||
* Tries to retrieve the index object from several categories and verifies
|
* Tries to retrieve the index object from several categories and verifies
|
||||||
* that the expected object is returned by null null null null null null
|
* that the expected object is returned by null null null null null null
|
||||||
* null null {@link CategoryManager#getIndexObject(org.libreccm.categorization.Category).
|
* null null null null null {@link CategoryManager#getIndexObject(org.libreccm.categorization.Category).
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
@UsingDataSet(
|
@UsingDataSet(
|
||||||
|
|
@ -45,7 +45,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 static org.hamcrest.Matchers.*;
|
import static org.hamcrest.Matchers.*;
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
|
|
@ -55,13 +54,13 @@ import static org.libreccm.testutils.DependenciesHelpers.*;
|
||||||
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;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @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)
|
||||||
|
|
@ -70,7 +69,7 @@ import org.jboss.arquillian.persistence.TestExecutionPhase;
|
||||||
"003_init_hibernate_sequence.sql"})
|
"003_init_hibernate_sequence.sql"})
|
||||||
@CleanupUsingScript(value = {"999_cleanup.sql"},
|
@CleanupUsingScript(value = {"999_cleanup.sql"},
|
||||||
phase = TestExecutionPhase.BEFORE)
|
phase = TestExecutionPhase.BEFORE)
|
||||||
public class CategoryRepositoryTest {
|
public class CategoryRepositoryIT {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private CategoryRepository categoryRepo;
|
private CategoryRepository categoryRepo;
|
||||||
|
|
@ -87,7 +86,7 @@ public class CategoryRepositoryTest {
|
||||||
@PersistenceContext(name = "LibreCCM")
|
@PersistenceContext(name = "LibreCCM")
|
||||||
private EntityManager entityManager;
|
private EntityManager entityManager;
|
||||||
|
|
||||||
public CategoryRepositoryTest() {
|
public CategoryRepositoryIT() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
|
|
@ -109,30 +108,11 @@ public class CategoryRepositoryTest {
|
||||||
@Deployment
|
@Deployment
|
||||||
public static WebArchive createDeployment() {
|
public static WebArchive createDeployment() {
|
||||||
return ShrinkWrap
|
return ShrinkWrap
|
||||||
.create(WebArchive.class,
|
.create(
|
||||||
"LibreCCM-org.libreccm.categorization.CategoryRepositoryTest.war")
|
WebArchive.class,
|
||||||
.addPackage(org.libreccm.categorization.Categorization.class
|
"LibreCCM-org.libreccm.categorization.CategoryRepositoryTest.war"
|
||||||
.getPackage())
|
)
|
||||||
.addPackage(org.libreccm.configuration.Configuration.class
|
.addPackages(true, "com.arsdigita", "org.libreccm")
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.core.CcmObject.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.PermissionChecker.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.testutils.EqualsVerifier.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.tests.categories.IntegrationTest.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.web.CcmApplication.class.getPackage())
|
|
||||||
.addPackage(org.libreccm.workflow.Workflow.class.getPackage())
|
|
||||||
.addPackage(org.libreccm.cdi.utils.CdiUtil.class.getPackage())
|
|
||||||
.addClass(com.arsdigita.kernel.KernelConfig.class)
|
|
||||||
.addClass(com.arsdigita.kernel.security.SecurityConfig.class)
|
|
||||||
.addClass(org.libreccm.imexport.Exportable.class)
|
|
||||||
.addAsLibraries(getModuleDependencies())
|
.addAsLibraries(getModuleDependencies())
|
||||||
.addAsResource("configs/shiro.ini", "shiro.ini")
|
.addAsResource("configs/shiro.ini", "shiro.ini")
|
||||||
.addAsResource("test-persistence.xml",
|
.addAsResource("test-persistence.xml",
|
||||||
|
|
@ -20,9 +20,9 @@ package org.libreccm.categorization;
|
||||||
|
|
||||||
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.DatasetType;
|
import org.libreccm.testutils.DatasetType;
|
||||||
import org.libreccm.testutils.DatasetsVerifier;
|
import org.libreccm.testutils.DatasetsVerifier;
|
||||||
|
|
||||||
|
|
@ -34,7 +34,6 @@ import static org.libreccm.testutils.DatasetType.*;
|
||||||
* @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 DatasetsTest extends DatasetsVerifier {
|
public class DatasetsTest extends DatasetsVerifier {
|
||||||
|
|
||||||
@Parameterized.Parameters(name = "Dataset {0}")
|
@Parameterized.Parameters(name = "Dataset {0}")
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,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 org.libreccm.web.CcmApplication;
|
import org.libreccm.web.CcmApplication;
|
||||||
|
|
||||||
|
|
@ -37,7 +36,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}")
|
||||||
|
|
|
||||||
|
|
@ -20,10 +20,8 @@ package org.libreccm.categorization;
|
||||||
|
|
||||||
import static org.libreccm.testutils.DatasetType.*;
|
import static org.libreccm.testutils.DatasetType.*;
|
||||||
|
|
||||||
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;
|
||||||
|
|
||||||
|
|
@ -35,7 +33,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 RegistrySetupDatasetsTest extends DatasetsVerifier {
|
public class RegistrySetupDatasetsTest extends DatasetsVerifier {
|
||||||
|
|
||||||
@Parameterized.Parameters(name = "Dataset {0}")
|
@Parameterized.Parameters(name = "Dataset {0}")
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@ package org.libreccm.categorization;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.junit.runners.Parameterized;
|
import org.junit.runners.Parameterized;
|
||||||
import org.libreccm.testutils.ToStringVerifier;
|
import org.libreccm.testutils.ToStringVerifier;
|
||||||
import org.libreccm.tests.categories.UnitTest;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
@ -31,7 +30,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 ToStringTest extends ToStringVerifier {
|
public class ToStringTest extends ToStringVerifier {
|
||||||
|
|
||||||
@Parameterized.Parameters(name = "{0}")
|
@Parameterized.Parameters(name = "{0}")
|
||||||
|
|
|
||||||
|
|
@ -40,10 +40,8 @@ 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.security.Shiro;
|
import org.libreccm.security.Shiro;
|
||||||
import org.libreccm.tests.categories.IntegrationTest;
|
|
||||||
|
|
||||||
import static org.hamcrest.Matchers.*;
|
import static org.hamcrest.Matchers.*;
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
|
|
@ -58,7 +56,6 @@ import org.jboss.arquillian.persistence.TestExecutionPhase;
|
||||||
*
|
*
|
||||||
* @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)
|
||||||
|
|
@ -67,7 +64,7 @@ import org.jboss.arquillian.persistence.TestExecutionPhase;
|
||||||
"003_init_hibernate_sequence.sql"})
|
"003_init_hibernate_sequence.sql"})
|
||||||
@CleanupUsingScript(value = {"999_cleanup.sql"},
|
@CleanupUsingScript(value = {"999_cleanup.sql"},
|
||||||
phase = TestExecutionPhase.BEFORE)
|
phase = TestExecutionPhase.BEFORE)
|
||||||
public class ConfigurationManagerTest {
|
public class ConfigurationManagerIT {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private ConfigurationManager configurationManager;
|
private ConfigurationManager configurationManager;
|
||||||
|
|
@ -75,7 +72,7 @@ public class ConfigurationManagerTest {
|
||||||
@Inject
|
@Inject
|
||||||
private Shiro shiro;
|
private Shiro shiro;
|
||||||
|
|
||||||
public ConfigurationManagerTest() {
|
public ConfigurationManagerIT() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -98,40 +95,21 @@ public class ConfigurationManagerTest {
|
||||||
@Deployment
|
@Deployment
|
||||||
public static WebArchive createDeployment() {
|
public static WebArchive createDeployment() {
|
||||||
return ShrinkWrap
|
return ShrinkWrap
|
||||||
.create(WebArchive.class,
|
.create(
|
||||||
"LibreCCM-org.libreccm.configuration."
|
WebArchive.class,
|
||||||
+ "ConfigurationManagerTest.war")
|
"LibreCCM-org.libreccm.configuration.ConfigurationManagerTest.war"
|
||||||
.addPackage(org.libreccm.categorization.Categorization.class
|
)
|
||||||
.getPackage())
|
.addPackages(true, "com.arsdigita", "org.libreccm", "com.example")
|
||||||
.addPackage(org.libreccm.configuration.Configuration.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.core.CcmObject.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(org.libreccm.tests.categories.IntegrationTest.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.testutils.EqualsVerifier.class.
|
|
||||||
getPackage())
|
|
||||||
.addClass(com.example.TestConfiguration.class)
|
|
||||||
.addClass(com.arsdigita.kernel.KernelConfig.class)
|
|
||||||
.addClass(com.arsdigita.kernel.security.SecurityConfig.class)
|
|
||||||
.addClass(org.libreccm.imexport.Exportable.class)
|
|
||||||
.addPackage(org.libreccm.cdi.utils.CdiUtil.class.getPackage())
|
|
||||||
.addAsLibraries(getModuleDependencies())
|
.addAsLibraries(getModuleDependencies())
|
||||||
.addAsResource("configs/shiro.ini", "shiro.ini")
|
.addAsResource("configs/shiro.ini", "shiro.ini")
|
||||||
.addAsResource("test-persistence.xml",
|
.addAsResource(
|
||||||
"META-INF/persistence.xml")
|
"test-persistence.xml", "META-INF/persistence.xml"
|
||||||
|
)
|
||||||
.addAsResource(
|
.addAsResource(
|
||||||
"configs/org/libreccm/configuration/ConfigurationManagerTest/"
|
"configs/org/libreccm/configuration/ConfigurationManagerTest/"
|
||||||
+ "log4j2.xml",
|
+ "log4j2.xml",
|
||||||
"log4j2.xml")
|
"log4j2.xml"
|
||||||
|
)
|
||||||
.addAsWebInfResource("test-web.xml", "web.xml")
|
.addAsWebInfResource("test-web.xml", "web.xml")
|
||||||
.addAsWebInfResource("META-INF/beans.xml", "beans.xml");
|
.addAsWebInfResource("META-INF/beans.xml", "beans.xml");
|
||||||
}
|
}
|
||||||
|
|
@ -20,14 +20,13 @@ package org.libreccm.configuration;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
import org.junit.After;
|
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;
|
||||||
|
|
||||||
|
|
@ -39,7 +38,6 @@ import static org.libreccm.testutils.DatasetType.*;
|
||||||
* @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}")
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,6 @@ 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}")
|
||||||
|
|
|
||||||
|
|
@ -21,10 +21,8 @@ package org.libreccm.configuration;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
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.ToStringVerifier;
|
import org.libreccm.testutils.ToStringVerifier;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -34,7 +32,6 @@ import org.libreccm.testutils.ToStringVerifier;
|
||||||
* @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 ToStringTest extends ToStringVerifier {
|
public class ToStringTest extends ToStringVerifier {
|
||||||
|
|
||||||
@Parameterized.Parameters(name = "{0}")
|
@Parameterized.Parameters(name = "{0}")
|
||||||
|
|
|
||||||
|
|
@ -38,9 +38,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.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -55,6 +53,7 @@ import static org.libreccm.testutils.DependenciesHelpers.*;
|
||||||
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;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -63,7 +62,6 @@ import org.jboss.arquillian.persistence.TestExecutionPhase;
|
||||||
*
|
*
|
||||||
* @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)
|
||||||
|
|
@ -72,7 +70,7 @@ import org.jboss.arquillian.persistence.TestExecutionPhase;
|
||||||
"003_init_hibernate_sequence.sql"})
|
"003_init_hibernate_sequence.sql"})
|
||||||
@CleanupUsingScript(value = {"999_cleanup.sql"},
|
@CleanupUsingScript(value = {"999_cleanup.sql"},
|
||||||
phase = TestExecutionPhase.BEFORE)
|
phase = TestExecutionPhase.BEFORE)
|
||||||
public class CcmObjectRepositoryTest {
|
public class CcmObjectRepositoryIT {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private CcmObjectRepository ccmObjectRepository;
|
private CcmObjectRepository ccmObjectRepository;
|
||||||
|
|
@ -80,7 +78,7 @@ public class CcmObjectRepositoryTest {
|
||||||
@PersistenceContext(name = "LibreCCM")
|
@PersistenceContext(name = "LibreCCM")
|
||||||
private EntityManager entityManager;
|
private EntityManager entityManager;
|
||||||
|
|
||||||
public CcmObjectRepositoryTest() {
|
public CcmObjectRepositoryIT() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
|
|
@ -102,40 +100,15 @@ public class CcmObjectRepositoryTest {
|
||||||
@Deployment
|
@Deployment
|
||||||
public static WebArchive createDeployment() {
|
public static WebArchive createDeployment() {
|
||||||
return ShrinkWrap
|
return ShrinkWrap
|
||||||
.create(WebArchive.class,
|
.create(
|
||||||
"LibreCCM-org.libreccm.core.CcmObjectRepositoryTest.war")
|
WebArchive.class,
|
||||||
.addPackage(org.libreccm.auditing.CcmRevision.class.getPackage())
|
"LibreCCM-org.libreccm.core.CcmObjectRepositoryTest.war"
|
||||||
.addPackage(org.libreccm.categorization.Categorization.class
|
)
|
||||||
.getPackage())
|
.addPackages(true, "com.arsdigita", "org.libreccm")
|
||||||
.addPackage(org.libreccm.configuration.Configuration.class.
|
|
||||||
getPackage())
|
|
||||||
.addPackage(org.libreccm.core.CcmObject.class.getPackage())
|
|
||||||
.addPackage(org.libreccm.jpa.EntityManagerProducer.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.jpa.utils.MimeTypeConverter.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.l10n.LocalizedString.class.getPackage())
|
|
||||||
.addClass(org.libreccm.modules.CcmModule.class)
|
|
||||||
.addClass(org.libreccm.modules.ModuleEvent.class)
|
|
||||||
.addClass(org.libreccm.modules.InitEvent.class)
|
|
||||||
.addClass(org.libreccm.modules.InstallEvent.class)
|
|
||||||
.addClass(org.libreccm.modules.UnInstallEvent.class)
|
|
||||||
.addClass(org.libreccm.modules.ShutdownEvent.class)
|
|
||||||
.addClass(org.libreccm.imexport.Exportable.class)
|
|
||||||
.addPackage(org.libreccm.security.PermissionChecker.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.cdi.utils.CdiUtil.class.getPackage())
|
|
||||||
.addPackage(org.libreccm.testutils.EqualsVerifier.class.
|
|
||||||
getPackage())
|
|
||||||
.addPackage(org.libreccm.tests.categories.IntegrationTest.class
|
|
||||||
.getPackage())
|
|
||||||
.addPackage(org.libreccm.web.CcmApplication.class.getPackage())
|
|
||||||
.addPackage(org.libreccm.workflow.Workflow.class.getPackage())
|
|
||||||
.addPackage(com.arsdigita.kernel.security.SecurityConfig.class
|
|
||||||
.getPackage())
|
|
||||||
.addAsLibraries(getModuleDependencies())
|
.addAsLibraries(getModuleDependencies())
|
||||||
.addAsResource("test-persistence.xml",
|
.addAsResource(
|
||||||
"META-INF/persistence.xml")
|
"test-persistence.xml", "META-INF/persistence.xml"
|
||||||
|
)
|
||||||
.addAsResource("configs/shiro.ini", "shiro.ini")
|
.addAsResource("configs/shiro.ini", "shiro.ini")
|
||||||
.addAsWebInfResource("test-web.xml", "web.xml")
|
.addAsWebInfResource("test-web.xml", "web.xml")
|
||||||
.addAsWebInfResource(EmptyAsset.INSTANCE, "WEB-INF/beans.xml");
|
.addAsWebInfResource(EmptyAsset.INSTANCE, "WEB-INF/beans.xml");
|
||||||
|
|
@ -358,7 +331,8 @@ public class CcmObjectRepositoryTest {
|
||||||
@Test(expected = NullPointerException.class)
|
@Test(expected = NullPointerException.class)
|
||||||
@ShouldThrowException(NullPointerException.class)
|
@ShouldThrowException(NullPointerException.class)
|
||||||
@UsingDataSet("datasets/org/libreccm/core/CcmObjectRepositoryTest/data.yml")
|
@UsingDataSet("datasets/org/libreccm/core/CcmObjectRepositoryTest/data.yml")
|
||||||
@ShouldMatchDataSet("datasets/org/libreccm/core/CcmObjectRepositoryTest/data.yml")
|
@ShouldMatchDataSet(
|
||||||
|
"datasets/org/libreccm/core/CcmObjectRepositoryTest/data.yml")
|
||||||
@InSequence(700)
|
@InSequence(700)
|
||||||
public void deleteNullValue() {
|
public void deleteNullValue() {
|
||||||
ccmObjectRepository.delete(null);
|
ccmObjectRepository.delete(null);
|
||||||
|
|
@ -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.DatasetsVerifier;
|
import org.libreccm.testutils.DatasetsVerifier;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
@ -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}")
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@ package org.libreccm.core;
|
||||||
import nl.jqno.equalsverifier.api.SingleTypeEqualsVerifierApi;
|
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.tests.categories.UnitTest;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
@ -39,7 +38,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}")
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,6 @@ import org.libreccm.l10n.LocalizedString;
|
||||||
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;
|
||||||
|
|
@ -42,7 +41,6 @@ import java.util.Locale;
|
||||||
* @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 ResourceEntityTest extends EqualsVerifier {
|
public class ResourceEntityTest extends EqualsVerifier {
|
||||||
|
|
||||||
@Parameterized.Parameters(name = "{0}")
|
@Parameterized.Parameters(name = "{0}")
|
||||||
|
|
|
||||||
|
|
@ -18,11 +18,9 @@
|
||||||
*/
|
*/
|
||||||
package org.libreccm.core;
|
package org.libreccm.core;
|
||||||
|
|
||||||
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.testutils.ToStringVerifier;
|
import org.libreccm.testutils.ToStringVerifier;
|
||||||
import org.libreccm.tests.categories.UnitTest;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
@ -34,7 +32,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 ToStringTest extends ToStringVerifier {
|
public class ToStringTest extends ToStringVerifier {
|
||||||
|
|
||||||
@Parameterized.Parameters(name = "{0}")
|
@Parameterized.Parameters(name = "{0}")
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
@ -37,7 +36,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}")
|
||||||
|
|
|
||||||
|
|
@ -18,11 +18,9 @@
|
||||||
*/
|
*/
|
||||||
package org.libreccm.formbuilder;
|
package org.libreccm.formbuilder;
|
||||||
|
|
||||||
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.testutils.ToStringVerifier;
|
import org.libreccm.testutils.ToStringVerifier;
|
||||||
import org.libreccm.tests.categories.UnitTest;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
@ -32,7 +30,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 ToStringTest extends ToStringVerifier {
|
public class ToStringTest extends ToStringVerifier {
|
||||||
|
|
||||||
@Parameterized.Parameters(name = "{0}")
|
@Parameterized.Parameters(name = "{0}")
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,6 @@ import org.junit.runner.RunWith;
|
||||||
import org.junit.runners.Parameterized;
|
import org.junit.runners.Parameterized;
|
||||||
import org.libreccm.formbuilder.Component;
|
import org.libreccm.formbuilder.Component;
|
||||||
import org.libreccm.formbuilder.FormSection;
|
import org.libreccm.formbuilder.FormSection;
|
||||||
import org.libreccm.tests.categories.UnitTest;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
@ -40,7 +39,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}")
|
||||||
|
|
|
||||||
|
|
@ -18,11 +18,9 @@
|
||||||
*/
|
*/
|
||||||
package org.libreccm.formbuilder.actions;
|
package org.libreccm.formbuilder.actions;
|
||||||
|
|
||||||
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.testutils.ToStringVerifier;
|
import org.libreccm.testutils.ToStringVerifier;
|
||||||
import org.libreccm.tests.categories.UnitTest;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
@ -32,7 +30,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 ToStringTest extends ToStringVerifier {
|
public class ToStringTest extends ToStringVerifier {
|
||||||
|
|
||||||
@Parameterized.Parameters(name = "{0}")
|
@Parameterized.Parameters(name = "{0}")
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue