openoffice-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmar...@apache.org
Subject [openoffice] branch AOO41X updated: Automated Testing backports from trunk to 4.1.x (#125)
Date Tue, 11 May 2021 22:57:19 GMT
This is an automated email from the ASF dual-hosted git repository.

cmarcum pushed a commit to branch AOO41X
in repository https://gitbox.apache.org/repos/asf/openoffice.git


The following commit(s) were added to refs/heads/AOO41X by this push:
     new 44cf028  Automated Testing backports from trunk to 4.1.x (#125)
44cf028 is described below

commit 44cf02803b51681da4056cdf9500cc33ee29bd2f
Author: Carl Marcum <carl.marcum@codebuilders.net>
AuthorDate: Tue May 11 18:57:08 2021 -0400

    Automated Testing backports from trunk to 4.1.x (#125)
    
    * A file conversion test case, which includes some operations of ODF, MS OOXML, MS binary loading/saving, and PDF format exporting.
    
    git-svn-id: https://svn.apache.org/repos/asf/openoffice/trunk@1606622 13f79535-47bb-0310-9956-ffa450edef68
    (cherry picked from commit 64c719661291c877b7db7f727645b18019b1f321)
    
    * When ./configure --with-package-format=installed is used, allow tests to run
    from the resulting install directory instead of needing an archive.
    
    git-svn-id: https://svn.apache.org/repos/asf/openoffice/trunk@1707966 13f79535-47bb-0310-9956-ffa450edef68
    (cherry picked from commit eb07ef5f5735980e18a066e2c5820f1cbf111e2d)
    
    * Fix a test that hangs on the "Do you want to save your changes?" dialog at exit.
    
    git-svn-id: https://svn.apache.org/repos/asf/openoffice/trunk@1707970 13f79535-47bb-0310-9956-ffa450edef68
    (cherry picked from commit bf385f73e5dc2aa1bfa43c45847d1582723850eb)
    
    * #i126604# test framework on *BSD calls "ps" wrongly, can't find AOO to kill it if hung
    
    On *BSD, call "ps" with "-wweo", as the "ww" is needed to produce all the columns in the output.
    Without it, output is trimmed short, and the test framework can't find AOO to kill it,
    leaving AOO running and causing further tests to fail.
    
    git-svn-id: https://svn.apache.org/repos/asf/openoffice/trunk@1710472 13f79535-47bb-0310-9956-ffa450edef68
    (cherry picked from commit 8716daac47832a8aecd6ba509a7944c5ea3edb11)
    
    * Remove an erroneous tab that ends the output of "./run --help" for our
    qa tests.
    
    Patch by: me
    
    git-svn-id: https://svn.apache.org/repos/asf/openoffice/trunk@1733544 13f79535-47bb-0310-9956-ffa450edef68
    (cherry picked from commit fcce20141d66b8aac0ad61b2fa3c8e44593db624)
    
    * Fix an index out of range error in the bvt.gui.FileExport test,
    which could never possibly work as the directory being
    searched for isn't in the path.
    
    Patch by: me
    
    git-svn-id: https://svn.apache.org/repos/asf/openoffice/trunk@1733545 13f79535-47bb-0310-9956-ffa450edef68
    (cherry picked from commit 21ba21a9c763d73402c107c84edd24a1e5dacef2)
    
    * Path separator fixes for the bvt.gui.FileExport test.
    
    Patch by: me
    
    git-svn-id: https://svn.apache.org/repos/asf/openoffice/trunk@1733549 13f79535-47bb-0310-9956-ffa450edef68
    (cherry picked from commit 126941563920c285023d1f6559a20f4a22ed64e1)
    
    * Hide 2 utility classes that falsely register as failing tests.
    
    Patch by: me
    
    git-svn-id: https://svn.apache.org/repos/asf/openoffice/trunk@1733554 13f79535-47bb-0310-9956-ffa450edef68
    (cherry picked from commit 9c5183b9128ae5fa95a129746e5d9e3fc803f184)
    
    * Fix the failing bvt.gui.BasicFunctionTest.testFunctionWizardInFormulaBar
    test method, which was failing because of use of inputKeys() instead of
    typeKeys().
    
    Patch by: me
    
    git-svn-id: https://svn.apache.org/repos/asf/openoffice/trunk@1733558 13f79535-47bb-0310-9956-ffa450edef68
    (cherry picked from commit f9b065480691d651ce3264ccd86265571a8aeb10)
    
    * Some fixes to build.xml for qa tests:
    * Fix the default ${openoffice.home} for *nix (the final "program" directory
      is wrong).
    * Windows uses the "OpenOffice 4" directory instead of "openoffice4".
    
    Patch by: me
    
    git-svn-id: https://svn.apache.org/repos/asf/openoffice/trunk@1737135 13f79535-47bb-0310-9956-ffa450edef68
    (cherry picked from commit 29b55262d99649dfcf0ad7da57989d4d45b4d561)
    
    * When otherwise absent, get the run and run.bat scripts to try to detect
    and use the ${openoffice.home} that the --with-package-format="installed"
    option to ./configure provided.
    
    Patch by: me
    
    git-svn-id: https://svn.apache.org/repos/asf/openoffice/trunk@1737137 13f79535-47bb-0310-9956-ffa450edef68
    (cherry picked from commit 70ab24e9c6201be8c04128ee171d9d3f106700d1)
    
    * Sleep 1 second after sending Tab+Enter, as the UI needs time to
    perform that action before we can copy the text out of the box.
    If we don't wait then the wrong thing gets copied (a picture box
    instead of the text in it), and as a text value it becomes an
    empty string, and tests fail.
    
    Patch by: me
    
    git-svn-id: https://svn.apache.org/repos/asf/openoffice/trunk@1814885 13f79535-47bb-0310-9956-ffa450edef68
    (cherry picked from commit b3fee99c19b41b78a1316b1138346d2ff4cb67af)
    
    * Fix an fvt test that was failing because long and java.lang.Integer
    can't be compared.
    
    Patch by: me
    
    git-svn-id: https://svn.apache.org/repos/asf/openoffice/trunk@1814889 13f79535-47bb-0310-9956-ffa450edef68
    (cherry picked from commit 457d9638ad4f68db7c30e0ce6eb3792a1384b089)
    
    * Explain format of "-tm" parameter when it's wrong.
    
    Patch by: me
    
    (cherry picked from commit 3705dcbca917f01156f9b8d7e49186e5358fb78b)
    
    * Fix a test timing issue, and deal with "Save changes" dialog.
    
    Patch by: me
    
    (cherry picked from commit fbeee538df5958e9c8ad230af896b4c8175ab763)
    
    * Fix another test timing issue.
    
    Patch by: me
    
    (cherry picked from commit 557ccdce2ed90616cf241d2123da4f80f65e7c70)
    
    * RotateAngle is a java.lang.Long
    
    Patch by: me
    
    (cherry picked from commit 0eabae982571a4b36cda4dad5508e00553ddfa53)
    
    * java.util.Calendar's MONTH is 0-based.
    
    Patch by: me
    
    (cherry picked from commit d917f5e50e8747870854d4ad71be7f834cc09fd3)
    
    * java.util.Calendar's HOUR is a 12 hour clock, use HOUR_OF_DAY instead.
    
    Patch by: me
    
    (cherry picked from commit 7b7d1fc921ba2302ad7151595f2580263add807a)
    
    * We don't need the process environment, and on FreeBSD's ps
    there is apparently a total output line string length limit
    of 2048 bytes that causes us to sometimes not find the
    AOO pid, so leave it out.
    
    Patch by: me
    
    (cherry picked from commit 74bd90983f3b030e16b5ca81adac546fd0b6b285)
    
    * Test hangs indefinitely on a link update confirmation dialog,
    and I couldn't find how to confirm the dialog programmatically,
    so at least make it time out instead of hanging
    the whole test run.
    
    Patch by: me
    
    (cherry picked from commit b554e61d4a216798d7a7b23d9f8fa51b42aef9bb)
    
    * Fix a classic bug that was breaking all registry modifications during tests,
    where the return value of a string change method was not getting assigned
    anywhere, and the original read-only string was expected to be the
    one changed.
    
    Patch by: me
    
    (cherry picked from commit 5045dcc653b31c87d6b268d887ec5821c03a2dec)
    
    * Add the registry modification that will disable clearing user personal
    info on saving, so that saving and reloading fields like revision number
    can be tested.
    
    Closes #i128398# - autotest fvt.uno.sd.file.CheckFileProperties loses some DocumentProperties when saving
    
    Patch by: me
    
    (cherry picked from commit ce8ed6d52e206eeb0bf9eb7547f3b52546514d5e)
    
    * Allow for tested editing time to be a little longer than expected.
    
    Patch by: me
    
    (cherry picked from commit 13ae91bf77e0f3b925db7293580c0ad450ab5530)
    
    * Typo.
    
    Patch by: me
    
    (cherry picked from commit ff9157e3c2e6eea1bdfb12a088bffba652a52002)
    
    * Deal with a test that expects strikeout style (X, /, bold, etc.)
    to be preserved when saving to .doc, even though neither
    the fileformat, nor apparently MS Office itself, support that.
    
    Closes i120656 - the bold,with / and with X strike through change to single when save to doc
    
    Patch by: me
    
    (cherry picked from commit 4e588b9e25e0ea797c0e7d78b564a1b48a56819e)
    
    Co-authored-by: Steve Yin <steve_y@apache.org>
    Co-authored-by: Damjan Jovanovic <damjan@apache.org>
    Co-authored-by: asf-sync-process <asf-sync-process@unknown>
    Co-authored-by: damjan <damjan@13f79535-47bb-0310-9956-ffa450edef68>
---
 test/build.xml                                     |  16 +
 .../source/org/openoffice/test/OpenOffice.java     |   2 +-
 .../testcommon/source/org/openoffice/test/Run.help |   2 +-
 .../org/openoffice/test/common/Installer.java      |  73 ++-
 .../org/openoffice/test/common/NamedRequest.java   |   5 +-
 .../org/openoffice/test/common/SystemUtil.java     |   6 +
 test/testgui/source/bvt/gui/BasicFunctionTest.java |   3 +-
 test/testgui/source/bvt/gui/FileExport.java        | 658 +++++++++++++++++++++
 test/testgui/source/bvt/gui/FileTypeTest.java      |   1 +
 .../importexport/FormulaInDifferentWays.java       |   4 +-
 .../source/fvt/uno/sc/sheet/SheetBasicTest.java    |   3 +-
 .../fvt/uno/sd/file/CheckFileProperties.java       |  29 +-
 .../source/fvt/uno/sw/frame/FrameBackGraphic.java  |   2 +-
 .../uno/sw/puretext/CharacterStrikeThrough.java    |  24 +-
 .../source/org/openoffice/test/uno/UnoApp.java     |  13 +-
 15 files changed, 789 insertions(+), 52 deletions(-)

diff --git a/test/build.xml b/test/build.xml
index 96e5668..e74b7b5 100644
--- a/test/build.xml
+++ b/test/build.xml
@@ -139,9 +139,24 @@
 	</target>
 	
 	<target name="test" depends="compile" description="start test">
+		<!-- Try the specified ${openoffice.home} first -->
 		<condition property="test.arg0" value="-Dopenoffice.home=${openoffice.home}">
 			<isset property="openoffice.home" />
 		</condition>
+
+		<!-- Next try the internal install path that the with-package-format=installed option to configure uses -->
+		<available type="dir" file="${env.SRC_ROOT}/instsetoo_native/${env.INPATH}/Apache_OpenOffice/installed/install/en-US/openoffice4"
+			property="internalInstalledDirNix" value="${env.SRC_ROOT}/instsetoo_native/${env.INPATH}/Apache_OpenOffice/installed/install/en-US/openoffice4"/>
+		<condition property="test.arg0" value="-Dopenoffice.home=${internalInstalledDirNix}">
+			<isset property="internalInstalledDirNix" />
+		</condition>
+		<available type="dir" file="${env.SRC_ROOT}/instsetoo_native/${env.INPATH}/Apache_OpenOffice/installed/install/en-US/OpenOffice 4"
+			property="internalInstalledDirWin" value="${env.SRC_ROOT}/instsetoo_native/${env.INPATH}/Apache_OpenOffice/installed/install/en-US/OpenOffice 4"/>
+		<condition property="test.arg0" value="-Dopenoffice.home=${internalInstalledDirWin}">
+			<isset property="internalInstalledDirWin" />
+		</condition>
+
+		<!-- Finally try the tar.gz and zip archives which build by default -->
 		<pathconvert property="openoffice.pack" setonempty="false">
 			<path>
 				<fileset dir="${env.SRC_ROOT}/instsetoo_native/${env.INPATH}/Apache_OpenOffice/archive/install/en-US" includes="*.tar.gz,*.zip"  erroronmissingdir="false"/>
@@ -150,6 +165,7 @@
 		<condition property="test.arg0" value="-Dopenoffice.pack=${openoffice.pack}">
 			<isset property="openoffice.pack" />
 		</condition>
+
 		<fail message="No OpenOffice available!" unless="test.arg0"/>
 		<condition property="test.executable" value="./run.bat">
 			<os family="windows" />
diff --git a/test/testcommon/source/org/openoffice/test/OpenOffice.java b/test/testcommon/source/org/openoffice/test/OpenOffice.java
index 0a549b0..a5de6d5 100644
--- a/test/testcommon/source/org/openoffice/test/OpenOffice.java
+++ b/test/testcommon/source/org/openoffice/test/OpenOffice.java
@@ -332,7 +332,7 @@ public class OpenOffice {
 					newContent += item;
 				}
 			}
-			content.replace("</oor:items>", "");
+			content = content.replace("</oor:items>", "");
 			if (content.length() == 0)
 				content += "<?xml version=\"1.0\" encoding=\"UTF-8\"?><oor:items xmlns:oor=\"http://openoffice.org/2001/registry\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">";
 			content += newContent + "</oor:items>";
diff --git a/test/testcommon/source/org/openoffice/test/Run.help b/test/testcommon/source/org/openoffice/test/Run.help
index a91d41b..43ff127 100644
--- a/test/testcommon/source/org/openoffice/test/Run.help
+++ b/test/testcommon/source/org/openoffice/test/Run.help
@@ -20,4 +20,4 @@ Example
 	run -Dopenoffice.home=/Applications/OpenOffice.org.app/Contents -tp bvt
 	run -Dopenoffice.home=/Applications/OpenOffice.org.app/Contents -tc bvt:bvt.gui.BasicFunctionTest,bvt.gui.FileTypeTest
 	run -Dopenoffice.pack=http://ci.apache.org/projects/openoffice/install/linux64/Apache_OpenOffice_4.0.0_Linux_x86-64_install-arc_en-US.tar.gz -tp bvt
-	
\ No newline at end of file
+
diff --git a/test/testcommon/source/org/openoffice/test/common/Installer.java b/test/testcommon/source/org/openoffice/test/common/Installer.java
index 93925c3..bfb32a4 100644
--- a/test/testcommon/source/org/openoffice/test/common/Installer.java
+++ b/test/testcommon/source/org/openoffice/test/common/Installer.java
@@ -47,6 +47,28 @@ public class Installer implements Runnable {
 				throw new RuntimeException("Only allow one running test instance!");
 			}
 		}
+
+		prop = findOpenofficeHome();
+		System.setProperty("openoffice.home", prop);
+		log.log(Level.INFO, MessageFormat.format("OpenOffice in {0} will be tested.", prop));
+
+		String[] jars = { "juh.jar", "unoil.jar", "ridl.jar", "jurt.jar" };
+		for (String jar : jars) {
+			File file = FileUtil.findFile(prop, jar);
+
+			if (file != null)
+				addToClassPath(file);
+		}
+
+	}
+
+	private String findOpenofficeHome() {
+		String prop = System.getProperty("openoffice.home");
+		if (prop != null) {
+			validateOpenOfficeInstallation(new File(prop));
+			return prop;
+		}
+
 		if ((prop = System.getProperty("openoffice.pack")) != null) {
 			String onlyNewProp = System.getProperty("only.new");
 			File packFile = null;
@@ -92,33 +114,46 @@ public class Installer implements Runnable {
 				if (files != null && files.length == 1 && files[0].isDirectory()) {
 					files[0].renameTo(installDir);
 				}
-				System.setProperty("openoffice.home", installDir.getAbsolutePath());
+				validateOpenOfficeInstallation(installDir);
+				return installDir.getAbsolutePath();
 			} finally {
 				FileUtil.deleteFile(installTempDir);
 			}
 		}
 
-		prop = System.getProperty("openoffice.home", installDir.getAbsolutePath());
-		File sofficeBin = FileUtil.findFile(new File(prop), "soffice.bin", false);
-		if (sofficeBin == null)
-			throw new RuntimeException(MessageFormat.format(
-					"No valid OpenOffice is found in {0}! Use system property openoffice.home to specify a valid OpenOffice installation directory.", prop));
-		try {
-			prop = sofficeBin.getParentFile().getParentFile().getCanonicalPath();
-			System.setProperty("openoffice.home", prop);
-			log.log(Level.INFO, MessageFormat.format("OpenOffice in {0} will be tested.", prop));
-		} catch (IOException e) {
-			// ignore, never occurs
+		// Try look for the output of ./configure --with-package-format="installed"
+		final String srcRoot = System.getenv("SRC_ROOT");
+		final String inPath = System.getenv("INPATH");
+		if (srcRoot == null || inPath == null) {
+			throw new RuntimeException("Neither openoffice.home nor openoffice.pack were specified, and could not autodetect OpenOffice " +
+				"from ${SRC_ROOT} and ${INPATH}. Please make sure OpenOffice was built with the --with-package-format=\"installed\" option, " +
+				"and you ran \"source <platform>.set.sh\"");
 		}
-
-		String[] jars = { "juh.jar", "unoil.jar", "ridl.jar", "jurt.jar" };
-		for (String jar : jars) {
-			File file = FileUtil.findFile(prop, jar);
-
-			if (file != null)
-				addToClassPath(file);
+		final File instsetoo_native = new File(srcRoot, "instsetoo_native");
+		final File buildDir = new File(instsetoo_native, inPath);
+		final File apacheOpenOffice = new File(buildDir, "Apache_OpenOffice");
+		final File installed = new File(apacheOpenOffice, "installed");
+		final File install = new File(installed, "install");
+		final File enUs = new File(install, "en-US");
+		// *nix:
+		File openoffice4 = new File(enUs, "openoffice4");
+		if (!openoffice4.exists()) {
+			// Windows:
+			openoffice4 = new File(enUs, "OpenOffice 4");
+		}
+		if (!openoffice4.exists()) {
+			throw new RuntimeException("Neither openoffice.home nor openoffice.pack were specified, and could not find OpenOffice in " + openoffice4.getAbsolutePath());
 		}
+		validateOpenOfficeInstallation(openoffice4);
+		return openoffice4.getAbsolutePath();
+	}
 
+	private static void validateOpenOfficeInstallation(File directory) {
+		final File sofficeBin = FileUtil.findFile(directory, "soffice.bin", false);
+		if (sofficeBin == null) {
+			throw new RuntimeException(MessageFormat.format(
+				"No valid OpenOffice found in {0}!", directory.getAbsolutePath()));
+		}
 	}
 
 	public static boolean addToClassPath(File file) {
diff --git a/test/testcommon/source/org/openoffice/test/common/NamedRequest.java b/test/testcommon/source/org/openoffice/test/common/NamedRequest.java
index ffb4b6e..dbfbe55 100644
--- a/test/testcommon/source/org/openoffice/test/common/NamedRequest.java
+++ b/test/testcommon/source/org/openoffice/test/common/NamedRequest.java
@@ -123,6 +123,9 @@ public class NamedRequest extends Request {
 		String[] methods = arg.split(",");
 		for (String m : methods) {
 			int i = m.lastIndexOf(".");
+			if (i < 0) {
+				throw new RuntimeException("-tm parameter needs to have the form className.methodName");
+			}
 			String className = m.substring(0, i);
 			String methodName = m.substring(++i);
 			try {
@@ -179,4 +182,4 @@ public class NamedRequest extends Request {
 		}
 	}
 
-}
\ No newline at end of file
+}
diff --git a/test/testcommon/source/org/openoffice/test/common/SystemUtil.java b/test/testcommon/source/org/openoffice/test/common/SystemUtil.java
index 195198a..a145991 100644
--- a/test/testcommon/source/org/openoffice/test/common/SystemUtil.java
+++ b/test/testcommon/source/org/openoffice/test/common/SystemUtil.java
@@ -96,6 +96,10 @@ public class SystemUtil {
 	public static boolean isMac() {
 		return platform.startsWith("Mac");
 	}
+	
+	public static boolean isBSD() {
+		return platform.endsWith("BSD");
+	}
 
 	public static String getOSName() {
 		return osName;
@@ -301,6 +305,8 @@ public class SystemUtil {
 					FileUtil.writeStringToFile(file.getAbsolutePath(), contents);
 //				}
 				exec(new String[] { "cscript", "//Nologo", file.getAbsolutePath()}, null, null, output, output);
+			} else if (isBSD()) {
+				exec(new String[] {"ps", "-wwo", "pid,command"}, null, null, output, output);
 			} else {
 				exec(new String[] {"ps", "-eo", "pid,command"}, null, null, output, output);
 			}
diff --git a/test/testgui/source/bvt/gui/BasicFunctionTest.java b/test/testgui/source/bvt/gui/BasicFunctionTest.java
index 349ce11..21aa315 100644
--- a/test/testgui/source/bvt/gui/BasicFunctionTest.java
+++ b/test/testgui/source/bvt/gui/BasicFunctionTest.java
@@ -325,6 +325,7 @@ public class BasicFunctionTest {
 		assertEquals(
 				"Apache Awesome OpenOffice is comprised of six personal productivity applications: a word processor (and its web-authoring component), spreadsheet, presentation graphics, drawing, equation editor, and database. Awesome OpenOffice is released on Windows, Solaris, Linux and Macintosh operation systems, with more communities joining, including a mature FreeBSD port. Awesome OpenOffice is localized, supporting over 110 languages worldwide. ",
 				copyAll());
+		discard();
 	}
 
 	@Test
@@ -674,7 +675,7 @@ public class BasicFunctionTest {
 		// SC_FunctionWizardDlg_FunctionList.doubleClick(5, 5);
 		scFunctionWizardDlgFunctionList.select("ABS");
 		scFunctionWizardDlgNext.click(); // Use "Next" button
-		scFunctionWizardDlgEdit1.inputKeys("A1");
+		scFunctionWizardDlgEdit1.typeKeys("A1");
 		scFunctionWizardDlg.ok();
 		// Verify if the calculated result is equal to the expected result
 		assertEquals("The calculated result", expectedResult, SCTool.getCellText("B1"));
diff --git a/test/testgui/source/bvt/gui/FileExport.java b/test/testgui/source/bvt/gui/FileExport.java
new file mode 100644
index 0000000..2a95d33
--- /dev/null
+++ b/test/testgui/source/bvt/gui/FileExport.java
@@ -0,0 +1,658 @@
+/**************************************************************
+ * 
+ * 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 bvt.gui;
+
+import static org.openoffice.test.common.Testspace.*;
+import static testlib.gui.AppTool.*;
+import static testlib.gui.UIMap.*;
+
+import java.io.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.ListIterator;
+import java.util.concurrent.TimeoutException;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.Reader;
+import java.io.InputStreamReader;
+import java.lang.RuntimeException;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Rule;
+import org.junit.Test;
+import org.openoffice.test.common.Condition;
+import org.openoffice.test.common.DataSheet;
+import org.openoffice.test.common.FileUtil;
+import org.openoffice.test.common.Logger;
+import org.openoffice.test.common.Testspace;
+import org.openoffice.test.vcl.widgets.VclDialog;
+
+
+public class FileExport {
+	private static class TestType {
+
+		public TestType(boolean doc, boolean spread, boolean slide) {
+			documentT = doc;
+			spreadsheetT = spread;
+			slideT = slide;
+		}
+
+		public boolean documentT;
+		public boolean spreadsheetT;
+		public boolean slideT;
+	};
+
+	private static class ContinuePoint {
+		public String path;
+		public int i;
+
+		ContinuePoint() {
+			path = "";
+			i = 0;
+		}
+	}
+
+	// for example
+	// the path is "D:\\aoo\\utaoo\\testspace\\ooxmlsamples"
+	String samplespath = "";// a dir
+	String outpath = ""; // a dir
+	static double timeout = 100;
+	static double interval = 0.1;
+	double sleeptime = 1;
+	boolean bContinue = false;// if failed,next execute from the continue point
+	TestType atest = new TestType(true, true, true);// doc,spreadsheet,slide
+	ContinuePoint thepoint = null;
+	BufferedWriter fwContinue = null;
+	String testedlogfile = "";
+
+	private static DataSheet result;
+	private String scenario = null;
+	private File sourceFile = null;
+
+	public static final VclDialog passwdDlg = dialog("");
+
+	public List<String> recursionfiles(File path, List<String> resultFileName) {
+		File[] files = path.listFiles();
+		if (files == null)
+			return resultFileName;
+		for (File f : files) {
+			if (f.isDirectory()) {// a path
+				if (!f.isHidden() && !f.getName().startsWith(".")) {
+					sampledirs.add(f.getPath());
+					recursionfiles(f, resultFileName);
+				}
+			} else {// a file
+				if (!f.isHidden() && !f.getName().startsWith(".")) {
+					String apath = f.getPath();
+
+					int sepIndex = apath.indexOf(File.separatorChar);
+					String userpath = apath.substring(sepIndex);
+					String newpath = outpath + userpath;
+
+					File file = new File(newpath);
+					File parent = file.getParentFile();
+					if (parent != null && !parent.exists()) {
+						parent.mkdirs();
+					}
+					resultFileName.add(f.getPath());
+				}
+			}
+		}
+		return resultFileName;
+	}
+
+	private String getrealoutpath(String p) {
+		String apath = p;
+
+		int sepIndex = apath.indexOf(File.separatorChar);
+		int sepIndexLast = apath.lastIndexOf(File.separatorChar);
+		String userpath = apath.substring(sepIndex, sepIndexLast);
+		String newpath = outpath + userpath;
+		File tempFolderFile = new File(newpath);
+		if (!tempFolderFile.exists()) {
+			tempFolderFile.mkdirs();
+		}
+		return newpath;
+	}
+
+	private List<String> samplelist = null;
+	private List<String> sampledirs = null;
+
+	@Rule
+	public Logger log = Logger.getLogger(this);
+
+	@BeforeClass
+	public static void beforeClass() {
+		app.clean();
+	}
+
+	@AfterClass
+	public static void afterClass() {
+		app.stop();
+	}
+
+	@Before
+	public void before() {
+
+	}
+
+	@After
+	public void after() throws Exception {
+		app.stop();
+	}
+
+	void getcontinuepoint() {
+
+		if (bContinue == false) {
+			thepoint.path = "";
+			thepoint.i = 0;
+			return;
+		}
+		File ftestedlog = new File(testedlogfile);
+		Reader reader = null;
+		try {
+			reader = new InputStreamReader(new FileInputStream(ftestedlog));
+		} catch (FileNotFoundException e1) {
+			// TODO Auto-generated catch block
+			e1.printStackTrace();
+		}
+
+		BufferedReader br = new BufferedReader(reader);
+
+		String line = null;
+		int countline = 0;
+		int m = 0;
+		try {
+			if ((line = br.readLine()) != null) {
+				if (countline == 0) {
+					thepoint.path = line;
+				} else {
+
+					m = Integer.parseInt(line);
+					if (m > 0)
+						thepoint.i = m;
+				}
+			}
+		} catch (NumberFormatException e1) {
+			// TODO Auto-generated catch block
+			e1.printStackTrace();
+		} catch (IOException e1) {
+			// TODO Auto-generated catch block
+			e1.printStackTrace();
+		}
+	}
+
+	/**
+	 * Test Open/SaveAs ooxml file by Aoo
+	 * 
+	 * @throws Exception
+	 */
+	@Test
+	public void testSaveAs() throws Exception {
+		samplelist = new ArrayList<String>();
+		sampledirs = new ArrayList<String>();
+		thepoint = new ContinuePoint();
+		File spacepath = new File(Testspace.getPath());
+		File absspath = spacepath.getAbsoluteFile();
+		String abspre = absspath.getParent();
+
+		result = new DataSheet(getFile("outputlog" + File.separatorChar
+				+ FileExport.class.getName() + ".xml"));
+		result.addRow("data", "File Path", "File Size", "Scenario",
+				"Exported File Path", "Exported File Size", "Result", "Error");
+
+		testedlogfile = abspre + "testgui" + File.separatorChar + "cases_tested.txt";
+		samplespath = "samples";
+		
+		if (outpath.length() == 0) {
+			File workspacepath = Testspace.getFile("output");// ..\\testspace\\output
+			outpath = workspacepath.getAbsolutePath();
+
+			// outpath = "D:\\AOOautomation\\Docs sample files\\out";
+		}
+
+		if (bContinue)
+			getcontinuepoint();
+
+		File samplesDir = Testspace.getFile(samplespath);
+		recursionfiles(samplesDir, samplelist);
+		ListIterator<String> it = sampledirs.listIterator();
+
+		boolean bstartfromthis = false;
+		while (it.hasNext()) {
+
+			String str = (String) it.next();
+			if (!bContinue) {
+				File afiledir = new File(str);
+				dotest(afiledir);
+			} else {
+				File file = new File(thepoint.path);
+				File parent = file.getParentFile();
+				if (parent != null) {
+					String pathbegin = parent.getAbsolutePath();
+					if (pathbegin.equalsIgnoreCase(str)) {
+						bstartfromthis = true;
+
+					}
+				}
+				if (bstartfromthis == true) {
+					File afiledir = new File(str);
+					dotest(afiledir);
+				}
+			}
+		}
+	}
+
+	public void dotest(File samplesDir) throws Exception {
+		FilenameFilter testFilter = new FilenameFilter() {
+			public boolean accept(File file, String name) {
+				if (name.endsWith(".doc") || name.endsWith(".docx")
+						|| name.endsWith(".dot") || name.endsWith(".xls")
+						|| name.endsWith(".xlsx") || name.endsWith(".ods")
+						|| name.endsWith(".ppt") || name.endsWith(".pptx")
+						|| name.endsWith(".odp")) {
+					// filters files
+					return true;
+				} else {
+					return false;
+				}
+			}
+		};
+		File[] files = samplesDir.listFiles(testFilter);
+		Arrays.sort(files);
+		int nfiles = files.length;
+		if (nfiles == 0)
+			return;
+
+		int i = thepoint.i;
+		for (; i < nfiles; i++) {
+			File afile = files[i];
+			String path = afile.getAbsolutePath();
+
+			String extName = FileUtil.getFileExtName(path).toLowerCase();
+			boolean bShouldTest = false;
+			if (extName.equals("doc") || extName.equals("docx")
+					|| extName.equals("odt")) {
+				bShouldTest = true;
+				if (atest.documentT == false)
+					continue;
+			}
+			if (extName.equals("ppt") || extName.equals("pptx")
+					|| extName.equals("odp")) {
+				bShouldTest = true;
+				if (atest.slideT == false)
+					continue;
+			}
+			if (extName.equals("xls") || extName.equals("xlsx")
+					|| extName.equals("ods")) {
+				bShouldTest = true;
+				if (atest.spreadsheetT == false)
+					continue;
+			}
+			if (!bShouldTest)
+				continue;
+			String exportname = "aoo_" + afile.getName();
+
+			sourceFile = new File(path);
+
+			app.stop();
+			app.start();
+
+			if(!Open(path)){
+				continue;
+			}
+
+			String newpath = getrealoutpath(path);
+
+			// do testing
+			if (!savetosameformat(exportname, newpath)) {
+				continue;
+			}
+
+			if(!Open(path)) {
+				continue;
+
+			}
+			if (!savetodiffformat(exportname, newpath)) {
+				continue;
+			}
+
+			if(!Open(path)) {
+				continue;
+
+			}
+
+			if (!savetopdfformat(exportname, newpath)) {
+				continue;
+			}			
+		}
+	}
+
+	private boolean Open(String path) throws Exception {
+		try {
+			open(path);
+			if (!app.exists())
+				throw new RuntimeException();
+			HandleBlockers(false);
+			if(statusBar.exists(timeout))
+				statusBar.waitForEnabled(timeout, interval);
+			else
+				throw new TimeoutException("time out");
+			HandleBlockers(false);
+			if (!app.exists())
+				throw new RuntimeException();
+			return true;
+		} catch (Exception e) {
+			try {
+				String reason = e.getMessage();
+				if (reason == null || reason.isEmpty())
+					reason = "Opening";
+				result.addRow("data", sourceFile.getCanonicalPath(),
+						sourceFile.length(), scenario, "", "", "Fail", reason);
+			} catch (IOException e1) {
+				// TODO Auto-generated catch block
+				e1.printStackTrace();
+			}
+			return false;
+		}
+	}
+
+	private boolean savetosameformat(String file, String outpath) {
+		try {
+			File reportDir = Testspace.getFile(outpath);
+
+			String extName = FileUtil.getFileExtName(file).toLowerCase();
+
+			boolean formatchanged = false;
+			if (extName.equals("docx")) {
+				extName = "doc";
+				formatchanged = true;
+			} else if (extName.equals("pptx")) {
+				extName = "ppt";
+				formatchanged = true;
+			} else if (extName.equals("xlsx")) {
+				extName = "xls";
+				formatchanged = true;
+			}
+			
+			scenario = FileUtil.getFileExtName(file).toLowerCase() + " to " + extName;
+
+			int dotIndex = file.lastIndexOf(".");
+			String pre = file.substring(0, dotIndex + 1);
+			String newfile = pre + extName;
+
+			String saveTo = reportDir + File.separator + file;
+			if (formatchanged)
+				saveTo = reportDir + File.separator + newfile;
+			// Save the text document
+			deleteFile(saveTo);
+			SaveAs(saveTo);
+			Close();
+			if(!Open(saveTo))
+				return false;
+
+			String exception = "";
+			String resultflag = "";
+			try {
+				Close();
+				resultflag = "Pass";
+			} catch (Exception e) {
+				exception = e.getMessage();
+				resultflag = "Fail";
+			}
+
+			File targetFile = new File(saveTo);
+			result.addRow("data", sourceFile.getCanonicalPath(),
+					sourceFile.length(), scenario, saveTo, targetFile.length(),
+					resultflag, exception);
+
+			return true;
+		} catch (Exception e) {
+			try {
+				String exception = e.getMessage();
+				if (exception == null || exception.isEmpty())
+					exception = "Saving to the same format";
+				result.addRow("data", sourceFile.getCanonicalPath(),
+						sourceFile.length(), scenario, "", "", "Fail", exception);
+			} catch (IOException e1) {
+				// TODO Auto-generated catch block
+				e1.printStackTrace();
+			}
+
+			return false;
+		}
+	}
+
+	private boolean savetodiffformat(String file, String outpath) {
+		try {
+			File reportDir = Testspace.getFile(outpath);
+
+			String extName = FileUtil.getFileExtName(file).toLowerCase();
+
+			String targetExtName = null;
+
+			if (extName.equals("doc") || extName.equals("docx"))
+				targetExtName = "odt";
+			else if (extName.equals("ppt") || extName.equals("pptx"))
+				targetExtName = "odp";
+			else if (extName.equals("xls") || extName.equals("xlsx"))
+				targetExtName = "ods";
+			else if (extName.equals("odt"))
+				targetExtName = "doc";
+			else if (extName.equals("odp"))
+				targetExtName = "ppt";
+			else if (extName.equals("ods"))
+				targetExtName = "xls";
+			
+			scenario = extName + " to " + targetExtName;
+			
+			int dotIndex = file.lastIndexOf(".");
+			String pre = file.substring(0, dotIndex + 1);
+			String saveTo = reportDir + File.separator + pre + targetExtName;
+			deleteFile(saveTo);
+			// long base = System.currentTimeMillis();
+			SaveAs(saveTo);
+			Close();
+			if(!Open(saveTo))
+				return false;
+
+			String exception = "";
+			String resultflag = "";
+			try {
+				Close();
+				resultflag = "Pass";
+			} catch (Exception e) {
+				exception = e.getMessage();
+				resultflag = "Fail";
+			}
+
+			File targetFile = new File(saveTo);
+			result.addRow("data", sourceFile.getCanonicalPath(),
+					sourceFile.length(), scenario, saveTo, targetFile.length(),
+					resultflag, exception);
+
+			return true;
+		} catch (Exception e) {
+			try {
+				String exception = e.getMessage();
+				if (exception == null || exception.isEmpty())
+					exception = "Saving to a different format";
+				result.addRow("data", sourceFile.getCanonicalPath(),
+						sourceFile.length(), scenario, "", "", "Fail", exception);
+			} catch (IOException e1) {
+				// TODO Auto-generated catch block
+				e1.printStackTrace();
+			}
+
+			return false;
+		}
+
+	}
+
+	private void Close() throws Exception {
+		close();
+		HandleBlockers(false);
+	}
+
+	public static void HandleBlockers(final boolean Positive) throws Exception {
+		new Condition() {
+			@Override
+			public boolean value() {
+				while (activeMsgBox.exists()) {
+
+					String context = activeMsgBox.getMessage();
+					if (context.toLowerCase().indexOf("has been modified") >= 0
+							&& context.toLowerCase().indexOf(
+									"do you want to save your changes") >= 0)
+						throw new RuntimeException("A wrong dirty flag");
+					if (context.toLowerCase().indexOf("read-error") >= 0)
+						throw new RuntimeException("Read Error");
+					if (context.toLowerCase().indexOf("does not exist") >= 0)
+						throw new RuntimeException("File not exist");
+
+					try {
+						if (Positive)
+							activeMsgBox.ok();
+						else
+							activeMsgBox.no();
+					} catch (Exception e) {
+						try {
+							if (Positive)
+								activeMsgBox.yes();
+							else
+								activeMsgBox.no();
+						} catch (Exception e1) {
+							try {
+								activeMsgBox.doDefault();
+							} catch (Exception e2) {
+								try {
+									activeMsgBox.ok();
+								} catch (Exception e3) {
+									activeMsgBox.yes();
+								}
+							}
+						}
+					}
+				}
+				if (passwdDlg.exists()) {
+					String caption = passwdDlg.getCaption();
+					if (caption.toLowerCase().indexOf(
+							"enter password to open file") >= 0)
+						throw new RuntimeException("A password protected file");
+					if (caption.toLowerCase().indexOf("properties") >= 0)
+						throw new RuntimeException("An unsupported format");
+					if (SupportedFormats(caption))
+						throw new RuntimeException("An unreadable file");
+				}
+				return true;
+			}
+		
+		}.test(timeout, interval);
+	}
+
+	private static boolean SupportedFormats(String filename) {
+		if (filename.endsWith(".doc") || filename.endsWith(".docx")
+				|| filename.endsWith(".dot") || filename.endsWith(".xls")
+				|| filename.endsWith(".xlsx") || filename.endsWith(".ods")
+				|| filename.endsWith(".ppt") || filename.endsWith(".pptx")
+				|| filename.endsWith(".odp")) {
+			return true;
+		} else {
+			return false;
+		}
+	}
+
+	private void SaveAs(String newfile) throws Exception {
+		saveAs(newfile);
+		HandleBlockers(true);
+		if(statusBar.exists(timeout))
+			statusBar.waitForEnabled(timeout, interval);
+		else
+			throw new TimeoutException("time out");
+	}
+
+	private boolean savetopdfformat(String file, String outpath) {
+		try {
+			File reportDir = Testspace.getFile(outpath);
+			String extName = "pdf";
+
+			int dotIndex = file.lastIndexOf(".");
+			String pre = file.substring(0, dotIndex + 1);
+			String newfile = pre + extName;
+
+			scenario = FileUtil.getFileExtName(file).toLowerCase() + " to pdf";
+			
+			String saveTo = reportDir + File.separator + newfile;
+			// Save the text document
+			app.dispatch(".uno:ExportToPDF");
+			pdfGeneralPage.ok();
+
+			submitSaveDlg(saveTo);
+			HandleBlockers(true);
+			
+			if(statusBar.exists(timeout))
+				statusBar.waitForEnabled(timeout, interval);
+			else
+				throw new TimeoutException("time out");
+
+			String outcome = "Pass";
+			try {
+				Close();
+			} catch (Exception e) {
+				if (!e.getMessage().matches("A wrong dirty flag"))
+					outcome = e.getMessage();
+				else
+					throw e;
+			}
+
+			
+			File targetFile = new File(saveTo);
+			result.addRow("data", sourceFile.getCanonicalPath(),
+					sourceFile.length(), scenario, saveTo, targetFile.length(),
+					outcome);
+
+			return true;
+		} catch (Exception e) {
+			try {
+				String reason = e.getMessage();
+				if (reason == null || reason.isEmpty())
+					reason = "Exporting to pdf format";
+				result.addRow("data", sourceFile.getCanonicalPath(),
+						sourceFile.length(), scenario, "", "", "Fail", reason);
+			} catch (IOException e1) {
+				// TODO Auto-generated catch block
+				e1.printStackTrace();
+			}
+
+			return false;
+		}
+	}
+
+}
diff --git a/test/testgui/source/bvt/gui/FileTypeTest.java b/test/testgui/source/bvt/gui/FileTypeTest.java
index 4b7f270..f5cb5fc 100644
--- a/test/testgui/source/bvt/gui/FileTypeTest.java
+++ b/test/testgui/source/bvt/gui/FileTypeTest.java
@@ -218,6 +218,7 @@ public class FileTypeTest {
 		impress.waitForExistence(10, 2);
 		sleep(1);
 		impress.typeKeys("<tab><enter>");
+		sleep(1);
 		Assert.assertEquals("The typed text is saved!", text, copyAll().trim());
 	}
 
diff --git a/test/testgui/source/fvt/gui/formula/importexport/FormulaInDifferentWays.java b/test/testgui/source/fvt/gui/formula/importexport/FormulaInDifferentWays.java
index aec77ea..3c00f12 100644
--- a/test/testgui/source/fvt/gui/formula/importexport/FormulaInDifferentWays.java
+++ b/test/testgui/source/fvt/gui/formula/importexport/FormulaInDifferentWays.java
@@ -54,7 +54,7 @@ public class FormulaInDifferentWays {
 
 	@After
 	public void tearDown() throws Exception {
-		close();
+		discard();
 		app.stop();
 	}
 
@@ -89,6 +89,7 @@ public class FormulaInDifferentWays {
 		// commands window
 		mathElementsRelations.click();
 		mathElementsRelationsNotEqual.click();
+		sleep(1);
 		typeKeys("a");
 		app.dispatch(".uno:NextMark");
 		typeKeys("b");
@@ -167,6 +168,7 @@ public class FormulaInDifferentWays {
 		// commands window
 		mathElementsUnaryBinary.click();
 		mathElementsUnaryBinaryPlus.click();
+		sleep(1);
 		typeKeys("a"); // "+a";
 
 		// Undo and verify if it works fine
diff --git a/test/testuno/source/fvt/uno/sc/sheet/SheetBasicTest.java b/test/testuno/source/fvt/uno/sc/sheet/SheetBasicTest.java
index e28e7c1..7563f13 100644
--- a/test/testuno/source/fvt/uno/sc/sheet/SheetBasicTest.java
+++ b/test/testuno/source/fvt/uno/sc/sheet/SheetBasicTest.java
@@ -313,7 +313,8 @@ public class SheetBasicTest {
 	/**
 	 * test insert sheet from other file
 	 */
-	@Test
+	// FIXME: locks up on update link confirmation dialog.
+	@Test(timeout = 15000)
 	public void insertSheetFromfile() throws Exception {
 		// New a document source.xls, add value to 3 sheet
 		scDocument = SCUtil.getSCDocument(scComponent);
diff --git a/test/testuno/source/fvt/uno/sd/file/CheckFileProperties.java b/test/testuno/source/fvt/uno/sd/file/CheckFileProperties.java
index cece47a..e4cbf3c 100644
--- a/test/testuno/source/fvt/uno/sd/file/CheckFileProperties.java
+++ b/test/testuno/source/fvt/uno/sd/file/CheckFileProperties.java
@@ -29,6 +29,7 @@ import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
+import org.openoffice.test.OpenOffice;
 import org.openoffice.test.uno.UnoApp;
 import org.openoffice.test.common.FileUtil;
 import org.openoffice.test.common.Testspace;
@@ -61,7 +62,7 @@ import com.sun.star.uno.UnoRuntime;
  */
 public class CheckFileProperties {
 
-	private static final UnoApp app = new UnoApp();
+	private static UnoApp app;
 
 	private XComponent m_xSDComponent = null;
 	private static String m_filePath = null;
@@ -117,6 +118,15 @@ public class CheckFileProperties {
 
 	@BeforeClass
 	public static void setUpConnection() throws Exception {
+		OpenOffice openOffice = UnoApp.getDefaultOpenOffice();
+                // #128398#
+                openOffice.addRegistryModifications(
+                    " <item oor:path=\"/org.openoffice.Office.Common/Security/Scripting\">\n" +
+                    "  <prop oor:name=\"RemovePersonalInfoOnSaving\" oor:op=\"fuse\">\n" +
+                    "   <value>false</value>\n" +
+                    "  </prop>\n" +
+                    " </item>");
+                app = new UnoApp(openOffice);
 		app.start();
 		m_filePath = Testspace.getPath("temp/CheckFileProperties.odp");	
 		FileUtil.deleteFile(m_filePath);
@@ -183,10 +193,11 @@ public class CheckFileProperties {
 		Calendar ca = Calendar.getInstance();		
 		DateTime currentDateTime = new DateTime();
 		currentDateTime.Year = (short)ca.get(Calendar.YEAR);
-		currentDateTime.Month = (short)ca.get(Calendar.MONTH);
+		// java.util.Calendar's months start at 0=January.
+		currentDateTime.Month = (short)(ca.get(Calendar.MONTH) + 1);
 		currentDateTime.Day = (short)ca.get(Calendar.DATE);
 		currentDateTime.Minutes = (short)ca.get(Calendar.MINUTE);
-		currentDateTime.Hours = (short)ca.get(Calendar.HOUR);
+		currentDateTime.Hours = (short)ca.get(Calendar.HOUR_OF_DAY);
 		currentDateTime.Seconds = (short)ca.get(Calendar.SECOND);
 		
 		return currentDateTime;
@@ -196,7 +207,8 @@ public class CheckFileProperties {
 		Calendar ca = Calendar.getInstance();		
 		Date currentDate = new Date();
 		currentDate.Year = (short)ca.get(Calendar.YEAR);
-		currentDate.Month = (short)ca.get(Calendar.MONTH);
+		// java.util.Calendar's months start at 0=January.
+		currentDate.Month = (short)(ca.get(Calendar.MONTH) + 1);
 		currentDate.Day = (short)ca.get(Calendar.DATE);
 		
 		return currentDate;
@@ -290,7 +302,8 @@ public class CheckFileProperties {
 	 * UI entry: File->Properties->General->Total editing time*/
 	@Test
 	public void testGeneralEditingDuration() throws Exception {
-		int editingDuration = 60;
+		final int editingDuration = 60;
+                final int maxEditingDuration = 70;
 		
 		XDocumentProperties xDocPro = getDocumentProperties();
 		
@@ -300,7 +313,9 @@ public class CheckFileProperties {
 		app.closeDocument(m_xSDComponent);
 		m_xSDComponent = app.loadDocument(m_filePath);
 		XDocumentProperties xDocPro2 = getDocumentProperties();
-		assertEquals("Totally editing time should be "+ editingDuration, editingDuration, xDocPro2.getEditingDuration());		
+                // It can take a few seconds longer to save the file, increasing it above editingDuration
+		assertTrue("Total editing time >= "+ editingDuration, Integer.compare(editingDuration, xDocPro2.getEditingDuration()) <= 0);
+                assertTrue("Total editing time <= "+ maxEditingDuration, Integer.compare(xDocPro2.getEditingDuration(), maxEditingDuration) <= 0);
 	}
 	
 	/*
@@ -317,7 +332,7 @@ public class CheckFileProperties {
 		app.closeDocument(m_xSDComponent);
 		m_xSDComponent = app.loadDocument(m_filePath);
 		XDocumentProperties xDocPro2 = getDocumentProperties();
-		assertEquals("Revision number should be "+ revisionNumber+1, revisionNumber+1, xDocPro2.getEditingCycles());		
+		assertEquals("Revision number increments by 1", revisionNumber+1, xDocPro2.getEditingCycles());
 	}
 	
 	/*
diff --git a/test/testuno/source/fvt/uno/sw/frame/FrameBackGraphic.java b/test/testuno/source/fvt/uno/sw/frame/FrameBackGraphic.java
index e488798..5e9123e 100644
--- a/test/testuno/source/fvt/uno/sw/frame/FrameBackGraphic.java
+++ b/test/testuno/source/fvt/uno/sw/frame/FrameBackGraphic.java
@@ -109,7 +109,7 @@ public class FrameBackGraphic {
 		XPropertySet xFrameProps1_assert = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xFrame_Assert1);
 		GraphicLocation graphiclocation=(GraphicLocation)xFrameProps1_assert.getPropertyValue("BackGraphicLocation");
 		assertEquals("verify Frame backgraphic location",backGraphicLocation,graphiclocation.getValue());
-		assertEquals("verify Frame backgraphic fileter",graphicName,xFrameProps1_assert.getPropertyValue("BackGraphicFilter"));
+		assertEquals("verify Frame backgraphic filter",graphicName,xFrameProps1_assert.getPropertyValue("BackGraphicFilter"));
 		assertEquals("verify Frame backgraphic URL",graphicURL,xFrameProps1_assert.getPropertyValue("BackGraphicURL"));
 	}
 }
diff --git a/test/testuno/source/fvt/uno/sw/puretext/CharacterStrikeThrough.java b/test/testuno/source/fvt/uno/sw/puretext/CharacterStrikeThrough.java
index 689bd66..9b86142 100644
--- a/test/testuno/source/fvt/uno/sw/puretext/CharacterStrikeThrough.java
+++ b/test/testuno/source/fvt/uno/sw/puretext/CharacterStrikeThrough.java
@@ -25,7 +25,6 @@ import static org.junit.Assert.*;
 
 import org.junit.After;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.openoffice.test.common.FileUtil;
 import org.openoffice.test.common.Testspace;
@@ -51,7 +50,7 @@ public class CharacterStrikeThrough {
 		app.close();
 	}
 
-	@Test@Ignore("Bug #120656 - [testUNO patch]bold,/,X strike through change to single when save to doc")
+	@Test
 	public void testCharacterStrikeThroughSetting() throws Exception {
 		XTextDocument xTextDocument = (XTextDocument) UnoRuntime.queryInterface(XTextDocument.class, app.newDocument("swriter"));// new a text document
 		xText = xTextDocument.getText();
@@ -141,26 +140,27 @@ public class CharacterStrikeThrough {
 		XTextCursor xTextCursor_assert_doc=assertDocument_doc.getText().createTextCursor();
 		XPropertySet xCursorProps_assert_doc = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xTextCursor_assert_doc);
 		//verify set property
+                // Bug #120656 - [testUNO patch]bold,/,X strike through change to single when save to doc
 		xTextCursor_assert_doc.gotoStart(false);
 		xTextCursor_assert_doc.goRight((short) 100, true);
-		assertEquals("assert strikethrough is bold",com.sun.star.awt.FontStrikeout.BOLD,xCursorProps_assert_doc.getPropertyValue("CharStrikeout"));
-		xTextCursor_assert_doc.gotoRange(xTextCursor_assert_odt, false);
+		assertEquals("for .doc assert strikethrough is SINGLE instead of bold",com.sun.star.awt.FontStrikeout.SINGLE,xCursorProps_assert_doc.getPropertyValue("CharStrikeout"));
+		xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false);
 		xTextCursor_assert_doc.goRight((short) 100, true);
-        assertEquals("assert strikethrough is don'tknow",com.sun.star.awt.FontStrikeout.NONE,xCursorProps_assert_doc.getPropertyValue("CharStrikeout"));
-        xTextCursor_assert_doc.gotoRange(xTextCursor_assert_odt, false);
+        assertEquals("for .doc assert strikethrough is SINGLE instead of don'tknow",com.sun.star.awt.FontStrikeout.SINGLE,xCursorProps_assert_doc.getPropertyValue("CharStrikeout"));
+        xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false);
         xTextCursor_assert_doc.goRight((short) 100, true);
         assertEquals("assert strikethrough is double",com.sun.star.awt.FontStrikeout.DOUBLE,xCursorProps_assert_doc.getPropertyValue("CharStrikeout"));
-        xTextCursor_assert_doc.gotoRange(xTextCursor_assert_odt, false);
+        xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false);
         xTextCursor_assert_doc.goRight((short) 100, true);
         assertEquals("assert strikethrough is without",com.sun.star.awt.FontStrikeout.NONE,xCursorProps_assert_doc.getPropertyValue("CharStrikeout"));
-        xTextCursor_assert_doc.gotoRange(xTextCursor_assert_odt, false);
+        xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false);
         xTextCursor_assert_doc.goRight((short) 100, true);
         assertEquals("assert strikethrough is single",com.sun.star.awt.FontStrikeout.SINGLE,xCursorProps_assert_doc.getPropertyValue("CharStrikeout"));
-        xTextCursor_assert_doc.gotoRange(xTextCursor_assert_odt, false);
+        xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false);
         xTextCursor_assert_doc.goRight((short) 100, true);
-        assertEquals("assert strikethrough is with /",com.sun.star.awt.FontStrikeout.SLASH,xCursorProps_assert_doc.getPropertyValue("CharStrikeout"));
-        xTextCursor_assert_doc.gotoRange(xTextCursor_assert_odt, false);
+        assertEquals("for .doc assert strikethrough is SINGLE instead of /",com.sun.star.awt.FontStrikeout.SINGLE,xCursorProps_assert_doc.getPropertyValue("CharStrikeout"));
+        xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false);
         xTextCursor_assert_doc.goRight((short) 100, true);
-        assertEquals("assert strikethrough is with X",com.sun.star.awt.FontStrikeout.X,xCursorProps_assert_doc.getPropertyValue("CharStrikeout"));
+        assertEquals("for .doc assert strikethrough is SINGLE instead of X",com.sun.star.awt.FontStrikeout.SINGLE,xCursorProps_assert_doc.getPropertyValue("CharStrikeout"));
 	}
 }
diff --git a/test/testuno/source/org/openoffice/test/uno/UnoApp.java b/test/testuno/source/org/openoffice/test/uno/UnoApp.java
index 8c78593..261f3f5 100644
--- a/test/testuno/source/org/openoffice/test/uno/UnoApp.java
+++ b/test/testuno/source/org/openoffice/test/uno/UnoApp.java
@@ -62,16 +62,15 @@ public class UnoApp {
 	
 	private int reconnectCount = 10;
 	
-	private static OpenOffice defaultOpenOffice = null;
-	
-	static {
-		defaultOpenOffice = new OpenOffice();
-		defaultOpenOffice.addArgs("-nofirststartwizard", "-norestore", "-quickstart=no");
-		defaultOpenOffice.setUnoUrl(OpenOffice.DEFAULT_UNO_URL);
+	public static OpenOffice getDefaultOpenOffice() {
+		OpenOffice openOffice = new OpenOffice();
+		openOffice.addArgs("-nofirststartwizard", "-norestore", "-quickstart=no");
+		openOffice.setUnoUrl(OpenOffice.DEFAULT_UNO_URL);
+                return openOffice;
 	}
 	
 	public UnoApp() {
-		this.openOffice = defaultOpenOffice;
+		this.openOffice = getDefaultOpenOffice();
 	}
 	
 	public UnoApp(OpenOffice openOffice) {

Mime
View raw message