Kaydet (Commit) 4a7a2d20 authored tarafından Liu Zhe's avatar Liu Zhe

some updates for bvt

üst 3e857b06
...@@ -23,18 +23,17 @@ ...@@ -23,18 +23,17 @@
<project basedir="." default="test"> <project basedir="." default="test">
<property file="build.properties" />
<property environment="env" /> <property environment="env" />
<property file="build.properties" />
<property name="env.INPATH" value="output"/> <property name="env.DISPLAY" value=":0.0"/>
<property name="classes" value="${env.INPATH}/class" /> <property name="env.INPATH" value="testspace"/>
<property name="dist" value="${env.INPATH}/dist" /> <property name="env.TESTSPACE" value="${env.INPATH}" />
<property name="env.JUNIT_HOME" value="external/junit" />
<property name="env.TESTSPACE" value="testspace" />
<property name="env.JUNIT_HOME" value="${env.INPATH}/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="classes" value="${testspace}/class" />
<property name="dist" value="${testspace}/dist" />
<property name="test.classes" value="testcase/gui/SmokeTest.class,testcase/gui/BVTFileType.class,testcase/gui/BVTFunction.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" />
...@@ -115,7 +114,7 @@ ...@@ -115,7 +114,7 @@
</target> </target>
<target name="clean" description="Clean all output"> <target name="clean" description="Clean all output">
<delete dir="${env.INPATH}" /> <delete dir="${testspace}" />
</target> </target>
<target name="check.junit"> <target name="check.junit">
...@@ -180,21 +179,20 @@ ...@@ -180,21 +179,20 @@
</target> </target>
<target name="download.build" unless="download.build.skip" description="Download the specified build from the remote server"> <target name="download.build" unless="download.build.skip" description="Download the specified build from the remote server">
<script language="javascript"> <echo message="openoffice.archive.url.resolved=${openoffice.archive.url}" file="${testspace}/.temp.properties" />
value = project.getProperty("openoffice.archive.url"); <property file="${testspace}/.temp.properties"/>
resolvedValue = project.replaceProperties(value); <echo>Archive address: ${openoffice.archive.url.resolved}</echo>
project.setProperty("openoffice.archive.url", resolvedValue);
</script>
<echo>Archive address: ${openoffice.archive.url}</echo>
<property name="openoffice.archive.dir" value="${testspace}/download/${openoffice.build}" /> <property name="openoffice.archive.dir" value="${testspace}/download/${openoffice.build}" />
<mkdir dir="${openoffice.archive.dir}" /> <mkdir dir="${openoffice.archive.dir}" />
<get src="${openoffice.archive.url}" dest="${openoffice.archive.dir}" verbose="false" usetimestamp="true" skipexisting="true" /> <get src="${openoffice.archive.url.resolved}" dest="${openoffice.archive.dir}" verbose="false" usetimestamp="true" skipexisting="true" />
</target> </target>
<target name="install.build" unless="install.build.skip" description="Install the build to the local"> <target name="install.build" unless="install.build.skip" description="Install the build to the local">
<property name="openoffice.installation.dir" value="${testspace}/installation/${openoffice.build}" /> <property name="openoffice.installation.dir" value="${testspace}/install/${openoffice.build}" />
<mkdir dir="${openoffice.installation.dir}" /> <property name="openoffice.installation.dest" value="${testspace}/install/dest" />
<unzip dest="${openoffice.installation.dir}"> <delete dir="${openoffice.installation.dest}"/>
<mkdir dir="${openoffice.installation.dest}" />
<unzip dest="${openoffice.installation.dest}">
<fileset dir="${openoffice.archive.dir}"> <fileset dir="${openoffice.archive.dir}">
<include name="**/Apache_OpenOffice*.zip" /> <include name="**/Apache_OpenOffice*.zip" />
</fileset> </fileset>
...@@ -204,9 +202,21 @@ ...@@ -204,9 +202,21 @@
<fileset dir="${openoffice.archive.dir}" includes="Apache_OpenOffice*.gz" /> <fileset dir="${openoffice.archive.dir}" includes="Apache_OpenOffice*.gz" />
</path> </path>
</pathconvert> </pathconvert>
<exec dir="${openoffice.installation.dir}" executable="tar" failifexecutionfails="false"> <exec dir="${openoffice.installation.dest}" executable="tar" failifexecutionfails="false">
<arg line="-zxf ${gz.files}" /> <arg line="-zxf ${gz.files}" />
</exec> </exec>
<pathconvert property="openoffice.12.dir" pathsep=" " setonempty="false">
<path>
<dirset dir="${openoffice.installation.dest}">
<include name="*"/>
</dirset>
</path>
</pathconvert>
<move file="${openoffice.12.dir}" tofile="${openoffice.installation.dir}"/>
<delete dir="${openoffice.installation.dest}"/>
<pathconvert property="openoffice.bin" pathsep=" " setonempty="false"> <pathconvert property="openoffice.bin" pathsep=" " setonempty="false">
<path> <path>
<fileset dir="${openoffice.installation.dir}" includes="**/*/soffice.bin" followsymlinks="false" /> <fileset dir="${openoffice.installation.dir}" includes="**/*/soffice.bin" followsymlinks="false" />
...@@ -229,6 +239,7 @@ ...@@ -229,6 +239,7 @@
<mkdir dir="${test.output}/temp" /> <mkdir dir="${test.output}/temp" />
<junit fork="yes" forkmode="once" tempdir="${test.output}/temp" printsummary="yes" showoutput="false" errorProperty="test.failed" failureProperty="test.failed" dir="."> <junit fork="yes" forkmode="once" tempdir="${test.output}/temp" printsummary="yes" showoutput="false" errorProperty="test.failed" failureProperty="test.failed" dir=".">
<env key="DISPLAY" value="${env.DISPLAY}"/>
<sysproperty key="openoffice.home" value="${openoffice.home}" /> <sysproperty key="openoffice.home" value="${openoffice.home}" />
<sysproperty key="testspace" value="${testspace}" /> <sysproperty key="testspace" value="${testspace}" />
<syspropertyset> <syspropertyset>
...@@ -264,25 +275,17 @@ ...@@ -264,25 +275,17 @@
</target> </target>
<target name="report.test" unless="report.test.skip" description="Upload the testing result to report repository."> <target name="report.test" unless="report.test.skip" description="Upload the testing result to report repository.">
<exec executable="hostname" outputproperty="host.name" /> <property name="report.to" value="r${openoffice.Revision}/${os.name}-${os.version}-${os.arch}" />
<property name="report.to" value="${openoffice.build}_${host.name}" />
<!--
<echo>Sending report to ${report.repos.server}/${report.repos.dir}/${report.to}</echo>
<ftp server="${report.repos.server}" remotedir="${report.repos.dir}/${report.to}" userid="${report.repos.user}" password="${report.repos.password}" action="mkdir" />
<ftp server="${report.repos.server}" remotedir="${report.repos.dir}/${report.to}" userid="${report.repos.user}" password="${report.repos.password}" depends="yes">
<fileset dir="${test.output}">
</fileset>
</ftp>
-->
<echo>Uploading report to ${report.repos}/${report.to}</echo> <echo>Uploading report to ${report.repos}/${report.to}</echo>
<tempfile property="report.to.temp" suffix=".output" destDir="${testspace}" deleteonexit="true"/> <property name="report.to.temp" location="${testspace}/.temp.ouput"/>
<delete dir="${report.to.temp}" deleteonexit="true"/>
<copy todir="${report.to.temp}/${report.to}"> <copy todir="${report.to.temp}/${report.to}">
<fileset dir="${test.output}" /> <fileset dir="${test.output}" />
</copy> </copy>
<scp todir="${report.repos}" trust="true">
<scp todir="${report.repos}">
<fileset dir="${report.to.temp}"/> <fileset dir="${report.to.temp}"/>
</scp> </scp>
<delete dir="${report.to.temp}" deleteonexit="true"/>
</target> </target>
<target name="detect.build" depends="find.build" description="Check if new build is available. If no new build is available, the target will be failed."> <target name="detect.build" depends="find.build" description="Check if new build is available. If no new build is available, the target will be failed.">
......
...@@ -739,6 +739,18 @@ h6 { ...@@ -739,6 +739,18 @@ h6 {
<!-- method header --> <!-- method header -->
<xsl:template name="testcase.test.header"> <xsl:template name="testcase.test.header">
<xsl:param name="show.class" select="''"/> <xsl:param name="show.class" select="''"/>
<script type="text/javascript" language="JavaScript"><![CDATA[
function showScreenshot(pack, name) {
if (pack) {
pack = pack.replace(new RegExp("[^.]+", "g"), "./");
location.href= "." + pack + "../screenshot/" + name;
} else {
location.href="../screenshot/" + name;
}
}
]]>
</script>
<tr valign="top"> <tr valign="top">
<xsl:if test="boolean($show.class)"> <xsl:if test="boolean($show.class)">
<th>Class</th> <th>Class</th>
...@@ -807,7 +819,7 @@ h6 { ...@@ -807,7 +819,7 @@ h6 {
</xsl:attribute> </xsl:attribute>
<xsl:variable name="class.href"> <xsl:variable name="class.href">
<xsl:value-of select="concat(translate(../@package,'.','/'), '/', ../@id, '_', ../@name, '.html')"/> <xsl:value-of select="concat(translate(../@package,'.','/'), '/', ../@id, '_', ../@name, '.html')"/>
</xsl:variable> </xsl:variable>
<xsl:if test="boolean($show.class)"> <xsl:if test="boolean($show.class)">
<td><a href="{$class.href}"><xsl:value-of select="../@name"/></a></td> <td><a href="{$class.href}"><xsl:value-of select="../@name"/></a></td>
</xsl:if> </xsl:if>
...@@ -843,17 +855,21 @@ h6 { ...@@ -843,17 +855,21 @@ h6 {
</td> </td>
<!-- Added by AOO --> <!-- Added by AOO -->
<td> <td>
<xsl:variable name="screenshot.dir"> <xsl:variable name="screenshot.path">
<xsl:if test="not(boolean($show.class))">../../screenshot</xsl:if> <xsl:if test="not(boolean($show.class))">
<xsl:if test="boolean($show.class)">../screenshot</xsl:if> <xsl:value-of select="../@package"/>
</xsl:if>
<xsl:if test="boolean($show.class)"></xsl:if>
</xsl:variable> </xsl:variable>
<xsl:choose> <xsl:choose>
<xsl:when test="failure"> <xsl:when test="failure">
<a href="{$screenshot.dir}/{@classname}.{@name}.failure.png">screenshot</a> <a href="javascript:showScreenshot('{$screenshot.path}','{@classname}.{@name}.failure.png')">screenshot</a>
</xsl:when> </xsl:when>
<xsl:when test="error"> <xsl:when test="error">
<a href="{$screenshot.dir}/{@classname}.{@name}.error.png">screenshot</a> <a href="javascript:showScreenshot('{$screenshot.path}','{@classname}.{@name}.error.png')">screenshot</a>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
</xsl:otherwise> </xsl:otherwise>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
/** /**
* *
*/ */
package testcase.gui; package testcase.gui.bvt;
import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
...@@ -103,7 +103,7 @@ import testlib.gui.Log; ...@@ -103,7 +103,7 @@ import testlib.gui.Log;
/** /**
* *
*/ */
public class BVTFunction { public class BasicFunctionTest {
@Rule @Rule
public Log LOG = new Log(); public Log LOG = new Log();
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
/** /**
* *
*/ */
package testcase.gui; package testcase.gui.bvt;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNotNull;
...@@ -63,7 +63,7 @@ import testlib.gui.Log; ...@@ -63,7 +63,7 @@ import testlib.gui.Log;
/** /**
* *
*/ */
public class BVTFileType { public class FileTypeTest {
@Rule @Rule
public Log LOG = new Log(); public Log LOG = new Log();
......
...@@ -21,17 +21,18 @@ ...@@ -21,17 +21,18 @@
package testcase.gui; package testcase.gui.bvt;
import static org.openoffice.test.common.Testspace.*; import static org.junit.Assert.assertTrue;
import static org.junit.Assert.*; import static org.openoffice.test.common.FileUtil.readFileAsString;
import static org.openoffice.test.common.FileUtil.*; import static org.openoffice.test.common.Testspace.prepareData;
import static testlib.gui.AppUtil.*; import static testlib.gui.AppUtil.submitOpenDlg;
import static testlib.gui.UIMap.*; import static testlib.gui.UIMap.app;
import static testlib.gui.UIMap.oo;
import static testlib.gui.UIMap.writer;
import java.io.File; import java.io.File;
import org.junit.After;
import org.junit.AfterClass; import org.junit.AfterClass;
import org.junit.Before; import org.junit.Before;
import org.junit.Rule; import org.junit.Rule;
......
/**************************************************************
*
* 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.
*
*************************************************************/
package testsuite.gui;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
import testcase.gui.BVTFileType;
import testcase.gui.BVTFunction;
import testcase.gui.SmokeTest;
@RunWith(Suite.class)
@SuiteClasses({SmokeTest.class, BVTFileType.class, BVTFunction.class})
public class BVT {
}
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