diff options
author | sb <sb@openoffice.org> | 2010-02-19 16:01:04 +0100 |
---|---|---|
committer | sb <sb@openoffice.org> | 2010-02-19 16:01:04 +0100 |
commit | 5bf30beb87fe471dc055148d49c5034a105c650e (patch) | |
tree | 4392a1f8bdebd66b94a114c97724841f6ece92eb /qadevOOo | |
parent | aa4295d6356f375c7b1ab7820bed9aaf762f58bb (diff) |
sb118: various improvement/cleanup of qadevOOo code
Diffstat (limited to 'qadevOOo')
-rw-r--r-- | qadevOOo/runner/base/java_fat.java | 3 | ||||
-rw-r--r-- | qadevOOo/runner/basicrunner/BasicTestCase.java | 5 | ||||
-rw-r--r-- | qadevOOo/runner/lib/TestCase.java | 20 | ||||
-rw-r--r-- | qadevOOo/runner/util/utils.java | 17 |
4 files changed, 11 insertions, 34 deletions
diff --git a/qadevOOo/runner/base/java_fat.java b/qadevOOo/runner/base/java_fat.java index 2f5733129438..f764c61af26e 100644 --- a/qadevOOo/runner/base/java_fat.java +++ b/qadevOOo/runner/base/java_fat.java @@ -372,6 +372,9 @@ public class java_fat implements TestBase } System.out.println(counter + " of " + entries.length + " tests failed"); + if (counter != 0) { + retValue = false; + } } closeExistingOffice(); diff --git a/qadevOOo/runner/basicrunner/BasicTestCase.java b/qadevOOo/runner/basicrunner/BasicTestCase.java index f0d133a4fbde..b7979acfe854 100644 --- a/qadevOOo/runner/basicrunner/BasicTestCase.java +++ b/qadevOOo/runner/basicrunner/BasicTestCase.java @@ -162,11 +162,6 @@ public class BasicTestCase extends TestCase { return tEnv; } - - protected void cleanupTestEnvironment(TestParameters tParam, - TestEnvironment tEnv, LogWriter log) { - } - /** * BASIC is told to dispose the test object. * @param tParam The test parameters. diff --git a/qadevOOo/runner/lib/TestCase.java b/qadevOOo/runner/lib/TestCase.java index 353a1cee46d1..66e7f4cc5432 100644 --- a/qadevOOo/runner/lib/TestCase.java +++ b/qadevOOo/runner/lib/TestCase.java @@ -143,18 +143,16 @@ public abstract class TestCase { message = e.toString(); System.out.println("Exception while getting Environment "+message); e.printStackTrace(); + cleanup(tParam, log); } return tEnv; } /** * Disposes the <code>TestEnvironment</code> when it is not needed anymore. - * The method calls <code>cleanupTestEnvironment()</code>. * * @param tEnv the environment to dispose * @param tParam test parameters - * - * @see #cleanupTestEnvironment() */ public synchronized void disposeTestEnvironment( TestEnvironment tEnv, TestParameters tParam ) { @@ -177,22 +175,6 @@ public abstract class TestCase { TestParameters tParam, PrintWriter log ); /** - * Called while disposing a <code>TestEnvironment</code>. In the - * implementation does nothing. Subclasses can override to clean up - * the environments created by them. - * - * @param tParam test parameters - * @param tEnv the environment to cleanup - * @param log writer to log information while testing - * - * @see TestEnvironment - * @see #disposeTestEnvironment() - */ - protected void cleanupTestEnvironment( TestParameters Param, - TestEnvironment tEnv, PrintWriter log ) { - } - - /** * @return the name of the object */ public String getObjectName() { diff --git a/qadevOOo/runner/util/utils.java b/qadevOOo/runner/util/utils.java index d555452ff4ee..138c771590ea 100644 --- a/qadevOOo/runner/util/utils.java +++ b/qadevOOo/runner/util/utils.java @@ -41,6 +41,8 @@ import java.util.ArrayList; import java.io.RandomAccessFile; import java.net.Socket; import java.net.ServerSocket; +import java.net.URI; +import java.net.URISyntaxException; import com.sun.star.beans.XPropertySet; import com.sun.star.beans.Property; @@ -367,18 +369,13 @@ public class utils { * */ public static String getOfficeTemp(XMultiServiceFactory msf) { - String tmpDir = util.utils.getUsersTempDir(); + String url = getOfficeUserPath(msf) + "/test-temp/"; try { - String tmp = (String) getOfficeSettingsValue(msf, "Temp"); - if (!tmp.endsWith(System.getProperty("file.separator"))) { - tmp += System.getProperty("file.separator"); - } - tmpDir = getFullURL(tmp); - } catch (Exception e) { - System.out.println("Couldn't get Office TEMP"); - e.printStackTrace(); + new File(new URI(url)).mkdir(); + } catch (URISyntaxException e) { + throw new RuntimeException(e); } - return tmpDir; + return url; } /** |