Kaydet (Commit) 24796e71 authored tarafından Liu Zhe's avatar Liu Zhe

#120510# - Move ant scripts from testgui to test module root

üst 1816e39a
...@@ -25,84 +25,129 @@ ...@@ -25,84 +25,129 @@
<project basedir="." default="test"> <project basedir="." default="test">
<property file="build.properties" /> <property file="build.properties" />
<property environment="env" /> <property environment="env" />
<property name="src" value="./source" />
<property name="out" value="output"/> <property name="out" value="output"/>
<property name="classes" value="${out}/class" /> <property name="classes" value="${out}/class" />
<property name="lib" value="${out}/lib" />
<property name="dist" value="${out}/dist" /> <property name="dist" value="${out}/dist" />
<property name="env.TESTSPACE" value="../testspace" /> <property name="env.TESTSPACE" value="testspace" />
<property name="env.JUNIT_HOME" value="${out}/junit" />
<property name="junit.home" value="${env.JUNIT_HOME}" /> <property name="junit.home" value="${env.JUNIT_HOME}" />
<property name="testspace" value="${env.TESTSPACE}" /> <property name="testspace" value="${env.TESTSPACE}" />
<property name="test.classes" value="testsuite/gui/BVT.class" /> <property name="test.classes" value="testsuite/gui/BVT.class" />
<property name="test.output" value="${testspace}/output" /> <property name="test.output" value="${testspace}/output" />
<property name="test.result" value="${test.output}/result" /> <property name="test.result" value="${test.output}/result" />
<property name="test.report" value="${test.output}/report" /> <property name="test.report" value="${test.output}/report" />
<property name="junit.style.dir" value="./reportstyle" /> <property name="junit.style.dir" value="reportstyle" />
<path id="classpath"> <path id="junit.classpath">
<pathelement location="${classes}" />
<fileset dir="${lib}" erroronmissingdir="false">
<include name="**/testcommon.jar" />
<include name="**/junit.jar" />
</fileset>
<fileset dir="${solar.jar}" erroronmissingdir="false">
<include name="**/testcommon.jar" />
<include name="**/junit.jar" />
</fileset>
<fileset dir="${junit.home}" erroronmissingdir="false"> <fileset dir="${junit.home}" erroronmissingdir="false">
<include name="*.jar" /> <include name="*.jar" />
</fileset> </fileset>
</path> </path>
<target name="init"> <path id="testgui.classpath">
<pathelement location="${classes}" />
<path refid="junit.classpath"/>
</path>
<path id="testuno.classpath">
<pathelement location="${classes}" />
<path refid="junit.classpath"/>
<fileset dir="${openoffice.home}/../" erroronmissingdir="false">
<include name="**/juh.jar" />
<include name="**/unoil.jar" />
<include name="**/ridl.jar" />
<include name="**/jurt.jar" />
</fileset>
</path>
<path id="test.classpath">
<pathelement location="${classes}" />
<path refid="junit.classpath" />
<fileset dir="${openoffice.home}/../" erroronmissingdir="false">
<include name="**/juh.jar" />
<include name="**/unoil.jar" />
<include name="**/ridl.jar" />
<include name="**/jurt.jar" />
</fileset>
</path>
<target name="testcommon.init">
<mkdir dir="${classes}" /> <mkdir dir="${classes}" />
<mkdir dir="${lib}" />
<copy includeemptydirs="false" todir="${classes}"> <copy includeemptydirs="false" todir="${classes}">
<fileset dir="${src}"> <fileset dir="testcommon/source">
<exclude name="**/*.java" /> <exclude name="**/*.java" />
</fileset> </fileset>
</copy> </copy>
</target> </target>
<target name="clean" description="Clean all output"> <target name="testcommon.compile" depends="testcommon.init">
<delete dir="${classes}" /> <javac destdir="${classes}" debug="on" source="1.6" includeantruntime="false">
<delete dir="${testspace}" /> <src path="testcommon/source"/>
</javac>
</target> </target>
<target name="check.dependencies"> <target name="testgui.init">
<available file="testcommon.jar" property="testcommon.jar.exists"> <mkdir dir="${classes}" />
<filepath refid="classpath" /> <copy includeemptydirs="false" todir="${classes}">
</available> <fileset dir="testgui/source">
<available file="junit.jar" property="junit.jar.exists"> <exclude name="**/*.java" />
<filepath refid="classpath" /> </fileset>
</available> </copy>
<copy includeemptydirs="false" todir="${classes}">
<fileset dir="testgui/data">
<exclude name="**/*.java" />
</fileset>
</copy>
</target> </target>
<target name="prepare.junit" unless="junit.jar.exists"> <target name="testgui.compile" depends="testgui.init, prepare.junit">
<property name="junit.jar.repos" value="http://repo1.maven.org/maven2/junit/junit/4.10/junit-4.10.jar" /> <javac destdir="${classes}" debug="on" source="1.6" includeantruntime="false">
<get src="${junit.jar.repos}" dest="${lib}/junit.jar" skipexisting="true" /> <src path="testgui/source"/>
<src path="testgui/data"/>
<classpath refid="testgui.classpath"/>
</javac>
</target> </target>
<target name="prepare.testcommon" unless="testcommon.jar.exists"> <target name="testuno.init">
<ant dir="../testcommon" target="dist" inheritAll="false"> <mkdir dir="${classes}" />
<property name="dist" location="${lib}" /> <copy includeemptydirs="false" todir="${classes}">
</ant> <fileset dir="testuno/source">
<exclude name="**/*.java" />
</fileset>
</copy>
</target> </target>
<target name="prepare.dependencies" depends="init, check.dependencies, prepare.junit, prepare.testcommon" description="Download all dependencies"> <target name="testuno.compile" depends="testuno.init, prepare.junit">
<javac destdir="${classes}" debug="on" source="1.6" includeantruntime="false">
<src path="testuno/source"/>
<classpath refid="testuno.classpath"/>
</javac>
</target> </target>
<target name="compile" depends="init, prepare.dependencies" description="Compile source code"> <target name="clean" description="Clean all output">
<javac srcdir="${src}" destdir="${classes}" debug="on" source="1.6"> <delete dir="${out}" />
<classpath refid="classpath" /> </target>
</javac>
<target name="check.junit">
<available file="junit.jar" property="junit.jar.exists">
<filepath refid="junit.classpath" />
</available>
</target>
<target name="prepare.junit" depends="check.junit" unless="junit.jar.exists">
<property name="junit.jar.repos" value="http://repo1.maven.org/maven2/junit/junit/4.10/junit-4.10.jar" />
<mkdir dir="${junit.home}" />
<get src="${junit.jar.repos}" dest="${junit.home}/junit.jar" skipexisting="true" />
</target>
<target name="compile" depends="testcommon.init, testcommon.compile, testgui.init, testgui.compile, testuno.init, testuno.compile" description="Compile source code">
</target> </target>
<target name="dist" depends="compile"> <target name="dist" depends="compile">
<tstamp /> <tstamp />
<property name="dist.archive" value="testoo_${DSTAMP}.zip" /> <property name="dist.archive" value="aoo_test_${DSTAMP}.zip" />
<zip destfile="../${dist.archive}" basedir="." update="true" />
</target> </target>
<target name="check.build" description="Check the build context"> <target name="check.build" description="Check the build context">
...@@ -186,10 +231,6 @@ ...@@ -186,10 +231,6 @@
<echo>Openoffice is installed to ${openoffice.home}</echo> <echo>Openoffice is installed to ${openoffice.home}</echo>
</target> </target>
<target name="clean.test" unless="clean.test.skip" description="Clean testing footprint">
<delete dir="${testspace}/oouser" quiet="true" failonerror="false" />
</target>
<target name="run.test" depends="compile" description="Run junit"> <target name="run.test" depends="compile" description="Run junit">
<tstamp> <tstamp>
<format property="output.stamp" pattern="yyMMdd.hhmm" /> <format property="output.stamp" pattern="yyMMdd.hhmm" />
...@@ -213,7 +254,7 @@ ...@@ -213,7 +254,7 @@
</batchtest> </batchtest>
<formatter type="xml" /> <formatter type="xml" />
<classpath refid="classpath" /> <classpath refid="test.classpath" />
</junit> </junit>
<junitreport todir="${test.report}"> <junitreport todir="${test.report}">
...@@ -226,7 +267,7 @@ ...@@ -226,7 +267,7 @@
</junitreport> </junitreport>
</target> </target>
<target name="test" depends="check.build,find.build,download.build,install.build,clean.test,run.test" description="Run testing on the specified build. The build is automatically downloaded and installed according to the context."> <target name="test" depends="check.build,find.build,download.build,install.build,run.test" description="Run testing on the specified build. The build is automatically downloaded and installed according to the context.">
<fail message="Test Failed" if="test.failed" /> <fail message="Test Failed" if="test.failed" />
</target> </target>
...@@ -263,7 +304,7 @@ ...@@ -263,7 +304,7 @@
<echo file="${testspace}/build.txt">${openoffice.build}</echo> <echo file="${testspace}/build.txt">${openoffice.build}</echo>
</target> </target>
<target name="routine.test" depends="detect.build,download.build,install.build,clean.test,run.test,report.test" description="Periodically run testing."> <target name="routine.test" depends="detect.build,download.build,install.build,run.test,report.test" description="Periodically run testing.">
<fail message="Test Failed" if="test.failed" /> <fail message="Test Failed" if="test.failed" />
</target> </target>
</project> </project>
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
<classpath> <classpath>
<classpathentry kind="src" path="source"/> <classpathentry kind="src" path="source"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="output/class"/> <classpathentry kind="output" path="bin"/>
</classpath> </classpath>
<?xml version="1.0"?>
<!--***********************************************************
*
* 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.
*
***********************************************************-->
<project basedir="." default="dist">
<property name="src" value="./source" />
<property name="out" value="output" />
<property name="classes" value="${out}/class" />
<property name="dist" value="${out}/class" />
<property name="jar.name" value="testcommon.jar" />
<target name="init">
<mkdir dir="${classes}" />
<mkdir dir="${dist}" />
<copy includeemptydirs="false" todir="${classes}">
<fileset dir="${src}">
<exclude name="**/*.java" />
</fileset>
</copy>
</target>
<target name="clean" description="Clean all output">
<delete dir="${classes}" />
<delete dir="${dist}" />
</target>
<target name="compile" depends="init">
<javac srcdir="${src}" destdir="${classes}" debug="on" source="1.6">
</javac>
</target>
<target name="dist" depends="compile">
<jar destfile="${dist}/${jar.name}" basedir="${classes}" excludes="*.jar"/>
</target>
</project>
#**************************************************************
#
# 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.
#
#**************************************************************
PRJ=.
PRJNAME=testcommon
TARGET=testcommon
.INCLUDE : ant.mk
ALLTAR : ANTBUILD
\ No newline at end of file
tcomm testcommon : NULL
tcomm testcommon nmake - all tcomm_mkout NULL
..\%__SRC%\class\testcommon.jar %_DEST%\bin%_EXT%\testcommon.jar
...@@ -84,6 +84,9 @@ public class IDList { ...@@ -84,6 +84,9 @@ public class IDList {
map.clear(); map.clear();
ArrayList<File> validFiles = new ArrayList<File>(); ArrayList<File> validFiles = new ArrayList<File>();
File[] files = dir.listFiles(); File[] files = dir.listFiles();
if (files == null)
return;
for (File file : files) { for (File file : files) {
if (file.isFile() && file.getName().endsWith(".lst")) { if (file.isFile() && file.getName().endsWith(".lst")) {
validFiles.add(file); validFiles.add(file);
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" path="source"/> <classpathentry kind="src" path="source"/>
<classpathentry kind="src" path="data"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" kind="src" path="/testcommon"/> <classpathentry combineaccessrules="false" kind="src" path="/testcommon"/>
<classpathentry kind="lib" path="output/lib/junit.jar"/> <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="output" path="output/class"/> <classpathentry kind="output" path="bin"/>
</classpath> </classpath>
#**************************************************************
#
# 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.
#
#**************************************************************
PRJ=.
PRJNAME=test
TARGET=test
.INCLUDE : ant.mk
ALLTAR : ANTBUILD
\ No newline at end of file
atest test :: testcommon NULL
atest test nmake - all test_all NULL
...@@ -51,7 +51,7 @@ import org.openoffice.test.vcl.widgets.VclTreeListBox; ...@@ -51,7 +51,7 @@ import org.openoffice.test.vcl.widgets.VclTreeListBox;
* *
*/ */
public class UIMap { public class UIMap {
private static IDList idList = new IDList(new File("./ids")); private static IDList idList = new IDList(new File("./idsd"));
public static final VclMessageBox ActiveMsgBox = new VclMessageBox(Constant.UID_ACTIVE); public static final VclMessageBox ActiveMsgBox = new VclMessageBox(Constant.UID_ACTIVE);
public static final VclMessageBox MsgBox_AdditionalRowsNotSaved = new VclMessageBox(Constant.UID_ACTIVE, "Additional rows were not saved."); public static final VclMessageBox MsgBox_AdditionalRowsNotSaved = new VclMessageBox(Constant.UID_ACTIVE, "Additional rows were not saved.");
public static final VclTabControl ActiveTabControl = new VclTabControl(Constant.UID_ACTIVE); public static final VclTabControl ActiveTabControl = new VclTabControl(Constant.UID_ACTIVE);
......
#!/bin/bash
export DISPLAY=:0.0
BASE=$(cd `dirname "$0"`; pwd)
cd $BASE
TESTSPACE=$BASE/../testspace
mkdir -p $TESTSPACE
ant routine.test > $TESTSPACE/test.log 2>&1
@echo off
set BASE=%~pd0%.
cd %BASE%
ant routine.test >"%BASE%\..\testspace\test.log" 2>&1
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment