CCM NG:
- Fixed some typos in the ccm-archetype-module - Skeleton for ccm-cms module git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@3695 8810af33-2d31-482b-a856-94f89814c4dfpull/2/head
parent
18f492567d
commit
41ab6d05a1
|
|
@ -5,7 +5,7 @@
|
||||||
partial="false" >
|
partial="false" >
|
||||||
|
|
||||||
<requiredProperties>
|
<requiredProperties>
|
||||||
<requiredProperty key="moduleClassName">
|
<requiredProperty key="moduleClass">
|
||||||
<defaultValue>${artifactId}</defaultValue>
|
<defaultValue>${artifactId}</defaultValue>
|
||||||
</requiredProperty>
|
</requiredProperty>
|
||||||
</requiredProperties>
|
</requiredProperties>
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
</requiredProperties>-->
|
</requiredProperties>-->
|
||||||
|
|
||||||
<fileSets>
|
<fileSets>
|
||||||
<fileSet filtered="false" packaged="true">
|
<fileSet filtered="true" packaged="true">
|
||||||
<directory>src/main/java</directory>
|
<directory>src/main/java</directory>
|
||||||
</fileSet>
|
</fileSet>
|
||||||
<fileSet filtered="false" packaged="true">
|
<fileSet filtered="false" packaged="true">
|
||||||
|
|
@ -30,7 +30,7 @@
|
||||||
<fileSet filtered="false" packaged="false">
|
<fileSet filtered="false" packaged="false">
|
||||||
<directory>src/main/resources/module-info</directory>
|
<directory>src/main/resources/module-info</directory>
|
||||||
</fileSet>
|
</fileSet>
|
||||||
<fileSet filtered="false" packaged="true">
|
<fileSet filtered="true" packaged="true">
|
||||||
<directory>src/test/java</directory>
|
<directory>src/test/java</directory>
|
||||||
</fileSet>
|
</fileSet>
|
||||||
</fileSets>
|
</fileSets>
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
<artifactId>${artifactId}</artifactId>
|
<artifactId>${artifactId}</artifactId>
|
||||||
<version>${version}</version>
|
<version>${version}</version>
|
||||||
|
|
||||||
<name>${moduleName}</name>
|
<name>${artifactId}</name>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,19 @@
|
||||||
/**
|
/**
|
||||||
* Add your license here, for example LGPL
|
* Add your license here, for example LGPL
|
||||||
*/
|
*/
|
||||||
package ${packageName}
|
package ${package};
|
||||||
|
|
||||||
import org.libreccm.modules.CcmModule;
|
import org.libreccm.modules.CcmModule;
|
||||||
import org.libreccm.modules.InitEvent;
|
import org.libreccm.modules.InitEvent;
|
||||||
import org.libreccm.modules.InstallEvent;
|
import org.libreccm.modules.InstallEvent;
|
||||||
import org.libreccm.modules.Module;
|
import org.libreccm.modules.Module;
|
||||||
|
import org.libreccm.modules.RequiredModule;
|
||||||
import org.libreccm.modules.ShutdownEvent;
|
import org.libreccm.modules.ShutdownEvent;
|
||||||
import org.libreccm.modules.UnInstallEvent;
|
import org.libreccm.modules.UnInstallEvent;
|
||||||
|
|
||||||
@Module(moduleDataPackage=${packageName},
|
@Module(packageName="${package}",
|
||||||
requiredModules = {@RequiredModule = org.libreccm.core.CcmCore})
|
requiredModules = {@RequiredModule(module = org.libreccm.core.CcmCore)})
|
||||||
public ${moduleClassName} implements CcmModule {
|
public class ${moduleClass} implements CcmModule {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void install(final InstallEvent event) {
|
public void install(final InstallEvent event) {
|
||||||
|
|
@ -1 +1 @@
|
||||||
${packageName}.${moduleClassName}
|
${package}.${moduleClass}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* ToDo: Add your license
|
* ToDo: Add your license
|
||||||
*/
|
*/
|
||||||
package ${packageName};
|
package ${package};
|
||||||
|
|
||||||
import static org.hamcrest.CoreMatchers.*;
|
import static org.hamcrest.CoreMatchers.*;
|
||||||
|
|
||||||
|
|
@ -38,12 +38,12 @@ import javax.persistence.PersistenceContext;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
@Category(IntegrationTest.class}
|
@Category(IntegrationTest.class)
|
||||||
@RunWith(Arquillian.class)
|
@RunWith(Arquillian.class)
|
||||||
@PersistenceTest
|
@PersistenceTest
|
||||||
@Transactional(TransactionMode.COMMIT)
|
@Transactional(TransactionMode.COMMIT)
|
||||||
@CreateSchema({"create_${artifactId}_schema.sql"})
|
@CreateSchema({"create_${artifactId}_schema.sql"})
|
||||||
public class ${moduleClassName}Test {
|
public class ${moduleClass}Test {
|
||||||
|
|
||||||
@PersistenceContext(name = "LibreCCM")
|
@PersistenceContext(name = "LibreCCM")
|
||||||
private transient EntityManager entityManager;
|
private transient EntityManager entityManager;
|
||||||
|
|
@ -80,10 +80,10 @@ public class ${moduleClassName}Test {
|
||||||
|
|
||||||
return ShrinkWrap
|
return ShrinkWrap
|
||||||
.create(WebArchive.class,
|
.create(WebArchive.class,
|
||||||
"LibreCCM-${packageName}.${moduleClassName}Test.war")
|
"LibreCCM-${package}.${moduleClass}Test.war")
|
||||||
.addPackage(${moduleClassName}.class.getPackage())
|
.addPackage(${moduleClass}.class.getPackage())
|
||||||
.addAsLibraries(libs)
|
.addAsLibraries(libs)
|
||||||
.addAsResource("test-persistence.xml,
|
.addAsResource("test-persistence.xml",
|
||||||
"META-INF/persistence.xml")
|
"META-INF/persistence.xml")
|
||||||
.addAsWebInfResource("test-web.xml", "WEB-INF/web.xml")
|
.addAsWebInfResource("test-web.xml", "WEB-INF/web.xml")
|
||||||
.addAsWebInfResource(EmptyAsset.INSTANCE, "WEB-INF/beans.xml");
|
.addAsWebInfResource(EmptyAsset.INSTANCE, "WEB-INF/beans.xml");
|
||||||
|
|
@ -0,0 +1,318 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||||
|
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<parent>
|
||||||
|
<artifactId>libreccm-parent</artifactId>
|
||||||
|
<groupId>org.libreccm</groupId>
|
||||||
|
<version>7.0.0-SNAPSHOT</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
<timestamp>${maven.build.timestamp}</timestamp>
|
||||||
|
<maven.build.timestamp.format>yyyy-MM-dd'T'HH:mm:ss'Z'Z</maven.build.timestamp.format>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<groupId>org.libreccm</groupId>
|
||||||
|
<artifactId>ccm-cms</artifactId>
|
||||||
|
<version>7.0.0-SNAPSHOT</version>
|
||||||
|
|
||||||
|
<name>ccm-cms</name>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax</groupId>
|
||||||
|
<artifactId>javaee-api</artifactId>
|
||||||
|
<type>jar</type>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.libreccm</groupId>
|
||||||
|
<artifactId>ccm-core</artifactId>
|
||||||
|
<version>${project.parent.version}</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.hibernate</groupId>
|
||||||
|
<artifactId>hibernate-entitymanager</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.hibernate</groupId>
|
||||||
|
<artifactId>hibernate-validator</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>junit</groupId>
|
||||||
|
<artifactId>junit</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.hamcrest</groupId>
|
||||||
|
<artifactId>hamcrest-core</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.hamcrest</groupId>
|
||||||
|
<artifactId>hamcrest-library</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.libreccm</groupId>
|
||||||
|
<artifactId>ccm-testutils</artifactId>
|
||||||
|
<version>${project.parent.version}</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>nl.jqno.equalsverifier</groupId>
|
||||||
|
<artifactId>equalsverifier</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jboss.arquillian.junit</groupId>
|
||||||
|
<artifactId>arquillian-junit-container</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jboss.arquillian.extension</groupId>
|
||||||
|
<artifactId>arquillian-persistence-dbunit</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jboss.arquillian.extension</groupId>
|
||||||
|
<artifactId>arquillian-transaction-impl-base</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jboss.shrinkwrap.resolver</groupId>
|
||||||
|
<artifactId>shrinkwrap-resolver-impl-maven</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.h2database</groupId>
|
||||||
|
<artifactId>h2</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<finalName>ccm-cms</finalName>
|
||||||
|
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.3</version>
|
||||||
|
<configuration>
|
||||||
|
<source>1.7</source>
|
||||||
|
<target>1.7</target>
|
||||||
|
<optimize>true</optimize>
|
||||||
|
<debug>true</debug>
|
||||||
|
<encoding>${project.build.sourceEncoding}</encoding>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
|
<version>2.18.1</version>
|
||||||
|
<configuration>
|
||||||
|
<groups>org.libreccm.tests.categories.UnitTest</groups>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.jacoco</groupId>
|
||||||
|
<artifactId>jacoco-maven-plugin</artifactId>
|
||||||
|
<version>0.7.5.201505241946</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>default-prepare-agent</id>
|
||||||
|
<goals>
|
||||||
|
<goal>prepare-agent</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>default-report</id>
|
||||||
|
<phase>prepare-package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>report</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>default-check</id>
|
||||||
|
<goals>
|
||||||
|
<goal>check</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<rules>
|
||||||
|
<rule>
|
||||||
|
<element>BUNDLE</element>
|
||||||
|
<limits>
|
||||||
|
<limit>
|
||||||
|
<counter>COMPLEXITY</counter>
|
||||||
|
<value>COVEREDRATIO</value>
|
||||||
|
<minimum>0.60</minimum>
|
||||||
|
</limit>
|
||||||
|
</limits>
|
||||||
|
</rule>
|
||||||
|
</rules>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<groupId>de.jpdigital</groupId>
|
||||||
|
<artifactId>hibernate4-ddl-maven-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<dialects>
|
||||||
|
<param>h2</param>
|
||||||
|
<param>mysql5_innodb</param>
|
||||||
|
<param>oracle10g</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>
|
||||||
|
</plugins>
|
||||||
|
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>src/main/resources</directory>
|
||||||
|
<filtering>true</filtering>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
<reporting>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-javadoc-plugin</artifactId>
|
||||||
|
<version>2.10.3</version>
|
||||||
|
<configuration>
|
||||||
|
<detectLinks>true</detectLinks>
|
||||||
|
<detectJavaApiLinks>true</detectJavaApiLinks>
|
||||||
|
<links>
|
||||||
|
<link>http://docs.oracle.com/javase/7/docs/api/</link>
|
||||||
|
<link>http://docs.oracle.com/javaee/7/api/</link>
|
||||||
|
<link>http://docs.jboss.org/hibernate/orm/4.3/javadocs/</link>
|
||||||
|
</links>
|
||||||
|
<show>private</show>
|
||||||
|
<docfilessubdirs>true</docfilessubdirs>
|
||||||
|
<charset>UTF-8</charset>
|
||||||
|
<encoding>UTF-8</encoding>
|
||||||
|
<docencoding>UTF-8</docencoding>
|
||||||
|
<breakiterator>true</breakiterator>
|
||||||
|
<version>true</version>
|
||||||
|
<author>true</author>
|
||||||
|
<keywords>true</keywords>
|
||||||
|
<failOnError>false</failOnError>
|
||||||
|
<doclet>org.jboss.apiviz.APIviz</doclet>
|
||||||
|
<docletArtifact>
|
||||||
|
<groupId>org.jboss.apiviz</groupId>
|
||||||
|
<artifactId>apiviz</artifactId>
|
||||||
|
<version>1.3.2.GA</version>
|
||||||
|
</docletArtifact>
|
||||||
|
<useStandardDocletOptions>true</useStandardDocletOptions>
|
||||||
|
<additionalparam>-sourceclasspath ${project.build.outputDirectory}</additionalparam>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-jxr-plugin</artifactId>
|
||||||
|
<version>2.5</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-surefire-report-plugin</artifactId>
|
||||||
|
<version>2.18.1</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.jacoco</groupId>
|
||||||
|
<artifactId>jacoco-maven-plugin</artifactId>
|
||||||
|
<version>0.7.5.201505241946</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
|
<artifactId>findbugs-maven-plugin</artifactId>
|
||||||
|
<version>3.0.1</version>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-pmd-plugin</artifactId>
|
||||||
|
<version>3.4</version>
|
||||||
|
<configuration>
|
||||||
|
<linkXref>true</linkXref>
|
||||||
|
<sourceEncoding>utf-8</sourceEncoding>
|
||||||
|
<targetJdk>1.7</targetJdk>
|
||||||
|
<rulesets>
|
||||||
|
<ruleset>/rulesets/java/basic.xml</ruleset>
|
||||||
|
<ruleset>/rulesets/java/braces.xml</ruleset>
|
||||||
|
<ruleset>/rulesets/java/clone.xml</ruleset>
|
||||||
|
<ruleset>/rulesets/java/codesize.xml</ruleset>
|
||||||
|
<ruleset>/rulesets/java/design.xml</ruleset>
|
||||||
|
<ruleset>/rulesets/java/empty.xml</ruleset>
|
||||||
|
<ruleset>/rulesets/java/finalizers.xml</ruleset>
|
||||||
|
<ruleset>/rulesets/java/imports.xml</ruleset>
|
||||||
|
<ruleset>/rulesets/java/javabeans.xml</ruleset>
|
||||||
|
<ruleset>/rulesets/java/junit.xml</ruleset>
|
||||||
|
<ruleset>/rulesets/java/naming.xml</ruleset>
|
||||||
|
<ruleset>/rulesets/java/optimizations.xml</ruleset>
|
||||||
|
<ruleset>/rulesets/java/strictexception.xml</ruleset>
|
||||||
|
<ruleset>/rulesets/java/strings.xml</ruleset>
|
||||||
|
<ruleset>/rulesets/java/sunsecure.xml</ruleset>
|
||||||
|
<ruleset>/rulesets/java/typeresolution.xml</ruleset>
|
||||||
|
<ruleset>/rulesets/java/unnecessary.xml</ruleset>
|
||||||
|
<ruleset>/rulesets/java/unusedcode.xml</ruleset>
|
||||||
|
</rulesets>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
|
<artifactId>javancss-maven-plugin</artifactId>
|
||||||
|
<version>2.1</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-project-info-reports-plugin</artifactId>
|
||||||
|
<version>2.8</version>
|
||||||
|
<reportSets>
|
||||||
|
<reportSet>
|
||||||
|
<reports>
|
||||||
|
<report>dependencies</report>
|
||||||
|
<report>license</report>
|
||||||
|
</reports>
|
||||||
|
</reportSet>
|
||||||
|
</reportSets>
|
||||||
|
<configuration>
|
||||||
|
<dependencyLocationsEnabled>false</dependencyLocationsEnabled>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</reporting>
|
||||||
|
</project>
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
/**
|
||||||
|
* Add your license here, for example LGPL
|
||||||
|
*/
|
||||||
|
package org.libreccm.cms;
|
||||||
|
|
||||||
|
import org.libreccm.modules.CcmModule;
|
||||||
|
import org.libreccm.modules.InitEvent;
|
||||||
|
import org.libreccm.modules.InstallEvent;
|
||||||
|
import org.libreccm.modules.Module;
|
||||||
|
import org.libreccm.modules.RequiredModule;
|
||||||
|
import org.libreccm.modules.ShutdownEvent;
|
||||||
|
import org.libreccm.modules.UnInstallEvent;
|
||||||
|
|
||||||
|
@Module(packageName = "org.libreccm.cms",
|
||||||
|
requiredModules = {@RequiredModule(module = org.libreccm.core.CcmCore.class)})
|
||||||
|
public class Cms implements CcmModule {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void install(final InstallEvent event) {
|
||||||
|
//ToDo Create initial data for the module if neccessary
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(final InitEvent event) {
|
||||||
|
//ToDo Add initialisation logic necessary for your module
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void shutdown(final ShutdownEvent event) {
|
||||||
|
//ToDo Add shutdown logic if necessary
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void uninstall(final UnInstallEvent event) {
|
||||||
|
//ToDo Remove module data
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
org.libreccm.cms.Cms
|
||||||
|
|
@ -0,0 +1,104 @@
|
||||||
|
/*
|
||||||
|
* ToDo: Add your license
|
||||||
|
*/
|
||||||
|
package org.libreccm.cms;
|
||||||
|
|
||||||
|
import static org.hamcrest.CoreMatchers.*;
|
||||||
|
|
||||||
|
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.asset.EmptyAsset;
|
||||||
|
import org.jboss.shrinkwrap.api.spec.WebArchive;
|
||||||
|
import org.jboss.shrinkwrap.resolver.api.maven.Maven;
|
||||||
|
import org.jboss.shrinkwrap.resolver.api.maven.PomEquippedResolveStage;
|
||||||
|
import org.junit.After;
|
||||||
|
import org.junit.AfterClass;
|
||||||
|
import org.junit.Before;
|
||||||
|
import org.junit.BeforeClass;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.experimental.categories.Category;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.libreccm.tests.categories.IntegrationTest;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
import javax.persistence.EntityManager;
|
||||||
|
import javax.persistence.PersistenceContext;
|
||||||
|
|
||||||
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
|
@Category(IntegrationTest.class)
|
||||||
|
@RunWith(Arquillian.class)
|
||||||
|
@PersistenceTest
|
||||||
|
@Transactional(TransactionMode.COMMIT)
|
||||||
|
@CreateSchema({"create_ccm-cms_schema.sql"})
|
||||||
|
public class CmsTest {
|
||||||
|
|
||||||
|
@PersistenceContext(name = "LibreCCM")
|
||||||
|
private transient EntityManager entityManager;
|
||||||
|
|
||||||
|
@BeforeClass
|
||||||
|
public static void setUpClass() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@AfterClass
|
||||||
|
public static void tearDownClass() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Before
|
||||||
|
public void setUp() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@After
|
||||||
|
public void tearDown() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Deployment
|
||||||
|
public static WebArchive createDeployment() {
|
||||||
|
final PomEquippedResolveStage pom = Maven
|
||||||
|
.resolver()
|
||||||
|
.loadPomFromFile("pom.xml");
|
||||||
|
final PomEquippedResolveStage dependencies = pom
|
||||||
|
.importCompileAndRuntimeDependencies();
|
||||||
|
final File[] libs = dependencies.resolve().withTransitivity().asFile();
|
||||||
|
|
||||||
|
for (File lib : libs) {
|
||||||
|
System.err.printf("Adding file '%s' to test archive...%n",
|
||||||
|
lib.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
return ShrinkWrap
|
||||||
|
.create(WebArchive.class,
|
||||||
|
"LibreCCM-org.libreccm.cms.CmsTest.war")
|
||||||
|
.addPackage(Cms.class.getPackage())
|
||||||
|
.addAsLibraries(libs)
|
||||||
|
.addAsResource("test-persistence.xml",
|
||||||
|
"META-INF/persistence.xml")
|
||||||
|
.addAsWebInfResource("test-web.xml", "WEB-INF/web.xml")
|
||||||
|
.addAsWebInfResource(EmptyAsset.INSTANCE, "WEB-INF/beans.xml");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@InSequence(1)
|
||||||
|
public void yourFirstTest() {
|
||||||
|
//ToDo: Add test logic
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Loading…
Reference in New Issue