Merge master into RM-2616_CaveatMarksComparator.

Unit test fixes required to get validation working with NodeService
storage.

Also fixed compiler errors in Eclipse caused by use of inferred generics
in asSerialisableList (I'm not sure this was strictly needed to get the
merged code to work, but it stopped Eclipse from complaining).
This commit is contained in:
Tom Page
2016-01-25 15:38:37 +00:00
18 changed files with 582 additions and 848 deletions

View File

@@ -1,53 +0,0 @@
== Alfresco Records Management - Development Environment Setup ==
Prerequisites
- Maven 3.0.4 (or higher)
- Eclipse Maven Plugin (m2e)
- See Maven setup instructions https://ts.alfresco.com/share/page/site/eng/wiki-page?title=Maven_Setup
Initial Setup
- Create a normal project using "create-project"
- Check out RM code into the "code" directory (eg "checkout https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD")
- Create the tomcat instances using "use-tomcat7" and "use-app-tomcat7"
- If you've got SOLR config in your $DEV_HOME/projects/repository.properties file, then you'll need to remove it or fix it in the RM project level properties file.
Using Eclipse (or IntelliJ)
- Import projects as Maven projects ("Import > Maven > Existing Maven Projects")
- Browse to the code directory of your project and select "rm-server/pom.xml" and "rm-share/pom.xml". DO NOT select the parent "/pom.xml"
- Open the Ant view and add the build files for both modules ("build.xml")
- If you are not working on a Windows machine you need to change the value of a property called "mvn.exec".
To do this create a file called "build.local.properties" under the code directory and change the value in that new file.
- Run the "prepareEnv" target for rm-server which will prepare the development environment. This target must be run just once.
- Now "fullBuildCommunity" or "fullBuildEnterprise" target (depending which version of Alfresco you want as dependency) can be run which will create the amp file, apply it to the war file and copy the war file to webapps folder.
Summary of Available Ant Targets
- fullBuildCommunity : Creates the amp file and applies it to the Community war file
- fullBuildEnterprise : Creates the amp file and applies it to the Enterprise war file
- incrementalBuild : Creates the jar file and copies the jar file with other files like css, js, ftl, etc. files
Summary of Available Internal Ant Targets
- alfresco:amp : Creates the amp file using alfresco maven plugin
- alfresco:install : Installs the amp file to the Community war file
- alfresco:installEnterprise : Installs the amp file to the Enterprise war file
- assembleIconPackage : Assembles an icons package for the module
- configureSolr4 : Configures Solr4 for Alfresco (creates two directories "solr4" and "solr4config" under the "data" directory)
- copyDBDriver : Copies the DB driver
- copyDevContextFile : Copies the dev-context.xml file
- copyWarFileToTomcat : Copies the war file (amp applied) to the webapp folder
- copyWebDirectory : Copies the source/web folder
- deleteExplodedWar : Deletes the exploded war file
- deleteWarFile : Deletes the war file
- fetchSolr : Gets the the Solr artifact
- fetchWarFile : Gets the "original" Community war file
- fetchEntpriseWarFile : Gets the "original" Enterprise war file
- package : Executes the "mvn package" command
- prepareEnv : Prepares the development environment (must be run just once)
- unitTest : Runs the unit tests

View File

@@ -1,25 +0,0 @@
# Do NOT change the values directly in this file. If you need to change the value of a property,
# create a file called "build.local.properties" in the same folder and change the value in that file.
# The application war file properties
app.war.packaging=war
# Executable properties
mvn.exec=${env.MAVEN_HOME}/bin/mvn.bat
# Ant directory properties
ant.build.directory=target
ant.config.directory=config
ant.source.web.directory=source/web
# Tomcat properties
app.tomcat.folder=${ant.build.directory}/../../../../software/${app.tomcat}
app.tomcat.webapps=${app.tomcat.folder}/webapps
# Application properties
app.folder=${app.tomcat.webapps}/${app.war.artifactId}
app.package=${app.war.artifactId}.${app.war.packaging}
app.package.path=${app.tomcat.webapps}/${app.package}
# Controls the minification process of js files
minifyjs=false

View File

@@ -1,121 +0,0 @@
<?xml version="1.0"?>
<project name="rm-parent" basedir=".">
<!-- The properties 'app.war.artifactId' and 'app.tomcat' are defined in the modules -->
<property file="build.local.properties" />
<property file="build.properties" />
<property environment="env" />
<target name="fetchWarFile">
<xmlproperty file="../pom.xml" keepRoot="false"/>
<exec executable="${mvn.exec}" failonerror="true">
<arg value="dependency:get" />
<arg value="-DgroupId=${groupId}" />
<arg value="-DartifactId=${app.war.artifactId}" />
<arg value="-Dversion=${properties.alfresco.base.version}" />
<arg value="-Dpackaging=${app.war.packaging}" />
<arg value="-Ddest=${ant.build.directory}/${app.package}" />
</exec>
</target>
<target name="fetchEntpriseWarFile">
<xmlproperty file="../pom.xml" keepRoot="false"/>
<exec executable="${mvn.exec}" failonerror="true">
<arg value="dependency:get" />
<arg value="-DgroupId=${groupId}" />
<arg value="-DartifactId=${app.war.artifactId}-enterprise" />
<arg value="-Dversion=${properties.alfresco.base.version}" />
<arg value="-Dpackaging=${app.war.packaging}" />
<arg value="-Ddest=${ant.build.directory}/${app.war.artifactId}.${app.war.packaging}" />
</exec>
</target>
<target name="deleteWarFile">
<delete file="${app.package.path}" failonerror="true" />
</target>
<target name="deleteExplodedWar">
<delete dir="${app.folder}" failonerror="true" />
</target>
<target name="alfresco:amp" depends="unitTest">
<exec executable="${mvn.exec}" failonerror="true">
<arg value="clean" />
<arg value="install" />
<arg value="-DskipTests" />
<arg value="-Dminifyjs=${minifyjs}" />
<arg value="-PfullBuild" />
<arg value="alfresco:amp" />
</exec>
</target>
<target name="alfresco:install" depends="deleteWarFile, deleteExplodedWar, alfresco:amp, fetchWarFile">
<exec executable="${mvn.exec}" failonerror="true">
<arg value="alfresco:install" />
</exec>
</target>
<target name="alfresco:installEnterprise" depends="deleteWarFile, deleteExplodedWar, alfresco:amp, fetchEntpriseWarFile">
<exec executable="${mvn.exec}" failonerror="true">
<arg value="alfresco:install" />
<arg value="-Penterprise" />
</exec>
</target>
<target name="copyWarFileToTomcat">
<copy file="${ant.build.directory}/${app.package}" todir="${app.tomcat.webapps}" failonerror="true" />
</target>
<target name="fullBuildCommunity" depends="alfresco:install, copyWarFileToTomcat" description=""/>
<target name="fullBuildEnterprise" depends="alfresco:installEnterprise, copyWarFileToTomcat" description=""/>
<target name="copyWebDirectory" if="${web.directory.exists}">
<copy todir="${app.folder}" failonerror="true">
<fileset dir="${ant.source.web.directory}" />
</copy>
<xmlproperty file="../pom.xml" keepRoot="false"/>
<exec executable="${mvn.exec}" failonerror="true">
<arg value="dependency:get" />
<arg value="-DgroupId=${groupId}" />
<arg value="-DartifactId=aikau" />
<arg value="-Dversion=${alfresco.aikau.version}" />
<arg value="-Dpackaging=jar" />
<arg value="-Ddest=${app.folder}/WEB-INF/lib/" />
</exec>
</target>
<target name="package">
<fail message="Exploded webapp directory '${app.war.artifactId}' does not exist.">
<condition>
<not>
<available file="${app.folder}" type="dir"/>
</not>
</condition>
</fail>
<exec executable="${mvn.exec}" failonerror="true">
<arg value="package" />
<arg value="-DskipTests" />
</exec>
</target>
<target name="incrementalBuild" depends="package, unitTest" description="">
<xmlproperty file="pom.xml" keepRoot="false"/>
<copy file="${ant.build.directory}/${artifactId}.jar" tofile="${ant.build.directory}/${artifactId}-amp.jar" failonerror="true" />
<move file="${ant.build.directory}/${artifactId}-amp.jar" todir="${app.folder}/WEB-INF/lib" failonerror="true" />
<copy todir="${app.folder}/WEB-INF/classes" failonerror="true">
<fileset dir="${ant.config.directory}">
<exclude name="**/module.properties" />
<exclude name="**/file-mapping.properties" />
</fileset>
</copy>
<condition property="web.directory.exists">
<available file="${ant.source.web.directory}" type="dir" />
</condition>
<antcall target="copyWebDirectory"></antcall>
</target>
<target name="unitTest" />
</project>

View File

@@ -1,32 +1,36 @@
<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>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-rm-parent</artifactId>
<packaging>pom</packaging>
<version>2.4-SNAPSHOT</version>
<name>Alfresco Records Management</name>
<parent>
<groupId>org.alfresco.maven</groupId>
<artifactId>alfresco-sdk-parent</artifactId>
<version>2.0.0</version>
<version>2.1.1</version>
</parent>
<url>http://www.alfresco.org/</url>
<inceptionYear>2005</inceptionYear>
<organization>
<name>Alfresco Software</name>
<url>http://www.alfresco.org/</url>
</organization>
<licenses>
<license>
<name>LGPL 3</name>
</license>
</licenses>
<scm>
<connection>https://svn.alfresco.com/repos/alfresco-open-mirror/modules/recordsmanagement/HEAD</connection>
<developerConnection>https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD</developerConnection>
<url>https://fisheye.alfresco.com/changelog/alfresco-enterprise</url>
<connection>https://gitlab.alfresco.com/records-management/records-management.git</connection>
</scm>
<issueManagement>
<system>JIRA</system>
<url>https://issues.alfresco.com/jira/browse/RM</url>
@@ -37,7 +41,7 @@
</ciManagement>
<prerequisites>
<maven>3.0.4</maven>
<maven>3.2.5</maven>
</prerequisites>
<repositories>
@@ -45,6 +49,11 @@
<id>alfresco-internal</id>
<url>https://artifacts.alfresco.com/nexus/content/groups/private</url>
</repository>
<!-- We need this repository as 5.1 is not released yet. Once it is released we can delete this repository configuration. -->
<repository>
<id>alfresco-internal-staging</id>
<url>https://artifacts.alfresco.com/nexus/content/repositories/5.1-EA</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
@@ -64,8 +73,14 @@
</snapshotRepository>
</distributionManagement>
<!-- Here we realize the connection with the Alfresco selected platform (e.g.version and edition) -->
<dependencyManagement>
<dependencies>
<!--
This will import the dependencyManagement for all artifacts in the selected Alfresco version/edition
(see http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Importing_Dependencies)
NOTE: You still need to define dependencies in your POM, but you can omit version as it's enforced by this dependencyManagement. NOTE: It defaults
to the latest version this SDK pom has been tested with, but alfresco version can/should be overridden in your project's pom -->
<dependency>
<groupId>${alfresco.groupId}</groupId>
<artifactId>alfresco-platform-distribution</artifactId>
@@ -83,15 +98,7 @@
<properties>
<alfresco.version>5.1.d-EA</alfresco.version>
<app.war.location>${project.build.directory}/${webapp.id.name}.war</app.war.location>
<alfresco.base.version>${alfresco.version}</alfresco.base.version>
<!-- Database properties - default values to be overridden in settings.xml -->
<db.driver>org.postgresql.Driver</db.driver>
<db.url>jdbc:postgresql:${db.name}</db.url>
<db.master.url>jdbc:postgresql:template1</db.master.url>
<db.username>alfresco</db.username>
<db.password>alfresco</db.password>
<alfresco.rm.version>${project.version}</alfresco.rm.version>
<!-- Maven specific build properties -->
<maven.alfresco.includeDependencies>false</maven.alfresco.includeDependencies>
@@ -102,6 +109,7 @@
</properties>
<build>
<finalName>${project.artifactId}-${project.version}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -124,27 +132,35 @@
</executions>
</plugin>
<plugin>
<groupId>org.alfresco.maven.plugin</groupId>
<artifactId>alfresco-maven-plugin</artifactId>
<extensions>true</extensions>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>${maven.buildhelper.version}</version>
<executions>
<execution>
<id>add-test-source</id>
<goals>
<goal>add-test-source</goal>
</goals>
<configuration>
<sources>
<source>src/unit-test/java</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<backup>true</backup>
<ampLocation>${project.build.directory}/${project.build.finalName}-amp.amp</ampLocation>
<warLocation>${app.war.location}</warLocation>
<classifier>amp</classifier>
<attachClasses>true</attachClasses>
<includeDependencies>true</includeDependencies>
<includes>
<include>**/*UnitTest.java</include>
</includes>
</configuration>
</plugin>
</plugins>
<!-- Defining version and some configuration of Maven plugins -->
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>2.5</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
@@ -166,134 +182,7 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.1</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.1</version>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
</plugin>
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.3</version>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
</plugin>
<plugin>
<artifactId>maven-help-plugin</artifactId>
<version>2.2</version>
</plugin>
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.4.2</version>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.16</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.16</version>
<configuration>
<!-- To prevent tests alfresco.log to be created in project roots and bother while synchronizing with SCM -->
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<runOrder>alphabetical</runOrder>
<systemPropertyVariables>
<!-- Database related properties -->
<db.url>${db.url}</db.url>
<db.driver>${db.driver}</db.driver>
<db.name>${db.name}</db.name>
<db.username>${db.username}</db.username>
<db.password>${db.password}</db.password>
<dir.root>${basedir}/target/alf_test_data</dir.root>
</systemPropertyVariables>
</configuration>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
</plugin>
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<configuration>
<warSourceDirectory>source/web</warSourceDirectory>
<useCache>true</useCache>
</configuration>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>8.1.14.v20131031</version>
<configuration>
<webAppSourceDirectory>source/web</webAppSourceDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<dependencies>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-archiver</artifactId>
<version>2.3</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>sql-maven-plugin</artifactId>
<version>1.5</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.1</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.8</version>
</plugin>
<plugin>
<groupId>org.alfresco.maven.plugin</groupId>
<artifactId>alfresco-maven-plugin</artifactId>
<version>1.1.1</version>
</plugin>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>yuicompressor-maven-plugin</artifactId>
<version>1.3.2</version>
</plugin>
<!-- This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself. -->
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>

View File

@@ -1,8 +0,0 @@
# Do NOT change the values directly in this file. If you need to change the value of a property,
# create a file called "build.local.properties" in the same folder and change the value in that file.
# War file id for the alfresco application
app.war.artifactId=alfresco
# Tomcat folder name used by the alfresco application
app.tomcat=tomcat

View File

@@ -1,135 +0,0 @@
<?xml version="1.0"?>
<project name="rm-server" basedir=".">
<import file="../build.xml" />
<property file="../build.local.properties" />
<property file="../build.properties" />
<property file="build.local.properties" />
<property file="build.properties" />
<target name="createTargetDirectory">
<mkdir dir="target"/>
</target>
<target name="copyPostgresDBDriver">
<exec executable="${mvn.exec}" failonerror="true">
<arg value="dependency:get" />
<arg value="-DgroupId=postgresql" />
<arg value="-DartifactId=postgresql" />
<arg value="-Dversion=9.1-901.jdbc4" />
<arg value="-Dpackaging=jar" />
<arg value="-Ddest=${app.tomcat.folder}/lib" />
</exec>
</target>
<target name="copyMySqlDBDriver">
<exec executable="${mvn.exec}" failonerror="true">
<arg value="dependency:get" />
<arg value="-DgroupId=mysql" />
<arg value="-DartifactId=mysql-connector-java" />
<arg value="-Dversion=5.1.31" />
<arg value="-Dpackaging=jar" />
<arg value="-Ddest=${app.tomcat.folder}/lib" />
</exec>
</target>
<target name="copyDevContextFile">
<property name="devContextFile" value="../root/projects/repository/config/alfresco/extension/dev-context.xml" />
<copy file="${devContextFile}" todir="${app.tomcat.folder}/shared/classes/alfresco/extension" failonerror="true" />
<copy file="${devContextFile}" todir="config/alfresco/extension" failonerror="true" />
</target>
<target name="configureSolr4">
<xmlproperty file="../pom.xml" keepRoot="false"/>
<exec executable="${mvn.exec}" failonerror="true">
<arg value="dependency:get" />
<arg value="-DgroupId=${groupId}" />
<arg value="-DartifactId=alfresco-solr4" />
<arg value="-Dversion=${properties.alfresco.base.version}" />
<arg value="-Dclassifier=config-ssl" />
<arg value="-Dpackaging=zip" />
<arg value="-Ddest=${ant.build.directory}/solr4-config.zip" />
<arg value="-Dtransitive=false" />
</exec>
<exec executable="${mvn.exec}" failonerror="true">
<arg value="dependency:get" />
<arg value="-DgroupId=${groupId}" />
<arg value="-DartifactId=alfresco-repository" />
<arg value="-Dversion=${properties.alfresco.base.version}" />
<arg value="-Dpackaging=jar" />
<arg value="-Ddest=${ant.build.directory}/alfresco-repository.jar" />
</exec>
<exec executable="${mvn.exec}" failonerror="true">
<arg value="dependency:get" />
<arg value="-DgroupId=${groupId}" />
<arg value="-DartifactId=alfresco-solr4" />
<arg value="-Dversion=${properties.alfresco.base.version}" />
<arg value="-Dpackaging=war" />
<arg value="-Ddest=${ant.build.directory}/solr4.war" />
</exec>
<unzip src="${ant.build.directory}/solr4-config.zip" dest="${ant.build.directory}/solr4config"/>
<unzip src="${ant.build.directory}/alfresco-repository.jar" dest="${ant.build.directory}/alfresco-repository"/>
<copy todir="${ant.build.directory}/solr4config/keystore">
<fileset dir="${ant.build.directory}/alfresco-repository/alfresco/keystore" />
</copy>
<property name="solr.root.tmp" location="${basedir}/../../../data/solr4" />
<pathconvert property="solr.root" targetos="unix">
<path location="${solr.root.tmp}"/>
</pathconvert>
<replace file="${ant.build.directory}/solr4config/archive-SpacesStore/conf/solrcore.properties" summary="yes">
<replacefilter token="@@ALFRESCO_SOLR4_DATA_DIR@@" value="${solr.root}/index" />
</replace>
<replace file="${ant.build.directory}/solr4config/workspace-SpacesStore/conf/solrcore.properties" summary="yes">
<replacefilter token="@@ALFRESCO_SOLR4_DATA_DIR@@" value="${solr.root}/index" />
</replace>
<replace file="${ant.build.directory}/solr4config/context.xml" summary="yes">
<replacefilter token="@@ALFRESCO_SOLR4_DIR@@" value="${solr.root}config" />
</replace>
<replace file="${ant.build.directory}/solr4config/context.xml" summary="yes">
<replacefilter token="@@ALFRESCO_SOLR4_MODEL_DIR@@" value="${solr.root}/model" />
</replace>
<replace file="${ant.build.directory}/solr4config/context.xml" summary="yes">
<replacefilter token="@@ALFRESCO_SOLR4_CONTENT_DIR@@" value="${solr.root}/content" />
</replace>
<replace file="${app.tomcat.folder}/conf/server.xml" summary="yes">
<replacetoken><![CDATA[<!-- Alfresco SSL Connector placeholder -->]]></replacetoken>
<replacevalue><![CDATA[
<Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol" SSLEnabled="true"
maxThreads="150" scheme="https" keystoreFile="../../data/solr4config/keystore/ssl.keystore"
keystorePass="kT9X6oe68t" keystoreType="JCEKS"
secure="true" connectionTimeout="240000"
truststoreFile="../../data/solr4config/keystore/ssl.truststore"
truststorePass="kT9X6oe68t" truststoreType="JCEKS"
clientAuth="want" sslProtocol="TLS" allowUnsafeLegacyRenegotiation="true" maxHttpHeaderSize="32768" />]]></replacevalue>
</replace>
<propertyfile file="${solr.root}/../repository.properties">
<entry key="dir.keystore" value="${solr.root}config/keystore" />
<entry key="index.subsystem.name" value="solr4" />
<entry key="solr.port.ssl" value="8443" />
</propertyfile>
<copy file="${ant.build.directory}/solr4config/context.xml"
tofile="${app.tomcat.folder}/conf/Catalina/localhost/solr4.xml" />
<copy todir="${solr.root}config">
<fileset dir="${ant.build.directory}/solr4config" />
</copy>
<copy todir="${app.tomcat.webapps}/">
<fileset file="${ant.build.directory}/solr4.war" />
</copy>
</target>
<target name="prepareEnv" depends="createTargetDirectory, copyPostgresDBDriver, copyMySqlDBDriver, copyDevContextFile, configureSolr4" />
<target name="unitTest">
<exec executable="${mvn.exec}" failonerror="true">
<arg value="test" />
<arg value="-Dtest=AllUnitTestSuite" />
</exec>
</target>
</project>

View File

@@ -1 +0,0 @@
exclusions=org.alfresco.repo..*,org.alfresco.util..*,org.alfresco.workflow..*,org.alfresco.service..*

View File

@@ -1,22 +1,31 @@
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<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>
<artifactId>alfresco-rm-server</artifactId>
<name>Alfresco RM Server</name>
<packaging>amp</packaging>
<description>Manages the lifecycle of the alfresco-rm-server amp</description>
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-rm-parent</artifactId>
<version>2.4-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>alfresco-rm-server</artifactId>
<name>Alfresco RM Server</name>
<!-- <packaging>amp</packaging> -->
<properties>
<alfresco.client.contextPath>/alfresco</alfresco.client.contextPath>
<alfresco.data.location>${basedir}/target/alf_test_data</alfresco.data.location>
<alfresco.db.hibernate.dialect>org.hibernate.dialect.H2Dialect</alfresco.db.hibernate.dialect>
<alfresco.db.name>alfresco</alfresco.db.name>
<alfresco.db.username>alfresco</alfresco.db.username>
<alfresco.db.password>alfresco</alfresco.db.password>
<alfresco.db.host>localhost</alfresco.db.host>
<alfresco.repo.artifactId>alfresco</alfresco.repo.artifactId>
<alfresco.postgres.version>9.1-901.jdbc4</alfresco.postgres.version>
<alfresco.mysql.version>5.1.31</alfresco.mysql.version>
<webapp.id.name>alfresco</webapp.id.name>
<webapp.id>${webapp.id.name}</webapp.id>
<alfresco.rm.artifactId>alfresco-rm-server</alfresco.rm.artifactId>
<skip.integrationtests>true</skip.integrationtests>
<alfresco.solr.home>${project.build.directory}/solr/home</alfresco.solr.home>
</properties>
<build>
<sourceDirectory>source/java</sourceDirectory>
@@ -28,14 +37,13 @@
</resources>
<testResources>
<testResource>
<directory>test/resources</directory>
<directory>unit-test/resources</directory>
</testResource>
<testResource>
<directory>unit-test/resources</directory>
<directory>test/resources</directory>
</testResource>
</testResources>
<plugins>
<!-- Additional source folder to be added: source/compatibility -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
@@ -65,21 +73,137 @@
</executions>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<copy todir="${project.build.directory}/${project.build.finalName}/config/alfresco">
<fileset dir="${project.build.outputDirectory}/alfresco"/>
</copy>
<move file="${project.build.directory}/${project.build.finalName}/config/alfresco/module/org_alfresco_module_rm/module.properties"
todir="${project.build.directory}/${project.build.finalName}"/>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-2</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>${basedir}/src/main/resources/local.properties</file>
</files>
<quiet>true</quiet>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<properties>
<property>
<name>usedefaultlisteners</name>
<value>false</value>
</property>
<property>
<name>listener</name>
<value>org.uncommons.reportng.HTMLReporter, org.uncommons.reportng.JUnitXMLReporter</value>
</property>
</properties>
<suiteXmlFiles>
<suiteXmlFile>${project.build.testOutputDirectory}/testng.xml</suiteXmlFile>
</suiteXmlFiles>
<includes>
<include>**/AllUnitTestSuite.class</include>
</includes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.19</version>
<executions>
<execution>
<id>integration-tests</id>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<skipTests>${skip.integrationtests}</skipTests>
<includes>
<include>**/AllTestSuite.class</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
<!-- Fetch and unpack Alfresco Repository/Share WAR (alfresco.war or share.war) -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack-alfresco</id>
<phase>prepare-package</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<outputDirectory>${app.amp.client.war.folder}</outputDirectory>
<artifactItems>
<artifactItem>
<groupId>${alfresco.groupId}</groupId>
<artifactId>${app.amp.client.war.artifactId}</artifactId>
<type>war</type>
<version>${alfresco.version}</version>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<!-- The current AMP artifact is installed into the Alfresco.war or share.war
using alfresco-maven-plugin -->
<plugin>
<groupId>org.alfresco.maven.plugin</groupId>
<artifactId>alfresco-maven-plugin</artifactId>
<executions>
<execution>
<id>attach-rm-jar</id>
<goals>
<goal>amp</goal>
</goals>
<configuration>
<attachClasses>true</attachClasses>
<includeDependencies>true</includeDependencies>
</configuration>
</execution>
<execution>
<id>install-rm-amp</id>
<goals>
<goal>install</goal>
</goals>
<phase>package</phase>
<configuration>
<backup>true</backup>
<ampLocation>${project.build.directory}/${alfresco.rm.artifactId}-${alfresco.rm.version}.amp</ampLocation>
</configuration>
</execution>
<execution>
<id>amps-to-war-overlay</id>
<phase>package</phase>
<goals>
<goal>install</goal>
</goals>
</execution>
</executions>
<configuration>
<!-- We need to selectively not install web resources (i.e. /web folder in AMP),
so these files can be picked up directly from the build project instead,
enabling rapid application dev -->
</configuration>
</plugin>
<plugin>
@@ -92,136 +216,160 @@
</goals>
</execution>
</executions>
<configuration>
<excludes>
<exclude>**/alfresco-global.properties</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<versionRange>[1.0-alpha-2,)</versionRange>
<goals>
<goal>read-project-properties</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<dependencies>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.3.1</version>
</dependency>
<!-- Alfresco dependencies -->
<dependency>
<groupId>${alfresco.groupId}</groupId>
<artifactId>alfresco-remote-api</artifactId>
</dependency>
<!-- Test dependencies -->
<dependency>
<groupId>io.takari.junit</groupId>
<artifactId>takari-cpsuite</artifactId>
<version>1.2.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.extensions.surf</groupId>
<artifactId>spring-webscripts</artifactId>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>2.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${alfresco.groupId}</groupId>
<artifactId>alfresco-repository</artifactId>
<version>${alfresco.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${alfresco.groupId}</groupId>
<artifactId>alfresco-remote-api</artifactId>
<version>${alfresco.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<!-- Database drivers -->
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${alfresco.postgres.version}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
<groupId>${alfresco.groupId}</groupId>
<artifactId>alfresco-repository</artifactId>
<version>${alfresco.version}</version>
<classifier>h2scripts</classifier>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<profiles>
<profile>
<id>wipeDB</id>
<build>
<plugins>
<!-- Wipe the database before starting tests -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>sql-maven-plugin</artifactId>
<configuration>
<autocommit>true</autocommit>
<driver>${db.driver}</driver>
<url>${db.master.url}</url>
<username>${db.username}</username>
<password>${db.password}</password>
</configuration>
<dependencies>
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${alfresco.postgres.version}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${alfresco.mysql.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>wipe-database</id>
<phase>process-test-resources</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<sqlCommand>drop database if exists alfresco</sqlCommand>
</configuration>
</execution>
<execution>
<id>create-database</id>
<phase>process-test-resources</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<sqlCommand>create database alfresco</sqlCommand>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>fullBuild</id>
<build>
<plugins>
<plugin>
<groupId>org.alfresco.maven.plugin</groupId>
<artifactId>alfresco-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>amp</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<dependencies>
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${alfresco.postgres.version}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${alfresco.mysql.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<delete file="${project.build.outputDirectory}/alfresco/extension/dev-context.xml"/>
<copy todir="${project.build.directory}/${project.build.finalName}/config/alfresco">
<fileset dir="${project.build.outputDirectory}/alfresco"/>
</copy>
<move file="${project.build.directory}/${project.build.finalName}/config/alfresco/module/org_alfresco_module_rm/module.properties"
todir="${project.build.directory}/${project.build.finalName}"/>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>appWarLocationSetting</id>
<id>use-mysql</id>
<properties>
<app.war.location>${project.build.directory}/${project.build.finalName}-war</app.war.location>
<alfresco.db.name>${my.db.name}</alfresco.db.name>
<alfresco.db.port>${my.db.port}</alfresco.db.port>
<alfresco.db.hibernate.dialect>org.hibernate.dialect.MySQLInnoDBDialect</alfresco.db.hibernate.dialect>
<alfresco.db.params></alfresco.db.params>
<alfresco.db.url>jdbc:mysql://${alfresco.db.host}:${alfresco.db.port}/${alfresco.db.name}</alfresco.db.url>
<alfresco.db.datasource.class>org.gjt.mm.mysql.Driver</alfresco.db.datasource.class>
</properties>
</profile>
<profile>
<id>enterprise</id>
<id>use-postgres</id>
<properties>
<webapp.id>alfresco-enterprise</webapp.id>
<alfresco.db.name>${my.db.name}</alfresco.db.name>
<alfresco.db.port>${my.db.port}</alfresco.db.port>
<alfresco.db.hibernate.dialect>org.hibernate.dialect.PostgreSQLDialect</alfresco.db.hibernate.dialect>
<alfresco.db.params></alfresco.db.params>
<alfresco.db.url>jdbc:postgresql:${alfresco.db.name}</alfresco.db.url>
<alfresco.db.datasource.class>org.postgresql.Driver</alfresco.db.datasource.class>
</properties>
</profile>
<profile>
<id>amp-with-solr</id>
<properties>
<skipTests>true</skipTests>
<alfresco.solr.home>${project.build.directory}/solr/home</alfresco.solr.home>
</properties>
<id>start-alfresco</id>
<build>
<plugins>
<!-- Fetch and unpack Alfresco Repository / Share / Solr in the target / folder -->
@@ -236,13 +384,13 @@
<goal>unpack</goal>
</goals>
<configuration>
<outputDirectory>${alfresco.client.war.folder}</outputDirectory>
<outputDirectory>${app.amp.client.war.folder}</outputDirectory>
<artifactItems>
<artifactItem>
<groupId>${alfresco.client.war.groupId}</groupId>
<artifactId>${alfresco.client.war}</artifactId>
<groupId>${alfresco.groupId}</groupId>
<artifactId>${alfresco.repo.artifactId}</artifactId>
<type>war</type>
<version>${alfresco.client.war.version}</version>
<version>${alfresco.version}</version>
</artifactItem>
</artifactItems>
</configuration>
@@ -303,7 +451,7 @@
<name>solrHomePath</name>
<value>${alfresco.solr.home}</value>
<regex>\\</regex>
<replacement>/</replacement>
<replacement>\\\\</replacement>
<failIfNoMatch>false</failIfNoMatch>
</configuration>
</execution>
@@ -323,28 +471,29 @@
</execution>
</executions>
<configuration>
<regex>false</regex>
<includes>
<include>${alfresco.solr.home}/context.xml</include>
<include>${alfresco.solr.home}/archive-SpacesStore/conf/solrcore.properties</include>
<include>${alfresco.solr.home}/workspace-SpacesStore/conf/solrcore.properties</include>
<include>${alfresco.client.war.folder}/WEB-INF/web.xml</include>
<include>${app.amp.client.war.folder}/WEB-INF/web.xml</include>
</includes>
<replacements>
<replacement>
<token>@@ALFRESCO_SOLR4_DIR@@</token>
<value>${alfresco.solr.home}/</value>
<value>${solrHomePath}/</value>
</replacement>
<replacement>
<token>@@ALFRESCO_SOLR4_MODEL_DIR@@</token>
<value>${alfresco.solr.home}/alfrescoModels/</value>
<value>${solrHomePath}/alfrescoModels/</value>
</replacement>
<replacement>
<token>@@ALFRESCO_SOLR4_CONTENT_DIR@@</token>
<value>${alfresco.solr.home}/data/content/</value>
<value>${solrHomePath}/data/content/</value>
</replacement>
<replacement>
<token>@@ALFRESCO_SOLR4_DATA_DIR@@</token>
<value>${alfresco.solr.home}/data/index/</value>
<value>${solrHomePath}/data/index/</value>
</replacement>
<replacement>
<token><![CDATA[<!-- Toggle securecomms placeholder start -->]]></token>
@@ -393,6 +542,7 @@
</plugin>
</plugins>
</build>
<!--
<dependencies>
<dependency>
<groupId>org.alfresco.maven</groupId>
@@ -400,98 +550,63 @@
<version>${maven.alfresco.version}</version>
</dependency>
</dependencies>
-->
</profile>
<profile>
<id>wipeDB</id>
<build>
<plugins>
<!-- Wipe the database before starting tests -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>sql-maven-plugin</artifactId>
<version>1.5</version>
<configuration>
<autocommit>true</autocommit>
<driver>${alfresco.db.datasource.class}</driver>
<url>${alfresco.db.master.url}</url>
<username>${alfresco.db.username}</username>
<password>${alfresco.db.password}</password>
</configuration>
<dependencies>
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${alfresco.postgres.version}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${alfresco.mysql.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>wipe-database</id>
<phase>process-test-resources</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<sqlCommand>drop database if exists alfresco</sqlCommand>
</configuration>
</execution>
<execution>
<id>create-database</id>
<phase>process-test-resources</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<sqlCommand>create database alfresco</sqlCommand>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.3.1</version>
</dependency>
<!-- Alfresco dependencies -->
<dependency>
<groupId>org.alfresco</groupId>
<artifactId>${webapp.id}</artifactId>
<version>${alfresco.base.version}</version>
<type>war</type>
</dependency>
<dependency>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-remote-api</artifactId>
</dependency>
<!-- Test dependencies -->
<dependency>
<groupId>io.takari.junit</groupId>
<artifactId>takari-cpsuite</artifactId>
<version>1.2.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.extensions.surf</groupId>
<artifactId>spring-webscripts</artifactId>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>2.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-repository</artifactId>
<version>${alfresco.base.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-remote-api</artifactId>
<version>${alfresco.base.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.alfresco.test</groupId>
<artifactId>alfresco-testng</artifactId>
<version>1.1</version>
<scope>test</scope>
</dependency>
<!-- Database drivers -->
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${alfresco.postgres.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>test</scope>
</dependency>
<!-- Dependencies for the test result reports -->
<dependency>
<groupId>org.uncommons</groupId>
<artifactId>reportng</artifactId>
<version>1.1.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>3.0</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>

View File

@@ -1,9 +0,0 @@
#!/bin/bash
# Downloads the spring-loaded lib if not existing and runs repository AMP
springloadedfile=~/.m2/repository/org/springframework/springloaded/1.2.0.RELEASE/springloaded-1.2.0.RELEASE.jar
if [ ! -f $springloadedfile ]; then
mvn validate -Psetup
fi
MAVEN_OPTS="-javaagent:$springloadedfile -noverify -Xms256m -Xmx2G -XX:PermSize=300m" mvn clean integration-test -PappWarLocationSetting,fullBuild,amp-with-solr -Dsolr.secureComms=none

View File

@@ -106,6 +106,7 @@ public final class RMCollectionUtils
* @param <T> the element type.
* @return a Serializable List containing all the provided elements.
*/
@SuppressWarnings("unchecked")
@SafeVarargs
public static <T extends Serializable, LIST extends Serializable & List<T>>
LIST asSerializableList(T... elements)

View File

@@ -0,0 +1,72 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# RUN TIME PROPERTIES
# -------------------
########################################################################################################################
# Alfresco configuration for running locally
#
# Configuration when running Tomcat embedded from Maven.
# This will create the alf_data_dev directory relative to Tomcat run folder.
# Property values from the POM but it can also be edited here.
########################################################################################################################
dir.root=${alfresco.data.location}
# Alfresco Repo Webapp (alfresco.war) context, ports etc
alfresco.context=alfresco
alfresco.host=localhost
alfresco.port=8080
alfresco.protocol=http
# Alfresco Share Webapp (share.war) context, ports etc
share.context=share
share.host=localhost
share.port=8080
share.protocol=http
# Validates and auto-recover if validation fails
index.recovery.mode=AUTO
# As we run embedded, we set Lucene
# TODO: Find a better solution for indexing, as buildonly (embedded Lucene) is deprecated and going to be removed soon
index.subsystem.name=buildonly
# These jobs seem to require Lucene (Unsupported Operation with Solr) so we disable them / set to future date
# See https://forums.alfresco.com/en/viewtopic.php?f=52&t=41597
# If you want to enable them (and so full WQS functionality), please also set index.subsystem.name=lucene
wcmqs.dynamicCollectionProcessor.schedule=0 30 2 * * ? 2060
wcmqs.feedbackProcessor.schedule=0 40 2 * * ? 2060
wcmqs.publishQueueProcessor.schedule=0 50 2 * * ? 2060
# Fail or not when there are node integrity checker errors
integrity.failOnError=true
# Database connection properties
db.driver=${alfresco.db.datasource.class}
db.url=${alfresco.db.url}
db.username=${alfresco.db.username}
db.password=${alfresco.db.password}
db.pool.initial=10
db.pool.max=100
hibernate.dialect=${alfresco.db.hibernate.dialect}
# File servers related properties
# For local runs we disable CIFS and FTP
cifs.enabled=false
ftp.enabled=false
# Solr config
index.subsystem.name=solr4
solr.secureComms=none

View File

@@ -40,7 +40,6 @@ import org.alfresco.service.cmr.repository.ContentWriter;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.StoreRef;
import org.alfresco.service.namespace.QName;
import org.alfresco.test.AlfrescoTest;
import org.alfresco.util.GUID;
/**
@@ -81,7 +80,6 @@ public class DestroyContentTest extends BaseRMTestCase
* Then the record folder and records are ghosted
* And the content is destroyed
*/
@AlfrescoTest (jira="RM-2506")
public void testRecordFolderDestroy() throws Exception
{
doBehaviourDrivenTest(new BehaviourDrivenTest()
@@ -162,7 +160,6 @@ public class DestroyContentTest extends BaseRMTestCase
* Then the record is ghosted
* And the content is destroyed
*/
@AlfrescoTest (jira="RM-2506")
public void testRecordDestroy() throws Exception
{
doBehaviourDrivenTest(new BehaviourDrivenTest()
@@ -232,7 +229,6 @@ public class DestroyContentTest extends BaseRMTestCase
* And the content is cleansed
* And then content is destroyed
*/
@AlfrescoTest (jira="RM-2505")
public void testRecordDestroyAndCleanse() throws Exception
{
doBehaviourDrivenTest(new BehaviourDrivenTest()
@@ -303,7 +299,6 @@ public class DestroyContentTest extends BaseRMTestCase
* When a unclassified document (non-record) is deleted
* Then it is deleted but the the content is not immediately destroyed
*/
@AlfrescoTest (jira="RM-2507")
public void testContentDelete() throws Exception
{
doBehaviourDrivenTest(new BehaviourDrivenTest()

View File

@@ -1,10 +0,0 @@
<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
<suite name="JUnit AllTestSuite" verbose="1" >
<test name="AllTests" junit="true">
<classes>
<class name="org.alfresco.module.org_alfresco_module_rm.test.AllUnitTestSuite" />
<class name="org.alfresco.module.org_alfresco_module_rm.test.AllTestSuite" />
</classes>
</test>
</suite>

View File

@@ -1,7 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<Context docBase="${alfresco.client.war.folder}" path="${alfresco.client.contextPath}">
<!-- ===================================================================================================================
This context file is used only in a development IDE for rapid development,
it is never released with the Alfresco.war
=================================================================================================================-->
<!-- Setup docBase to something like repo-amp/target/repo-amp-war
and path to /alfresco
The Alfresco.war 5.0 does not have a webapp (it used to have Alfresco Explorer but not anymore)
that we will access, so this docBase might not be needed
-->
<Context docBase="${app.amp.client.war.folder}" path="${alfresco.client.contextPath}">
<Resources className="org.apache.naming.resources.VirtualDirContext"
extraResourcePaths="/=${project.build.directory}/${project.build.finalName}/web" />
<Loader searchVirtualFirst="true" className="org.apache.catalina.loader.VirtualWebappLoader"
virtualClasspath="${project.build.outputDirectory};${project.build.testOutputDirectory};${project.build.directory}/${project.build.finalName}/config" />
</Context>
extraResourcePaths="/=${project.build.directory}/${project.build.finalName}/web" />
<!-- Setup the virtual class path like this:
1) target/classes
2) target/${project.build.finalName}/config
3) target/test-classes
This way mvn compile can be invoked and all changes will be picked up
-->
<Loader searchVirtualFirst="true"
className="org.apache.catalina.loader.VirtualWebappLoader"
virtualClasspath="${project.build.outputDirectory};${project.build.directory}/${project.build.finalName}/config;${project.build.testOutputDirectory}" />
<!-- This enables hot reloading of web resources from uncompressed jars (while in prod they would be loaded from WEB-INF/lib/{\*.jar}/META-INF/resources -->
<JarScanner scanAllDirectories="true" />
</Context>

View File

@@ -21,10 +21,10 @@ package org.alfresco.module.org_alfresco_module_rm.recorded.version.config;
import static org.alfresco.module.org_alfresco_module_rm.version.RecordableVersionPolicy.ALL;
import static org.alfresco.module.org_alfresco_module_rm.version.RecordableVersionPolicy.MAJOR_ONLY;
import static org.alfresco.module.org_alfresco_module_rm.version.RecordableVersionPolicy.NONE;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.doReturn;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertTrue;
import java.util.ArrayList;
import java.util.Arrays;

View File

@@ -20,9 +20,9 @@ package org.alfresco.module.org_alfresco_module_rm.recorded.version.config;
import static org.alfresco.module.org_alfresco_module_rm.script.slingshot.RecordedVersionConfigPost.RECORDED_VERSION;
import static org.alfresco.module.org_alfresco_module_rm.version.RecordableVersionPolicy.ALL;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.mockito.Mockito.doReturn;
import static org.testng.Assert.assertEquals;
import java.util.Map;

View File

@@ -23,7 +23,6 @@ import static com.google.common.collect.Sets.newHashSet;
import static java.util.Arrays.asList;
import static java.util.Collections.emptyList;
import static org.alfresco.module.org_alfresco_module_rm.test.util.ExceptionUtils.expectedException;
import static org.alfresco.module.org_alfresco_module_rm.util.RMCollectionUtils.asSerializableList;
import static org.alfresco.module.org_alfresco_module_rm.util.RMCollectionUtils.asSet;
import static org.alfresco.module.org_alfresco_module_rm.util.RMCollectionUtils.diffKey;
import static org.alfresco.module.org_alfresco_module_rm.util.RMCollectionUtils.head;
@@ -32,6 +31,7 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
@@ -107,8 +107,8 @@ public class RMCollectionUtilsUnitTest
@Test public void elementsAsSerializableList()
{
// If these lines compile, then we're good
Serializable s = asSerializableList("one", "two", "three");
List<String> l = asSerializableList("one", "two", "three");
Serializable s = RMCollectionUtils.<String, ArrayList<String>>asSerializableList("one", "two", "three");
List<String> l = RMCollectionUtils.<String, ArrayList<String>>asSerializableList("one", "two", "three");
assertEquals(s, l);
}

View File

@@ -53,7 +53,7 @@ import org.springframework.extensions.webscripts.GUID;
/**
* Extended versionable aspect unit test.
*
*
* @author Roy Wetherall
* @since 2.3.1
*/
@@ -61,29 +61,29 @@ public class ExtendedVersionableAspectUnitTest implements RecordsManagementModel
{
/** Transaction resource key */
private static final String KEY_VERSIONED_NODEREFS = "versioned_noderefs";
/** test data */
private NodeRef nodeRef = new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, GUID.generate());
private NodeRef anotherNodeRef = new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, GUID.generate());
private QName oldType = QName.createQName(RM_URI, GUID.generate());
private QName newType = QName.createQName(RM_URI, GUID.generate());
/** service mocks */
private @Mock NodeService mockedNodeService;
private @Mock VersionService mockedVersionService;
private @Mock LockService mockedLockService;
private @Mock AlfrescoTransactionSupport mockedAlfrescoTransactionSupport;
private @Mock AuthenticationUtil mockedAuthenticationUtil;
/** test instance of extended versionable aspect behaviour bean */
private @InjectMocks ExtendedVersionableAspect extendedVersionableAspect;
@SuppressWarnings("unchecked")
@Before
public void testSetup()
{
MockitoAnnotations.initMocks(this);
// just do the work
doAnswer(new Answer<Object>()
{
@@ -95,10 +95,10 @@ public class ExtendedVersionableAspectUnitTest implements RecordsManagementModel
return work.doWork();
}
}).when(mockedAuthenticationUtil).runAsSystem(any(RunAsWork.class));
}).when(mockedAuthenticationUtil).runAsSystem((RunAsWork<Object>) any(RunAsWork.class));
}
/**
/**
* given that autoversion on type change is configured off
* when the type set behvaiour is executed
* then a new version is not created
@@ -109,14 +109,14 @@ public class ExtendedVersionableAspectUnitTest implements RecordsManagementModel
{
// auto version off
extendedVersionableAspect.setAutoVersionOnTypeChange(false);
// execute behaviour
extendedVersionableAspect.onSetNodeType(nodeRef, oldType, newType);
// assert the version was not created
verify(mockedVersionService, never()).createVersion(eq(nodeRef), any(Map.class));
}
/**
* given the node doesn't exist
* when the type set behaviour is executed
@@ -128,18 +128,18 @@ public class ExtendedVersionableAspectUnitTest implements RecordsManagementModel
{
// auto version on
extendedVersionableAspect.setAutoVersionOnTypeChange(true);
// node does not exist
when(mockedNodeService.exists(nodeRef))
.thenReturn(false);
// execute behaviour
extendedVersionableAspect.onSetNodeType(nodeRef, oldType, newType);
// assert the version was not created
verify(mockedVersionService, never()).createVersion(eq(nodeRef), any(Map.class));
}
/**
* given that the node is locked
* when the type set behaviour is executed
@@ -151,25 +151,25 @@ public class ExtendedVersionableAspectUnitTest implements RecordsManagementModel
{
// auto version on
extendedVersionableAspect.setAutoVersionOnTypeChange(true);
// node does exists
when(mockedNodeService.exists(nodeRef))
.thenReturn(true);
// node is locked
when(mockedLockService.getLockStatus(nodeRef))
.thenReturn(LockStatus.LOCKED);
// execute behaviour
extendedVersionableAspect.onSetNodeType(nodeRef, oldType, newType);
// verify other
verify(mockedNodeService).exists(nodeRef);
// assert the version was not created
verify(mockedVersionService, never()).createVersion(eq(nodeRef), any(Map.class));
}
/**
* given that the node does not have the versionable aspect
* when the type set behaviour is executed
@@ -181,31 +181,31 @@ public class ExtendedVersionableAspectUnitTest implements RecordsManagementModel
{
// auto version on
extendedVersionableAspect.setAutoVersionOnTypeChange(true);
// node does exists
when(mockedNodeService.exists(nodeRef))
.thenReturn(true);
// node is not locked
when(mockedLockService.getLockStatus(nodeRef))
.thenReturn(LockStatus.NO_LOCK);
// node does not have the versionable aspect
when(mockedNodeService.hasAspect(nodeRef, ContentModel.ASPECT_VERSIONABLE))
.thenReturn(false);
// execute behaviour
extendedVersionableAspect.onSetNodeType(nodeRef, oldType, newType);
// verify other
verify(mockedNodeService).exists(nodeRef);
verify(mockedLockService).getLockStatus(nodeRef);
// assert the version was not created
verify(mockedVersionService, never()).createVersion(eq(nodeRef), any(Map.class));
}
/**
/**
* given that the node has the temporary aspect
* when the type set behaviour is executed
* then a new version is not created
@@ -216,36 +216,36 @@ public class ExtendedVersionableAspectUnitTest implements RecordsManagementModel
{
// auto version on
extendedVersionableAspect.setAutoVersionOnTypeChange(true);
// node does exists
when(mockedNodeService.exists(nodeRef))
.thenReturn(true);
// node is not locked
when(mockedLockService.getLockStatus(nodeRef))
.thenReturn(LockStatus.NO_LOCK);
// node has the versionable aspect
when(mockedNodeService.hasAspect(nodeRef, ContentModel.ASPECT_VERSIONABLE))
.thenReturn(true);
// node has the temporary aspect
when(mockedNodeService.hasAspect(nodeRef, ContentModel.ASPECT_TEMPORARY))
.thenReturn(true);
// execute behaviour
extendedVersionableAspect.onSetNodeType(nodeRef, oldType, newType);
// verify other
verify(mockedNodeService).exists(nodeRef);
verify(mockedLockService).getLockStatus(nodeRef);
verify(mockedNodeService).hasAspect(nodeRef, ContentModel.ASPECT_VERSIONABLE);
// assert the version was not created
verify(mockedVersionService, never()).createVersion(eq(nodeRef), any(Map.class));
}
/**
/**
* given that the node is already being versioned
* when the type set behvaiour is executed
* then a new version is not created
@@ -256,40 +256,40 @@ public class ExtendedVersionableAspectUnitTest implements RecordsManagementModel
{
// auto version on
extendedVersionableAspect.setAutoVersionOnTypeChange(true);
// node does exists
when(mockedNodeService.exists(nodeRef))
.thenReturn(true);
// node is not locked
when(mockedLockService.getLockStatus(nodeRef))
.thenReturn(LockStatus.NO_LOCK);
// node has the versionable aspect
when(mockedNodeService.hasAspect(nodeRef, ContentModel.ASPECT_VERSIONABLE))
.thenReturn(true);
// node does not have the temporary aspect
when(mockedNodeService.hasAspect(nodeRef, ContentModel.ASPECT_TEMPORARY))
.thenReturn(false);
// node is currently being processed for versioning
when(mockedAlfrescoTransactionSupport.getResource(KEY_VERSIONED_NODEREFS))
.thenReturn(Collections.singletonMap(nodeRef, nodeRef));
// execute behaviour
extendedVersionableAspect.onSetNodeType(nodeRef, oldType, newType);
// verify other
verify(mockedNodeService).exists(nodeRef);
verify(mockedLockService).getLockStatus(nodeRef);
verify(mockedNodeService).hasAspect(nodeRef, ContentModel.ASPECT_VERSIONABLE);
verify(mockedNodeService).hasAspect(nodeRef, ContentModel.ASPECT_TEMPORARY);
// assert the version was not created
verify(mockedVersionService, never()).createVersion(eq(nodeRef), any(Map.class));
}
/**
* given that the node has the auto version property set to false
* when the type set behaviour is executed
@@ -301,41 +301,41 @@ public class ExtendedVersionableAspectUnitTest implements RecordsManagementModel
{
// auto version on
extendedVersionableAspect.setAutoVersionOnTypeChange(true);
// node does exists
when(mockedNodeService.exists(nodeRef))
.thenReturn(true);
// node is not locked
when(mockedLockService.getLockStatus(nodeRef))
.thenReturn(LockStatus.NO_LOCK);
// node has the versionable aspect
when(mockedNodeService.hasAspect(nodeRef, ContentModel.ASPECT_VERSIONABLE))
.thenReturn(true);
// node does not have the temporary aspect
when(mockedNodeService.hasAspect(nodeRef, ContentModel.ASPECT_TEMPORARY))
.thenReturn(false);
// node is not being processed for versioning
when(mockedAlfrescoTransactionSupport.getResource(KEY_VERSIONED_NODEREFS))
.thenReturn(Collections.singletonMap(anotherNodeRef, anotherNodeRef));
// auto version false
when(mockedNodeService.getProperty(nodeRef, ContentModel.PROP_AUTO_VERSION))
.thenReturn(Boolean.FALSE);
// execute behaviour
extendedVersionableAspect.onSetNodeType(nodeRef, oldType, newType);
// verify other
verify(mockedNodeService).exists(nodeRef);
verify(mockedLockService).getLockStatus(nodeRef);
verify(mockedNodeService).hasAspect(nodeRef, ContentModel.ASPECT_VERSIONABLE);
verify(mockedNodeService).hasAspect(nodeRef, ContentModel.ASPECT_TEMPORARY);
verify(mockedAlfrescoTransactionSupport).getResource(KEY_VERSIONED_NODEREFS);
// assert the version was not created
verify(mockedVersionService, never()).createVersion(eq(nodeRef), any(Map.class));
}
@@ -357,34 +357,34 @@ public class ExtendedVersionableAspectUnitTest implements RecordsManagementModel
{
// auto version on
extendedVersionableAspect.setAutoVersionOnTypeChange(true);
// node does exists
when(mockedNodeService.exists(nodeRef))
.thenReturn(true);
// node is not locked
when(mockedLockService.getLockStatus(nodeRef))
.thenReturn(LockStatus.NO_LOCK);
// node has the versionable aspect
when(mockedNodeService.hasAspect(nodeRef, ContentModel.ASPECT_VERSIONABLE))
.thenReturn(true);
// node does not have the temporary aspect
when(mockedNodeService.hasAspect(nodeRef, ContentModel.ASPECT_TEMPORARY))
.thenReturn(false);
// node is not being processed for versioning
when(mockedAlfrescoTransactionSupport.getResource(KEY_VERSIONED_NODEREFS))
.thenReturn(new HashMap<NodeRef, NodeRef>(Collections.singletonMap(anotherNodeRef, anotherNodeRef)));
// auto version false
when(mockedNodeService.getProperty(nodeRef, ContentModel.PROP_AUTO_VERSION))
.thenReturn(Boolean.TRUE);
// execute behaviour
extendedVersionableAspect.onSetNodeType(nodeRef, oldType, newType);
// verify other
verify(mockedNodeService).exists(nodeRef);
verify(mockedLockService).getLockStatus(nodeRef);
@@ -392,9 +392,9 @@ public class ExtendedVersionableAspectUnitTest implements RecordsManagementModel
verify(mockedNodeService).hasAspect(nodeRef, ContentModel.ASPECT_TEMPORARY);
verify(mockedAlfrescoTransactionSupport, times(2)).getResource(KEY_VERSIONED_NODEREFS);
verify(mockedNodeService).getProperty(nodeRef, ContentModel.PROP_AUTO_VERSION);
// assert the version was not created
verify(mockedVersionService).createVersion(eq(nodeRef), any(Map.class));
}
}