Refactored integration tests in ccm-cms to run with maven-failsafe-plugin and Wildfly started by the wildfly-maven-plugin
parent
0e323368f8
commit
641ff46c6b
324
ccm-cms/pom.xml
324
ccm-cms/pom.xml
|
|
@ -359,6 +359,330 @@
|
||||||
|
|
||||||
|
|
||||||
<profiles>
|
<profiles>
|
||||||
|
<profile>
|
||||||
|
<id>run-its-with-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-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-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.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>
|
||||||
|
</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-with-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>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.postgresql</groupId>
|
||||||
|
<artifactId>postgresql</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</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-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>
|
<profile>
|
||||||
<id>wildfly-managed-h2-mem</id>
|
<id>wildfly-managed-h2-mem</id>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
|
||||||
|
|
@ -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 t")
|
||||||
,
|
,
|
||||||
@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;
|
||||||
|
|
@ -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(
|
||||||
|
|
@ -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,23 @@ 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 +81,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 +92,7 @@ public class ContentItemRepositoryTest {
|
||||||
@Inject
|
@Inject
|
||||||
private Shiro shiro;
|
private Shiro shiro;
|
||||||
|
|
||||||
public ContentItemRepositoryTest() {
|
public ContentItemRepositoryIT() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
|
|
@ -116,54 +117,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()));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -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(
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -946,7 +946,7 @@
|
||||||
</profile>
|
</profile>
|
||||||
|
|
||||||
<profile>
|
<profile>
|
||||||
<id>test-with-wildfly-h2mem</id>
|
<id>run-its-with-wildfly-h2mem</id>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wildfly.arquillian</groupId>
|
<groupId>org.wildfly.arquillian</groupId>
|
||||||
|
|
@ -1090,7 +1090,7 @@
|
||||||
</profile>
|
</profile>
|
||||||
|
|
||||||
<profile>
|
<profile>
|
||||||
<id>test-with-wildfly-pgsql</id>
|
<id>run-its-with-wildfly-pgsql</id>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wildfly.arquillian</groupId>
|
<groupId>org.wildfly.arquillian</groupId>
|
||||||
|
|
@ -1119,7 +1119,6 @@
|
||||||
<testResource>
|
<testResource>
|
||||||
<directory>${project.build.directory}/generated-resources</directory>
|
<directory>${project.build.directory}/generated-resources</directory>
|
||||||
</testResource>
|
</testResource>
|
||||||
|
|
||||||
</testResources>
|
</testResources>
|
||||||
|
|
||||||
<plugins>
|
<plugins>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue