diff options
author | Kurt Zenker <kz@openoffice.org> | 2005-11-02 16:40:33 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2005-11-02 16:40:33 +0000 |
commit | 5a5e4eaf7e81d3471e024029cadadd3f53d0f16a (patch) | |
tree | e7f22e4d9ad6d8967b95e8a719b3dbbfaecfc28e /qadevOOo/runner | |
parent | 44ff7c9f00a00c799f393d874e7fdaff835c9f05 (diff) |
INTEGRATION: CWS qadev24 (1.11.28); FILE MERGED
2005/09/19 21:45:17 cn 1.11.28.2: RESYNC: (1.11-1.12); FILE MERGED
2005/07/20 15:15:48 cn 1.11.28.1: #i52234# if parameter 'NewOfficeInstance' is given, every test job gets a new office instance
Diffstat (limited to 'qadevOOo/runner')
-rw-r--r-- | qadevOOo/runner/base/java_fat.java | 102 |
1 files changed, 71 insertions, 31 deletions
diff --git a/qadevOOo/runner/base/java_fat.java b/qadevOOo/runner/base/java_fat.java index cb5f9fc6e83e..b73b8c2aee88 100644 --- a/qadevOOo/runner/base/java_fat.java +++ b/qadevOOo/runner/base/java_fat.java @@ -4,9 +4,9 @@ * * $RCSfile: java_fat.java,v $ * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * - * last change: $Author: rt $ $Date: 2005-09-08 17:03:53 $ + * last change: $Author: kz $ $Date: 2005-11-02 17:40:33 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -81,6 +81,7 @@ public class java_fat implements TestBase { public static boolean debug = false; public static boolean keepdocument = false; public static boolean logging = true; + public static boolean newOffice = false; private DynamicClassLoader dcl = null; public boolean executeTest(lib.TestParameters param) { @@ -94,6 +95,7 @@ public class java_fat implements TestBase { debug = param.getBool("DebugIsActive"); logging = param.getBool("LoggingIsActive"); keepdocument = param.getBool("KeepDocument"); + newOffice = param.getBool(util.PropertyName.NEW_OFFICE_INSTANCE); if (keepdocument) System.setProperty("KeepDocument","true"); if (ExclusionFile != null) { exclusions = getExclusionList(ExclusionFile,debug); @@ -115,14 +117,18 @@ public class java_fat implements TestBase { return false; } - String officeProviderName = (String) param.get("OfficeProvider"); - AppProvider office = (AppProvider) dcl.getInstance(officeProviderName); +// String officeProviderName = (String) param.get("OfficeProvider"); +// AppProvider office = (AppProvider) dcl.getInstance(officeProviderName); +// +// if (office == null) { +// System.out.println("ERROR: Wrong parameter 'OfficeProvider', " + +// " it cannot be instantiated."); +// System.exit(-1); +// } - if (office == null) { - System.out.println("ERROR: Wrong parameter 'OfficeProvider', " + - " it cannot be instantiated."); - System.exit(-1); - } + AppProvider office = startOffice(param); + + boolean firstRun = true; for (int l = 0; l < entries.length; l++) { if (entries[l] == null) { @@ -135,8 +141,18 @@ public class java_fat implements TestBase { continue; } - XMultiServiceFactory msf = (XMultiServiceFactory) office.getManager( - param); + if (!firstRun && newOffice){ + if (!office.closeExistingOffice(param, true)){ + office.disposeManager(param); + } + startOffice(param); + } + firstRun = false; + +// XMultiServiceFactory msf = (XMultiServiceFactory) office.getManager( +// param); + + XMultiServiceFactory msf = (XMultiServiceFactory) param.getMSF(); if (msf == null) { retValue = false; @@ -144,7 +160,7 @@ public class java_fat implements TestBase { continue; } - param.put("ServiceFactory", msf); +// param.put("ServiceFactory", msf); DescEntry entry = entries[l]; @@ -365,25 +381,27 @@ public class java_fat implements TestBase { } protected TestEnvironment getEnv(DescEntry entry, TestParameters param) { - if (dcl == null) - dcl = new DynamicClassLoader(); - String officeProviderName = (String) param.get("OfficeProvider"); - AppProvider office = (AppProvider) dcl.getInstance(officeProviderName); - - if (office == null) { - System.out.println("ERROR: Wrong parameter 'OfficeProvider', " + - " it cannot be instantiated."); - System.exit(-1); - } - - XMultiServiceFactory msf = (XMultiServiceFactory) office.getManager( - param); - - if (msf == null) { - return null; - } - - param.put("ServiceFactory", msf); +// if (dcl == null) +// dcl = new DynamicClassLoader(); +// String officeProviderName = (String) param.get("OfficeProvider"); +// AppProvider office = (AppProvider) dcl.getInstance(officeProviderName); +// +// if (office == null) { +// System.out.println("ERROR: Wrong parameter 'OfficeProvider', " + +// " it cannot be instantiated."); +// System.exit(-1); +// } +// +// XMultiServiceFactory msf = (XMultiServiceFactory) office.getManager( +// param); +// +// if (msf == null) { +// return null; +// } +// +// param.put("ServiceFactory", msf); + + AppProvider office = startOffice(param); TestCase tCase = null; @@ -496,4 +514,26 @@ public class java_fat implements TestBase { MultiMethodTest ifc = (MultiMethodTest) dcl.getInstance(entry.entryName); return ifc.run(entry, tEnv, param); } + + private AppProvider startOffice(lib.TestParameters param){ + + if (dcl == null) + dcl = new DynamicClassLoader(); + + String officeProviderName = (String) param.get("OfficeProvider"); + AppProvider office = (AppProvider) dcl.getInstance(officeProviderName); + + if (office == null) { + System.out.println("ERROR: Wrong parameter 'OfficeProvider', " + + " it cannot be instantiated."); + System.exit(-1); + } + + XMultiServiceFactory msf = (XMultiServiceFactory) office.getManager( + param); + + param.put("ServiceFactory", msf); + + return office; + } } |