harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r598909 - in /harmony/enhanced/buildtest/branches/2.0: adaptors/maven_test/ tests/maven_test/
Date Wed, 28 Nov 2007 08:31:14 GMT
Author: smishura
Date: Wed Nov 28 00:31:12 2007
New Revision: 598909

URL: http://svn.apache.org/viewvc?rev=598909&view=rev
Log:
Apply patch from HARMONY-5203:
[buildtest][maven_test] Add new adaptor for maven unit test

Added:
    harmony/enhanced/buildtest/branches/2.0/adaptors/maven_test/
    harmony/enhanced/buildtest/branches/2.0/adaptors/maven_test/MAVEN.BTI.README.txt   (with
props)
    harmony/enhanced/buildtest/branches/2.0/adaptors/maven_test/adaptor.xml   (with props)
    harmony/enhanced/buildtest/branches/2.0/adaptors/maven_test/parameters.xml   (with props)
    harmony/enhanced/buildtest/branches/2.0/tests/maven_test/
    harmony/enhanced/buildtest/branches/2.0/tests/maven_test/alltests.list   (with props)
    harmony/enhanced/buildtest/branches/2.0/tests/maven_test/build.xml   (with props)
    harmony/enhanced/buildtest/branches/2.0/tests/maven_test/exclude.list.linux.x86   (with
props)
    harmony/enhanced/buildtest/branches/2.0/tests/maven_test/exclude.list.windows.x86   (with
props)
    harmony/enhanced/buildtest/branches/2.0/tests/maven_test/maven.property

Added: harmony/enhanced/buildtest/branches/2.0/adaptors/maven_test/MAVEN.BTI.README.txt
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/adaptors/maven_test/MAVEN.BTI.README.txt?rev=598909&view=auto
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/adaptors/maven_test/MAVEN.BTI.README.txt (added)
+++ harmony/enhanced/buildtest/branches/2.0/adaptors/maven_test/MAVEN.BTI.README.txt Wed Nov
28 00:31:12 2007
@@ -0,0 +1,80 @@
+        ==========================================================
+        Running Apache Maven Unit Tests under BT infrastructure
+        ==========================================================
+
+
+This document describes how to run Apache Maven Unit Tests on Apache
+Harmony within Apache Harmony Build&Test infrastructure
+Please see BTI's README.txt
+for general instructions on BT usage. The following platforms are currently
+supported: Windows x86, Linux x86.
+
+---------------
+Archive Content
+---------------
+
+This archive contains scripts for running maven unit test within BT. The directories structure
+within BT trunk directory is as follows:
+
++<BTI trunk>/
+|-+adaptors/                        - scripts connecting test suites to BTI (called "adaptors")
+|  |
+|  |-+maven_test/                   - maven suite adaptor directory
+|     |
+|     |--adaptor.xml                - maven suite adaptor
+|     |
+|     |--MAVEN.BTI.README.txt       - this readme file
+|     |
+|     |--parameters.xml             - parameters file
+|
+|-+tests/                           - test suites integrated into BTI
+   |
+   |-+maven_test/                   - maven scripts directory
+      |
+      |--alltests.list              - list of all Maven Unit Tests; used by exclude.lists
feature
+      |
+      |--build.xml                  - main maven suite launching script
+      |
+      |--exclude.list.${os}.${arch} - platform specific exclude.lists
+      |
+      |--maven.properties           - maven properties (used when running without BTI)
+
+
+-----------------------------------------------------------------
+Running Apache Maven Unit Tests on Harmony JRE under BT infrastructure
+-----------------------------------------------------------------
+
+1. Follow instructions from <BTI trunk>/README.txt to satisfy general BTI
+   pre-requisites (install necessary software, specify environment variables,
+   specify proxy settings if necessary).
+
+2. Unpack this archive to <BTI trunk> directory
+
+3. Perform setup:
+
+     buildtest -Dtest.suites="classlib,drlvm,maven_test" setup
+
+4. Configure BT for maven run:
+
+   * Specify appropriate options for the JRE under test in <BTI trunk>/framework.local.properties
+     file by setting maven.parameters.optional.tested.vm.options=<options>. By default,
+     maven.parameters.optional.vm.options=""
+
+   * Specify appropriate mail settings in <BTI trunk>/framework.local.properties file
+     if you want Cruise Control to send mail notifications.
+
+   * Modify platform specific exclude.list in <BTI trunk>/tests/maven_test if necessary.
It should be named
+     as exclude.list.${os}.${arch} where ${os}.${arch} can be windows.x86, linux.x86 or linux.x86_64.
+
+5. Build classlib and drlvm and run maven on it:
+
+     buildtest -Dtest.suites="classlib,drlvm,maven_test" run
+
+6. To continuously perform Harmony JRE build (classlib and drlvm) and maven_test run under
Cruise Control:
+
+     buildtest -Dtest.suites="classlib,drlvm,maven_test" run-cc
+
+--------------------------------
+DISCLAIMER AND LEGAL INFORMATION
+--------------------------------
+Other brands and names are the property of their respective owners.

Propchange: harmony/enhanced/buildtest/branches/2.0/adaptors/maven_test/MAVEN.BTI.README.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/buildtest/branches/2.0/adaptors/maven_test/adaptor.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/adaptors/maven_test/adaptor.xml?rev=598909&view=auto
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/adaptors/maven_test/adaptor.xml (added)
+++ harmony/enhanced/buildtest/branches/2.0/adaptors/maven_test/adaptor.xml Wed Nov 28 00:31:12
2007
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 
+    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. -->
+
+<!-- ====================================================================== 
+                        BT Adaptor for maven_test
+     ====================================================================== -->
+<project name="maven_test" default="run" basedir=".">
+    <property name="maven_test.results.dir" location="${results.dir}/${suite.name}"/>
+    <property name="install.marker" location="${test.sources.dir}/${suite.name}/install.complete"/>
+
+    <!-- ================================= 
+         target: setup
+         ================================= -->
+    <target name="setup" depends="-check-install,-install">
+        <echo level="info" message="============= Adaptor for ${suite.name}: Set Up ..."/>
+        <echo level="info" message=""/>
+        <echo level="info" message="Tested JVM: ${tested.runtime}"/>
+        <echo level="info" message="Maven.src.location: ${maven_test.parameters.optional.maven.src.location}"/>
+        <echo level="info" message="Maven.src.version: ${maven_test.parameters.optional.maven.src.version}"/>
+        <echo level="info" message="Maven.src.filename: ${maven_test.parameters.optional.maven.src.filename}"/>
+        <echo level="info" message="Maven.location: ${ext.maven-2.0.7.location}"/>
+        <echo level="info" message="Maven.repository.location: ${maven_test.parameters.optional.maven.repository.location}"/>
+        <echo level="info" message=""/>
+
+        <mkdir dir="${maven_test.results.dir}"/> 
+    </target>
+
+    <target name="-check-install">
+        <available property="skip.install" file="${install.marker}"/>
+    </target>
+
+    <target name="-install" unless="skip.install">
+        <description>
+            setup: Install, configure and build maven and its pre-requisites
+        </description>
+
+        <svn-update-bt path="${test.sources.dir}/${suite.name}"/>
+        <exec-ant dir="${test.sources.dir}/${suite.name}"
+                  targets="setup"
+                  failonerror="true"
+                  failproperty="maven.setup.failed">
+            <sysproperty key="maven.src.location" value="${maven_test.parameters.optional.maven.src.location}"/>
+            <sysproperty key="maven.src.version"  value="${maven_test.parameters.optional.maven.src.version}"/>
+            <sysproperty key="maven.src.filename" value="${maven_test.parameters.optional.maven.src.filename}"/>
+            <sysproperty key="maven.location"     value="${ext.maven-2.0.7.location}"/>
+            <sysproperty key="maven.repository"   value="${maven_test.parameters.optional.maven.repository.location}"/>
+            <sysproperty key="work.dir"           value="${checkouts.dir}/${suite.name}"/>
+            <sysproperty key="maven.dir"          value="${checkouts.dir}/${suite.name}"/>
+            <sysproperty key="result.dir"         value="${maven_test.results.dir}"/>
+            <sysproperty key="test.jre.home"      value="${maven_test.parameters.required.tested.runtime}"/>
+       </exec-ant>
+
+        <fail message="Maven unit tests setup failed" if="maven.setup.failed"/>
+        <touch file="${install.marker}"/>
+    </target>
+
+
+    <!-- ================================= 
+          target: run
+         ================================= -->
+    <target name="run">
+        <!-- Make sure the tested jvm is available -->
+        <condition property="jre.not.exist">
+            <not>
+                <available file="${tested.runtime}"/>
+            </not>
+        </condition>
+        <fail message="Path to jre does not exist: ${tested.runtime}" if="jre.not.exist"/>
+
+        <!-- Execute test running here -->
+        <exec-ant dir="${test.sources.dir}/${suite.name}"
+                  targets="run"
+                  failonerror="true"
+                  failproperty="maven.run.failed">
+            <sysproperty key="maven.src.location" value="${maven_test.parameters.optional.maven.src.location}"/>
+            <sysproperty key="maven.src.version"  value="${maven_test.parameters.optional.maven.src.version}"/>
+            <sysproperty key="maven.src.filename" value="${maven_test.parameters.optional.maven.src.filename}"/>
+            <sysproperty key="maven.location"    value="${ext.maven-2.0.7.location}"/>
+            <sysproperty key="maven.repository"   value="${maven_test.parameters.optional.maven.repository.location}"/>
+            <sysproperty key="work.dir"          value="${checkouts.dir}/${suite.name}"/>
+            <sysproperty key="maven.dir"         value="${checkouts.dir}/${suite.name}"/>
+            <sysproperty key="result.dir"        value="${maven_test.results.dir}"/>
+            <sysproperty key="vm.options"        value="${maven_test.parameters.optional.tested.vm.options}"/>
+            <sysproperty key="test.jre.home"     value="${maven_test.parameters.required.tested.runtime}"/>
+        </exec-ant>
+
+        <fail message="Maven unit tests failed" if="maven.run.failed"/>
+    </target>
+
+    <!-- =================================
+          target: clean
+         ================================= -->
+    <target name="clean">
+        <delete dir="${maven_test.results.dir}" quiet="true"/>
+        <delete dir="${checkouts.dir}/${suite.name}" />
+        <delete file="${install.marker}"/>
+    </target>
+
+</project>
+

Propchange: harmony/enhanced/buildtest/branches/2.0/adaptors/maven_test/adaptor.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/buildtest/branches/2.0/adaptors/maven_test/parameters.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/adaptors/maven_test/parameters.xml?rev=598909&view=auto
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/adaptors/maven_test/parameters.xml (added)
+++ harmony/enhanced/buildtest/branches/2.0/adaptors/maven_test/parameters.xml Wed Nov 28
00:31:12 2007
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    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.
+-->
+
+<parameters depends="drlvm">
+
+    <!-- Required parameters -->
+    <required>
+        <tested.runtime
+            description="Path to Tested Runtime"
+            value="${drlvm.parameters.shared.jre.dir}"/>
+    </required>
+
+    <!-- Optional parameters -->
+    <optional>
+    </optional>
+
+    <!-- External dependencies -->
+    <external>
+        <maven-2.0.7
+            url="http://apache.hkmirror.org/maven/binaries/maven-2.0.7-bin.zip"
+            md5="dae57b501e38ef3414678a873ab7fb1b"
+            dir="maven-2.0.7"
+        />
+    </external>
+
+    <!-- Shared parameters -->
+    <optional>
+        <tested.vm.options
+            description="JVM options for tested runtime"
+            value=""/>
+        <maven.src.location
+            description="URL to fetch Apache maven sources"
+            value="http://apache.hkmirror.org/maven/source"/>
+        <maven.src.filename
+            description="Apache maven sources archive name"
+            value="maven-2.0.7-src.zip"/>
+        <maven.src.version
+            description="Apache maven version to use"
+            value="2.0.7"/>
+        <maven.repository.location
+            description="The reposiotory location of maven"
+            value="${ext.maven-2.0.7.location}/repository"/>
+    </optional>
+
+    <!-- CC specific configuration -->
+    <cc>
+        <!-- Run this script for publishing results -->
+        <summary value="${maven_test.results.dir}/results/report.txt"/>
+
+        <!-- Merge results with CC log -->
+        <results value="${maven_test.results.dir}/results/reports"/>
+    </cc>
+
+</parameters>

Propchange: harmony/enhanced/buildtest/branches/2.0/adaptors/maven_test/parameters.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/buildtest/branches/2.0/tests/maven_test/alltests.list
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/tests/maven_test/alltests.list?rev=598909&view=auto
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/tests/maven_test/alltests.list (added)
+++ harmony/enhanced/buildtest/branches/2.0/tests/maven_test/alltests.list Wed Nov 28 00:31:12
2007
@@ -0,0 +1,49 @@
+org/apache/maven/artifact/DefaultArtifactTest
+org/apache/maven/artifact/deployer/ArtifactDeployerTest
+org/apache/maven/artifact/factory/DefaultArtifactFactoryTest
+org/apache/maven/artifact/installer/ArtifactInstallerTest
+org/apache/maven/artifact/manager/DefaultWagonManagerTest
+org/apache/maven/artifact/repository/metadata/AbstractRepositoryMetadataTest
+org/apache/maven/artifact/resolver/ArtifactResolverTest
+org/apache/maven/artifact/resolver/DefaultArtifactCollectorTest
+org/apache/maven/artifact/versioning/DefaultArtifactVersionTest
+org/apache/maven/artifact/versioning/VersionRangeTest
+org/apache/maven/cli/BatchModeDownloadMonitorTest
+org/apache/maven/cli/ConsoleDownloadMonitorTest
+org/apache/maven/cli/MavenCliTest
+org/apache/maven/plugin/lifecycle/LifecycleXpp3ReaderTest
+org/apache/maven/plugin/PluginParameterExpressionEvaluatorTest
+org/apache/maven/plugin/version/IntervalUtilsTest
+org/apache/maven/profiles/DefaultProfileManagerTest
+org/apache/maven/project/artifact/MavenMetadataSourceTest
+org/apache/maven/project/canonical/CanonicalProjectBuilderTest
+org/apache/maven/project/DefaultMavenProjectBuilderTest
+org/apache/maven/project/inheritance/DefaultModelInheritanceAssemblerTest
+org/apache/maven/project/inheritance/t00/ProjectInheritanceTest
+org/apache/maven/project/inheritance/t01/ProjectInheritanceTest
+org/apache/maven/project/inheritance/t02/ProjectInheritanceTest
+org/apache/maven/project/inheritance/t03/ProjectInheritanceTest
+org/apache/maven/project/inheritance/t04/ProjectInheritanceTest
+org/apache/maven/project/inheritance/t05/ProjectInheritanceTest
+org/apache/maven/project/inheritance/t06/ProjectInheritanceTest
+org/apache/maven/project/inheritance/t07/ProjectInheritanceTest
+org/apache/maven/project/inheritance/t08/ProjectInheritanceTest
+org/apache/maven/project/inheritance/t09/ProjectInheritanceTest
+org/apache/maven/project/inheritance/t10/ProjectInheritanceTest
+org/apache/maven/project/inheritance/t11/ProjectInheritanceTest
+org/apache/maven/project/injection/DefaultModelDefaultsInjectorTest
+org/apache/maven/project/injection/DefaultProfileInjectorTest
+org/apache/maven/project/injection/TestProfileInjector
+org/apache/maven/project/interpolation/RegexBasedModelInterpolatorTest
+org/apache/maven/project/MavenProjectTest
+org/apache/maven/project/ModelUtilsTest
+org/apache/maven/project/ProjectBaseDirectoryAlignmentTest
+org/apache/maven/project/ProjectClasspathTest
+org/apache/maven/project/ProjectSorterTest
+org/apache/maven/project/TestArtifactResolver
+org/apache/maven/project/TestProjectBuilder
+org/apache/maven/project/validation/DefaultModelValidatorTest
+org/apache/maven/settings/SettingsUtilsTest
+org/apache/maven/usability/InvalidArtifactDiagnoserTest
+org/apache/maven/usability/plugin/Xpp3ParseTest
+org/apache/maven/usability/PluginErrorDiagnoserTest

Propchange: harmony/enhanced/buildtest/branches/2.0/tests/maven_test/alltests.list
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/buildtest/branches/2.0/tests/maven_test/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/tests/maven_test/build.xml?rev=598909&view=auto
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/tests/maven_test/build.xml (added)
+++ harmony/enhanced/buildtest/branches/2.0/tests/maven_test/build.xml Wed Nov 28 00:31:12
2007
@@ -0,0 +1,399 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Copyright 2006 The Apache Software Foundation or its licensors, as applicable
+
+    Licensed 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.
+-->
+
+<project name="maven" default="run" basedir=".">
+
+    <description>
+        Build Apache Maven and run Apache Maven Unit Tests on Apache Harmony
+        http://harmony.apache.org/
+    </description>
+      <echo>work.dir:${work.dir}</echo> 
+
+
+    <!--The gut.properties file contains the names and values of properties-->
+    <property file="maven.properties" />
+   
+    <tstamp>
+        <format property="timestamp" pattern="yyyyMMdd_hhmm" />
+    </tstamp>
+
+    <property name="work.dir" value="${basedir}"/>
+
+    <condition property="res.dir" value="${result.dir}"
+        else="${basedir}/results">
+        <isset property="result.dir" />
+    </condition>
+    <property name="current.res.dir" value="${res.dir}/results"/>
+    <property name="backup.res.dir" value="${res.dir}/${timestamp}"/>
+
+    <!-- maven working directory -->
+    <property name="maven.src.dir"
+        value="${work.dir}/maven-${maven.src.version}-src"/>
+
+    <condition property="maven.src.exists">
+        <available file="${work.dir}/maven-2.0.7-src"/>
+    </condition>
+
+    <condition property="maven.exists">
+        <available file="${maven.location}"/>
+    </condition>
+
+    <condition property="vm.args" value="${vm.options}" else="">
+        <isset property="vm.options"/>
+    </condition>
+
+    <condition property="is.windows">
+        <os family="windows"/>
+    </condition>
+
+    <condition property="is.linux">
+        <and>
+            <os family="unix"/>
+            <os name="linux"/>
+        </and>
+    </condition>
+
+    <condition property="os" value="linux">
+        <and>
+            <os family="unix"/>
+            <os name="linux"/>
+        </and>
+    </condition>
+
+    <condition property="os" value="windows">
+        <os family="windows"/>
+    </condition>
+
+    <condition property="arch" value="x86">
+        <and>
+            <contains string="${os.arch}" substring="86" />
+            <not>
+                <contains string="${os.arch}" substring="64" />
+            </not>
+        </and>
+    </condition>
+
+    <condition property="arch" value="x86_64">
+        <or>
+            <contains string="${os.arch}" substring="86_64" />
+            <contains string="${os.arch}" substring="amd64" />
+        </or>
+    </condition>
+
+    <condition property="cmd.suffix" value=".bat" else="">
+        <isset property="is.windows"/>
+    </condition>
+
+    <condition property="cmd" value="sh" else="cmd">
+        <isset property="is.linux"/>
+    </condition>
+
+     <condition property="cmd.arg" value="-" else="/c">
+        <isset property="is.linux"/>
+    </condition>
+
+    <path id="maven.cmd.id">
+        <pathelement
+            location="${maven.location}/bin/mvn${cmd.suffix}"/>
+    </path>
+    <pathconvert targetos="unix" property="maven.cmd" refid="maven.cmd.id"/>
+
+    <!-- Create settings.xml for maven -->
+    <target name="config.maven.settings" depends="config.maven.repository,config.maven.proxy">
+        <echo file="${work.dir}/settings.xml" append="true"><![CDATA[
+</settings>]]>
+            </echo>
+    </target>
+    <target name="config.maven.repository">
+        <echo file="${work.dir}/settings.xml"><![CDATA[<settings>
+    <localRepository>${maven.repository}</localRepository>]]>
+            </echo>
+    </target>
+    <target name="config.maven.proxy" if="http.proxyHost"
+        depends="config.maven.repository"
+        description="Create maven settings file with proxy configuration if necessary">
+        <echo file="${work.dir}/settings.xml" append="true"><![CDATA[
+    <proxies>
+        <proxy>
+            <protocol>http</protocol>
+            <host>]]>${http.proxyHost}<![CDATA[</host>
+            <port>]]>${http.proxyPort}<![CDATA[</port>
+        </proxy>
+    </proxies>]]>
+        </echo>
+    </target>
+
+    <target name="download.maven.src" description="Download maven source">
+        <mkdir dir="${work.dir}"/>
+        <get src="${maven.src.location}/${maven.src.filename}"
+            dest="${work.dir}/${maven.src.filename}"
+            usetimestamp="true"
+            verbose="true" />
+    </target>
+
+    <target name="unpack.maven.src" description="Unpack maven source">
+        <unzip src="${work.dir}/${maven.src.filename}" dest="${work.dir}"/>
+    </target>
+
+    <target name="install.maven.src"
+            description="Download and unpack maven source"
+            unless="maven.src.exists">
+        <antcall target="download.maven.src"/>
+        <antcall target="unpack.maven.src"/>
+    </target>
+
+    <target name="setup"
+        description="Setup maven and its pre-requisites"
+        depends="install.maven.src">
+
+        <!-- Running maven with "test" target in order to make sure that all
+        necessary jar-s are downloaded and all necessary classes are compiled -->
+        <exec executable="${cmd}"
+            dir="${maven.src.dir}"
+            failonerror="false"
+            logError="true">
+            <arg line="${cmd.arg} ${maven.cmd} -s ${work.dir}/settings.xml compile test-compile"/>
+            <env key="MAVEN_HOME" value="${maven.location}"/>
+            <env key="MAVEN_OPTS" value="-Xmx512m -Dmaven.test.failure.ignore=true"/>
+       </exec>
+    </target>
+
+    <condition property="os.specific.exclude.list.exists">
+        <available file="${basedir}/exclude.list.${os}.${arch}"/>
+    </condition>
+
+    <condition property="exclude.list" value="exclude.list.${os}.${arch}"
+        else="exclude.list.empty">
+        <isset property="os.specific.exclude.list.exists"/>
+    </condition>
+
+    <target name="setup.empty.exclude.list" unless="os.specific.exclude.list.exists">
+        <!-- Create empty exclude list in order to use if no exclude lists for the platform
are specified -->
+        <delete file="${work.dir}/${exclude.list}"/>
+        <touch file="${work.dir}/${exclude.list}"/>
+    </target>
+
+    <target name="setup.non-empty.exclude.list" if="os.specific.exclude.list.exists">
+        <delete file="${work.dir}/${exclude.list}"/>
+        <!-- Copy exclude list and remove comments -->
+        <copy file="${basedir}/exclude.list.${os}.${arch}"
+            tofile="${work.dir}/exclude.list.${os}.${arch}"
+            overwrite="true"
+            failonerror="false">
+            <filterchain>
+                <tokenfilter>
+                    <replaceregex pattern="(.*?)#.*" replace="\1" flags="m"/>
+                </tokenfilter>
+            </filterchain>
+        </copy>
+   </target>
+
+    <target name="configure.exclude.list"
+        depends="setup.empty.exclude.list,setup.non-empty.exclude.list"
+        description="Process x-list if there is one or create the empty x-list">
+        <echo>exclude: ${exclude.list}</echo>
+        <copy file="${basedir}/alltests.list"
+            tofile="${work.dir}/tests.list"
+            overwrite="true"/>
+        <!-- Use fake token and value to avoid failure if exclude.list is empty -->
+        <replace file="${work.dir}/tests.list"
+        replacefilterfile="${work.dir}/${exclude.list}"
+        token="fake_token"
+        value="fake_token"/>
+        <replaceregexp  file="${work.dir}/tests.list"
+            match="\s+"
+            replace=","
+            flags="g"/>
+    </target>
+
+    <condition property="maven.pom.orig.exists">
+        <available file="${maven.src.dir}/pom.xml.orig"/>
+    </condition>
+
+    <target name="backup.maven.pom" unless="maven.pom.orig.exists">
+        <copy file="${maven.src.dir}/pom.xml"
+            tofile="${maven.src.dir}/pom.xml.orig"
+            failonerror="false"/>
+    </target>
+
+    <target name="restore.maven.pom" if="maven.pom.orig.exists">
+        <copy file="${maven.src.dir}/pom.xml.orig"
+        tofile="${maven.src.dir}/pom.xml"
+        failonerror="false"
+        overwrite="true"/>
+    </target>
+
+    <target name="configure.run.options"
+        depends="restore.maven.pom,backup.maven.pom,configure.exclude.list">
+        <antcall target="config.maven.settings"/>
+
+        <loadfile property="tests" srcFile="${work.dir}/tests.list" failonerror="false"/>
+        <!-- specify VM options and tests list -->
+        <replace file="${maven.src.dir}/pom.xml" token="&lt;artifactId>maven-surefire-plugin&lt;/artifactId>"
value=""/>
+        <replace file="${maven.src.dir}/pom.xml" token="&lt;version>2.3&lt;/version>"
value=""/>
+        <replaceregexp file="${maven.src.dir}/pom.xml"
+            match='(&lt;build>\s*&lt;pluginManagement>\s*&lt;plugins>)'
+            replace='\1${line.separator}
+                &lt;plugin>${line.separator}
+                    &lt;groupId>org.apache.maven.plugins&lt;/groupId>${line.separator}
+                    &lt;artifactId>maven-surefire-plugin&lt;/artifactId>${line.separator}
+                    &lt;configuration>${line.separator}
+                        &lt;argLine>${vm.args}&lt;/argLine>${line.separator}
+                        &lt;test>${tests}&lt;/test>${line.separator}
+                    &lt;/configuration>${line.separator}
+                &lt;/plugin>${line.separator}'/>
+    </target>
+
+    <target name="clean.logs.before.run"
+        description="Remove old logs before running">
+        <delete>
+            <fileset dir="${maven.src.dir}" includes="**/surefire-reports/*"/>
+        </delete>
+        <delete file="${work.dir}/output.txt"/>
+   </target>
+
+    <target name="run.tests" description="Launch GUT runs">
+        <condition property="java.exists">
+            <available file="${test.jre.home}"/>
+        </condition>
+
+        <fail message="Path to tested runtime does not exist: ${test.jre.home}" unless="java.exists"/>
+         
+        <exec executable="${cmd}"
+            dir="${maven.src.dir}"
+            failonerror="false"
+            logError="true">
+            <arg line="${cmd.arg} ${maven.cmd} -s ${work.dir}/settings.xml test"/>
+            <env key="MAVEN_HOME" value="${maven.location}"/>
+            <env key="MAVEN_OPTS"
+                value="-Xmx512m -Djvm=${test.jre.home}${file.separator}bin${file.separator}java
-Dmaven.test.failure.ignore=true -Dsurefire.reportFormat=plain -DtrimStackTrace=false"/>
+            <redirector alwaysLog="true"
+                logError="true"
+                output="${work.dir}/output.txt"/>
+        </exec>
+        <antcall target="restore.maven.pom"/>
+    </target>
+
+    <target name="check.status">
+        <loadfile property="status.failed"
+            srcFile="${work.dir}/output.txt"
+            failonerror="false">
+            <filterchain>
+                <linecontainsregexp>
+                    <regexp pattern="\[ERROR\] There are test failures.|\[ERROR\] BUILD
ERROR"/>
+                </linecontainsregexp>
+            </filterchain>
+        </loadfile>
+        <loadfile property="status.successful"
+            srcFile="${work.dir}/output.txt"
+            failonerror="false">
+            <filterchain>
+                <linecontainsregexp>
+                    <regexp pattern="BUILD SUCCESSFUL"/>
+                </linecontainsregexp>
+            </filterchain>
+        </loadfile>
+       <fail message="Maven run failed: there are test failures" if="status.failed"/>
+       <fail message="Maven run failed: see results directory for more details" unless="status.successful"/>
+    </target>
+
+    <target name="compose.report">
+        <delete dir="${work.dir}/logs"/>
+        <delete>
+            <fileset dir="${work.dir}" includes="tmpfile.*"/>
+        </delete>
+        <delete file="${work.dir}/report.txt"/>
+        <mkdir dir="${work.dir}/logs"/>
+        <copy todir="${work.dir}/logs" flatten="true">
+            <fileset dir="${maven.src.dir}" includes="**/surefire-reports/*.xml"/>
+        </copy>
+        <mkdir dir="${current.res.dir}/reports"/>
+        <copy todir="${current.res.dir}/reports" flatten="true">
+            <fileset dir="${maven.src.dir}" includes="**/surefire-reports/*.xml"/>
+        </copy>
+        <concat destfile="${work.dir}/tmpfile.results.txt">
+            <fileset dir="${work.dir}/logs" includes="*.txt"/>
+        </concat>
+        <copy file="${work.dir}/tmpfile.results.txt"
+            tofile="${work.dir}/tmpfile.results.failed.error.txt"
+            failonerror="false"/>
+        <replaceregexp flags='mg'
+            file="${work.dir}/tmpfile.results.failed.error.txt"
+            match='^test.*sec\s*$\n|^-+\s*$\n|^Tests run:.*\s*$\n|^Test set:.*\s*$\n'
+            replace=''>
+        </replaceregexp>
+        <copy file="${work.dir}/tmpfile.results.failed.error.txt"
+            tofile="${work.dir}/tmpfile.results.failed.txt"
+            failonerror="false">
+            <filterchain>
+                <linecontains>
+                    <contains value="&lt;&lt;&lt; FAILURE!" />
+                </linecontains>
+                <replaceregex pattern="^.*FAILURE.*$" replace='@' flags="g" byline="true"/>
+                <striplinebreaks/>
+            </filterchain>
+        </copy>
+        <length file="${work.dir}/tmpfile.results.failed.txt" property="failed"/>
+        <copy file="${work.dir}/tmpfile.results.failed.error.txt"
+            tofile="${work.dir}/tmpfile.results.error.txt"
+            failonerror="false">
+            <filterchain>
+                <linecontains>
+                    <contains value="&lt;&lt;&lt; ERROR!" />
+                </linecontains>
+                <replaceregex pattern="^.*ERROR.*$" replace='@' flags="g" byline="true"/>
+                <striplinebreaks/>
+            </filterchain>
+        </copy>
+        <length file="${work.dir}/tmpfile.results.error.txt" property="error"/>
+        <echo file="${work.dir}/report.txt">
+Failures: ${failed}, errors: ${error}
+-------------------------------------
+
+        </echo>
+        <concat destfile="${work.dir}/report.txt" append="true">
+             <filelist dir="${work.dir}" files="tmpfile.results.failed.error.txt"/>
+        </concat>
+
+        <copy todir="${current.res.dir}">
+            <fileset dir="${work.dir}" includes="output.txt,report.txt"/>
+        </copy>
+
+        <!--Backup results-->
+        <mkdir dir="${backup.res.dir}"/>
+        <copy todir="${backup.res.dir}">
+            <fileset dir="${current.res.dir}"/>
+        </copy>
+    </target>
+
+    <target name="run"
+        depends="clean.logs.before.run,configure.run.options,run.tests,compose.report,check.status"
+        description="Configure, run and process Maven and run results">
+    </target>
+
+    <target name="clean"
+        description="Clean maven workspace (.class files and run results)" depends="clean.logs.before.run">
+        <exec executable="${cmd}"
+            dir="${maven.src.dir}"
+            failonerror="false"
+            logError="true">
+            <arg line="${cmd.arg} ${maven.cmd} -s ${work.dir}/settings.xml clean"/>

+            <env key="MAVEN_HOME" value="${maven.location}/maven-${maven.version}"/>
+        </exec>
+    </target>
+
+</project>

Propchange: harmony/enhanced/buildtest/branches/2.0/tests/maven_test/build.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/buildtest/branches/2.0/tests/maven_test/exclude.list.linux.x86
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/tests/maven_test/exclude.list.linux.x86?rev=598909&view=auto
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/tests/maven_test/exclude.list.linux.x86 (added)
+++ harmony/enhanced/buildtest/branches/2.0/tests/maven_test/exclude.list.linux.x86 Wed Nov
28 00:31:12 2007
@@ -0,0 +1 @@
+org/apache/maven/project/injection/DefaultProfileInjectorTest

Propchange: harmony/enhanced/buildtest/branches/2.0/tests/maven_test/exclude.list.linux.x86
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/buildtest/branches/2.0/tests/maven_test/exclude.list.windows.x86
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/tests/maven_test/exclude.list.windows.x86?rev=598909&view=auto
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/tests/maven_test/exclude.list.windows.x86 (added)
+++ harmony/enhanced/buildtest/branches/2.0/tests/maven_test/exclude.list.windows.x86 Wed
Nov 28 00:31:12 2007
@@ -0,0 +1 @@
+org/apache/maven/project/injection/DefaultProfileInjectorTest

Propchange: harmony/enhanced/buildtest/branches/2.0/tests/maven_test/exclude.list.windows.x86
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/buildtest/branches/2.0/tests/maven_test/maven.property
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/tests/maven_test/maven.property?rev=598909&view=auto
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/tests/maven_test/maven.property (added)
+++ harmony/enhanced/buildtest/branches/2.0/tests/maven_test/maven.property Wed Nov 28 00:31:12
2007
@@ -0,0 +1,9 @@
+maven.src.location=http://apache.hkmirror.org/maven/source
+maven.src.version=2.0.7
+maven.src.filename=maven-2.0.7-src.zip
+maven.location=
+maven.repository=
+work.dir=workdir
+maven.dir=.
+test.jre.home=
+



Mime
View raw message