issue 123: enabled jrebel support for amp-archetype and added alfresco-rad module to provide remote running of JUnit tests. Switched demo test to using spring annotation as it works on alfresco 4.2.0, both for remote and local running of JUnit. The -Pamp-to-war profile adds the relevant JUnit listener (jetty) which listens for the class name and method, using junit-remote (https://github.com/Tradeshift/junit-remote)

git-svn-id: http://maven-alfresco-archetypes.googlecode.com/svn/trunk@719 04253f4f-3451-0410-a141-5562f1e59037
This commit is contained in:
mindthegab
2013-11-04 22:51:56 +00:00
parent e3aeee2310
commit 3c4d153f3d
6 changed files with 96 additions and 40 deletions
@@ -61,9 +61,9 @@
</includes>
</fileSet>
<fileSet filtered="false" encoding="UTF-8">
<directory>src/test/properties</directory>
<directory>src/test/resources</directory>
<includes>
<include>**/*.properties</include>
<include>**/*</include>
</includes>
</fileSet>
<fileSet filtered="false" encoding="UTF-8">
+34
View File
@@ -0,0 +1,34 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>alfresco-rad</artifactId>
<packaging>jar</packaging>
<name>alfresco-rad</name>
<parent>
<groupId>org.alfresco.maven</groupId>
<artifactId>alfresco-lifecycle-aggregator</artifactId>
<version>1.0.3-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<dependencies>
<!-- Enables JUnit remote testing (using JRebel) -->
<dependency>
<groupId>com.tradeshift</groupId>
<artifactId>junit-remote</artifactId>
<version>3</version>
<type>jar</type>
</dependency>
<!-- Required to have annotation based remote testing working -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>3.0.6.RELEASE</version>
<type>jar</type>
</dependency>
</dependencies>
</project>
@@ -0,0 +1,16 @@
package org.alfresco.maven.rad;
import com.tradeshift.test.remote.RemoteServer;
public class RemoteRunnerWrapper implements Runnable {
public void run() {
try {
RemoteServer.main(new String []{});
} catch (Exception e) {
System.out.println("Could not start JUnit remoteServer");
}
}
}
@@ -0,0 +1,29 @@
<?xml version='1.0' encoding='UTF-8'?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements.
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.
-->
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<bean id="remoteRunnnerWrapper" class="org.alfresco.maven.rad.RemoteRunnerWrapper"/>
<bean id="remoteRunnnerWrapperThread" class="java.lang.Thread" init-method="start" destroy-method="interrupt">
<constructor-arg ref="remoteRunnnerWrapper"/>
</bean>
</beans>
+2
View File
@@ -76,6 +76,8 @@
<!-- All the modules of the Maven Alfresco SDK -->
<modules>
<!-- Modules -->
<module>modules/alfresco-rad</module>
<!-- Plugins -->
<module>plugins/alfresco-maven-plugin</module>
<!-- POM files -->
+13 -38
View File
@@ -419,19 +419,12 @@
<phase>process-test-resources</phase>
<goals><goal>copy-resources</goal></goals>
<configuration>
<!-- <outputDirectory>${app.amp.test.output.folder}</outputDirectory> -->
<outputDirectory>${project.build.testOutputDirectory}</outputDirectory>
<resources>
<resource>
<directory>${app.amp.folder}/config</directory>
<filtering>${app.filtering.enabled}</filtering>
</resource>
<resource>
<directory>${app.amp.folder}</directory>
<includes><include>module.properties</include></includes>
<targetPath>alfresco/module/${project.artifactId}</targetPath>
<filtering>${app.filtering.enabled}</filtering>
</resource>
</resources>
</configuration>
</execution>
@@ -452,11 +445,6 @@
</plugins>
</build>
<dependencies>
<dependency>
<artifactId>junit-remote</artifactId>
<groupId>com.tradeshift</groupId>
<version>3</version>
</dependency>
<!-- SDK AMP Testing Dependencies -->
<dependency>
<groupId>com.h2database</groupId>
@@ -470,14 +458,8 @@
<version>${h2-support.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>3.0.5.RELEASE</version>
<!-- To make remote testing working -->
<!-- <scope>test</scope> -->
</dependency>
<!-- Requires this explicit test dependency, for a Spring 3.0.5 bug
<!--
| Requires this explicit test dependency, for a Spring 3.0.5 bug
| See https://jira.springsource.org/browse/SPR-8527
-->
<dependency>
@@ -500,6 +482,12 @@
<classifier>config</classifier>
<scope>provided</scope>
</dependency>
<!-- Add RAD capabilities for remote JUnit test running -->
<dependency>
<groupId>org.alfresco.maven</groupId>
<artifactId>alfresco-rad</artifactId>
<version>${maven.alfresco.version}</version>
</dependency>
</dependencies>
</profile>
@@ -556,6 +544,11 @@
<targetPath>WEB-INF/classes</targetPath>
<filtering>${app.filtering.enabled}</filtering>
</resource>
<resource>
<directory>src/test/properties/${env}</directory>
<filtering>${app.filtering.enabled}</filtering>
<targetPath>WEB-INF/classes</targetPath>
</resource>
</resources>
</configuration>
</execution>
@@ -574,24 +567,6 @@
<include>context.xml</include>
</includes>
</resource>
<resource>
<directory>tomcat</directory>
<filtering>${app.filtering.enabled}</filtering>
<targetPath>WEB-INF/classes/alfresco/extension</targetPath>
<includes>
<include>rad-context.xml</include>
</includes>
</resource>
<resource>
<directory>src/test/properties/${env}</directory>
<filtering>${app.filtering.enabled}</filtering>
<targetPath>WEB-INF/classes</targetPath>
</resource>
<resource>
<directory>${project.build.testOutputDirectory}</directory>
<filtering>${app.filtering.enabled}</filtering>
<targetPath>WEB-INF/classes</targetPath>
</resource>
</resources>
</configuration>
</execution>