forms/qa/integration/forms/ListSelection.java | 26 ---- forms/qa/integration/forms/ListSelection.props | 2 framework/qa/complex/api_internal/CheckAPI.java | 63 ++-------- framework/qa/complex/api_internal/CheckAPI.props | 4 framework/qa/complex/framework/recovery/RecoveryTest.java | 4 framework/qa/complex/framework/recovery/RecoveryTools.java | 6 framework/qa/complex/loadAllDocuments/CheckXComponentLoader.props | 2 qadevOOo/runner/base/java_complex.java | 22 --- qadevOOo/runner/helper/CfgParser.java | 45 ------- qadevOOo/runner/helper/ClParser.java | 41 ------ qadevOOo/runner/helper/OfficeProvider.java | 50 +++---- qadevOOo/runner/org/openoffice/Runner.java | 20 --- qadevOOo/runner/org/openoffice/RunnerService.java | 20 --- qadevOOo/runner/util/PropertyName.java | 14 -- qadevOOo/runner/util/utils.java | 7 - qadevOOo/tests/java/complex/unoapi/CheckModuleAPI.java | 23 +-- qadevOOo/tests/java/ifc/awt/_XUserInputInterception.java | 6 vcl/qa/complex/memCheck/CheckMemoryUsage.java | 63 ++-------- vcl/qa/complex/memCheck/CheckMemoryUsage.props | 10 - 19 files changed, 85 insertions(+), 343 deletions(-)
New commits: commit a405184aa972ca375f04205fd22f83d54952648d Author: Noel Grandin <[email protected]> Date: Mon Dec 22 14:40:16 2014 +0200 java: inline CheckMemoryUsage test properties Change-Id: Ia5ee0fdc7617b43c4874aa285459f9a1a52cea12 diff --git a/vcl/qa/complex/memCheck/CheckMemoryUsage.java b/vcl/qa/complex/memCheck/CheckMemoryUsage.java index 5eefd42..be221e0 100644 --- a/vcl/qa/complex/memCheck/CheckMemoryUsage.java +++ b/vcl/qa/complex/memCheck/CheckMemoryUsage.java @@ -25,8 +25,6 @@ import java.io.File; import java.io.FileWriter; import java.io.FilenameFilter; import java.io.PrintWriter; -import java.util.ArrayList; -import java.util.Iterator; import java.util.StringTokenizer; import lib.TestParameters; @@ -39,6 +37,8 @@ import org.junit.Test; import org.openoffice.test.OfficeConnection; import util.DesktopTools; +import util.OSName; +import util.PropertyName; import com.sun.star.beans.PropertyValue; import com.sun.star.frame.XStorable; @@ -57,13 +57,6 @@ import com.sun.star.util.XCloseable; * Needed parameters: * <ul> * <li>"TestDocumentPath" - the path where test documents are located.</li> - * <li>"AllowMemoryIncrease" (optional) - the allowed memory increase measured in kByte per exported document. The default is 10 kByte.</li> - * <li>"ExportDocCount" (optional) - the amount of exports for each document that is loaded. Is defaulted to 25. - * <li>"FileExportFilter" (optional) - a relation between loaded document type and used export filter. Is defaulted to - * writer, calc and impress. This parameter can be set with a number to give more than one relation. Example:<br> - * "FileExportFilter1=sxw,writer_pdf_Export"<br> - * "FileExportFilter2=sxc,calc_pdf_Export"<br> - * "FileExportFilter3=sxi,impress_pdf_Export"<br></li> * All parameters are used for iteration over the test document path. * </ul> */ @@ -92,12 +85,11 @@ class TempDir public class CheckMemoryUsage { - private static final String sWriterDoc = "sxw,writer_pdf_Export"; - private static final String sCalcDoc = "sxc,calc_pdf_Export"; - private static final String sImpressDoc = "sxi,impress_pdf_Export"; TempDir m_aTempDir; private String[][] sDocTypeExportFilter; private String[][] sDocuments; + // the allowed memory increase measured in kByte per exported document. The default is 10 kByte. + // the allowed memory increase per exported document: if the memory increase is higher than this number, the test will fail private static final int iAllowMemoryIncrease = 10; private int iExportDocCount = 25; @@ -112,10 +104,10 @@ public class CheckMemoryUsage // some Tests need the qadevOOo TestParameters, it is like a Hashmap for Properties. TestParameters param = new TestParameters(); - param.put("ServiceFactory", xMsf); // some qadevOOo functions need the ServiceFactory + param.put(PropertyName.SERVICE_FACTORY, xMsf); // some qadevOOo functions need the ServiceFactory // test does definitely not run on Windows. - if (param.get("OperatingSystem").equals("wntmsci")) + if (param.get(PropertyName.OPERATING_SYSTEM).equals(OSName.WNTMSCI)) { System.out.println("Test can only reasonably be executed with a tool that " + "displays the memory usage of StarOffice."); @@ -127,45 +119,22 @@ public class CheckMemoryUsage // how many times is every document exported. - int count = param.getInt("ExportDocCount"); - if (count != 0) - { - iExportDocCount = count; - } + // the amount of exported documents: each loaded document will be written 'ExportDocCount' times + iExportDocCount = 25; // get the temp dir for creating the command scripts. m_aTempDir = new TempDir(util.utils.getOfficeTemp/*Dir*/(xMsf)); // get the file extension, export filter connection - Iterator<String> keys = param.keySet().iterator(); - ArrayList<String> v = new ArrayList<String>(); - while (keys.hasNext()) - { - String key = keys.next(); - if (key.startsWith("FileExportFilter")) - { - v.add((String) param.get(key)); - } - } - // if no param given, set defaults. - if (v.isEmpty()) - { - v.add(sWriterDoc); - v.add(sCalcDoc); - v.add(sImpressDoc); - } + // the import and export filters // store a file extension - sDocTypeExportFilter = new String[v.size()][2]; - for (int i = 0; i < v.size(); i++) - { - // 2do: error routine for wrong given params - final String sVContent = v.get(i); - StringTokenizer t = new StringTokenizer(sVContent, ","); - final String sExt = t.nextToken(); - final String sName = t.nextToken(); - sDocTypeExportFilter[i][0] = sExt; - sDocTypeExportFilter[i][1] = sName; - } + sDocTypeExportFilter = new String[3][2]; + sDocTypeExportFilter[0][0] = "sxw"; + sDocTypeExportFilter[0][1] = "writer_pdf_Export"; + sDocTypeExportFilter[1][0] = "sxc"; + sDocTypeExportFilter[1][1] = "calc_pdf_Export"; + sDocTypeExportFilter[2][0] = "sxi"; + sDocTypeExportFilter[2][1] = "impress_pdf_Export"; // get files to load and export String sDocumentPath = TestDocument.getUrl(); diff --git a/vcl/qa/complex/memCheck/CheckMemoryUsage.props b/vcl/qa/complex/memCheck/CheckMemoryUsage.props index 50738ff6..3ff90b5 100644 --- a/vcl/qa/complex/memCheck/CheckMemoryUsage.props +++ b/vcl/qa/complex/memCheck/CheckMemoryUsage.props @@ -19,14 +19,4 @@ # the path to the test documents TestDocumentPath=../../testdocuments -# the allowed memory increase per exported document: if the memory increase is higher than this number, the test will fail -AllowMemoryIncrease=20 -# the amount of exported documents: each loaded document will be written 'ExportDocCount' times -ExportDocCount=25 - -# the import and export filters, separated by comma; further relations can be added with increasing numbers, like -#'FileExportFilter4=sxd,draw_pdf_Export' -FileExportFilter1=sxw,writer_pdf_Export -FileExportFilter2=sxc,calc_pdf_Export -FileExportFilter3=sxi,impress_pdf_Export commit 9b8fb077d26883d3749785803f5a9138d7ba0d29 Author: Noel Grandin <[email protected]> Date: Mon Dec 22 15:08:30 2014 +0200 java: inline some test properties Change-Id: I8be2ee13652ed7223e41765811db577ecc1c85d6 diff --git a/forms/qa/integration/forms/ListSelection.java b/forms/qa/integration/forms/ListSelection.java index ee7d7ca..5e9fd8a 100644 --- a/forms/qa/integration/forms/ListSelection.java +++ b/forms/qa/integration/forms/ListSelection.java @@ -63,28 +63,14 @@ public class ListSelection extends integration.forms.TestCase /* ------------------------------------------------------------------ */ public void checkUserListSelection() throws com.sun.star.uno.Exception, java.lang.Exception { - boolean interactiveTest = param.getBool( "Interactive" ); - - if ( interactiveTest ) + int runs = 5; + for ( int i = 0; i < runs; ++i ) { + log.println( "Round " + ( i + 1 ) + " of " + runs ); prepareDocument(); - waitForUserInput(); - closeDocumentByUI(); - } - else - { - int runs = param.getInt( "Runs" ); - if ( runs == 0 ) - runs = 10; - - for ( int i = 0; i < runs; ++i ) - { - log.println( "Round " + ( i + 1 ) + " of " + runs ); - prepareDocument(); - impl_clickListBox(); - synchronized( this ) { this.wait( 1000 ); } - closeDocument(); - } + impl_clickListBox(); + synchronized( this ) { this.wait( 1000 ); } + closeDocument(); } } diff --git a/forms/qa/integration/forms/ListSelection.props b/forms/qa/integration/forms/ListSelection.props index 4464e32..92b56be 100644 --- a/forms/qa/integration/forms/ListSelection.props +++ b/forms/qa/integration/forms/ListSelection.props @@ -1,3 +1 @@ ThreadTimeOut=600000 -Interactive=false -Runs=5 diff --git a/qadevOOo/runner/helper/CfgParser.java b/qadevOOo/runner/helper/CfgParser.java index d6cf0e6..7c7e17a 100644 --- a/qadevOOo/runner/helper/CfgParser.java +++ b/qadevOOo/runner/helper/CfgParser.java @@ -41,30 +41,13 @@ public class CfgParser public CfgParser(String ini) { - if (ini != null) - { - this.iniFile = ini; - } + this.iniFile = ini; } public void getIniParameters(TestParameters param) { debug = param.getBool(PropertyName.DEBUG_IS_ACTIVE); - Properties cfg = null; - if (iniFile.length() == 0) - { - //no iniFile given, search one in the users home directory - cfg = getProperties(getDefaultFileName(true)); - //try to search the user dir if no iniFile could be found yet - if (cfg == null) - { - cfg = getProperties(getDefaultFileName(false)); - } - } - else - { - cfg = getProperties(iniFile); - } + Properties cfg = getProperties(iniFile); if (cfg != null) { @@ -161,28 +144,4 @@ public class CfgParser return prop; } - private String getDefaultFileName(boolean home) - { - String fileSeparator = System.getProperty("file.separator"); - String path = ""; - if (home) - { - //look inside the home directory - path = System.getProperty("user.home"); - } - else - { - path = System.getProperty("user.dir"); - } - if (fileSeparator.equals("/")) - { - //suppose I'm on Unix-platform - return path + fileSeparator + ".runner.props"; - } - else - { - //suppose I'm on Windows - return path + fileSeparator + "runner.props"; - } - } } commit a7d1292194054cd6842573054b07f046e600b6ec Author: Noel Grandin <[email protected]> Date: Mon Dec 22 15:06:15 2014 +0200 java: remove some dead properties Change-Id: I96adb2941c483ec08c752f35e35cf9ceb941971d diff --git a/framework/qa/complex/loadAllDocuments/CheckXComponentLoader.props b/framework/qa/complex/loadAllDocuments/CheckXComponentLoader.props index 84bdb5a..92b56be 100644 --- a/framework/qa/complex/loadAllDocuments/CheckXComponentLoader.props +++ b/framework/qa/complex/loadAllDocuments/CheckXComponentLoader.props @@ -1,3 +1 @@ -FtpAccess=ftp://apitest:apitest@margritte/%2e%2e/share/easyDocTypes -HttpAccess=http://margritte:8080/share/easyDocTypes ThreadTimeOut=600000 commit 7e1dfc0928ca1e7f9f3b78b6a632b725a0d49867 Author: Noel Grandin <[email protected]> Date: Mon Dec 22 15:04:20 2014 +0200 java: inline the CheckAPI properties no need to make this configurable Change-Id: I0ab149317f4660fc7ebc4c43342d20a386bdbc5f diff --git a/framework/qa/complex/api_internal/CheckAPI.java b/framework/qa/complex/api_internal/CheckAPI.java index 0480191..f2d8f96 100644 --- a/framework/qa/complex/api_internal/CheckAPI.java +++ b/framework/qa/complex/api_internal/CheckAPI.java @@ -23,7 +23,6 @@ import static org.junit.Assert.fail; import helper.OfficeProvider; import helper.ProcessHandler; -import java.util.ArrayList; import java.util.StringTokenizer; import lib.TestParameters; @@ -35,7 +34,6 @@ import org.openoffice.test.OfficeConnection; import com.sun.star.beans.NamedValue; import com.sun.star.beans.PropertyValue; -import com.sun.star.beans.XPropertyAccess; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.task.XJob; import com.sun.star.uno.UnoRuntime; @@ -77,60 +75,25 @@ public class CheckAPI { assertNotNull("Cannot create 'org.openoffice.RunnerService'", oObj); // get the parameters for the internal test - String paramList = (String)param.get("ParamList"); - ArrayList<Object> p = new ArrayList<Object>(); - StringTokenizer paramTokens = new StringTokenizer(paramList, " "); - while(paramTokens.hasMoreTokens()) - { - p.add(paramTokens.nextToken()); - } - int length = p.size()/2+1; - NamedValue[] internalParams = new NamedValue[length]; - for (int i=0; i<length-1; i++) { - internalParams[i] = new NamedValue(); - internalParams[i].Name = (String)p.get(i*2); - internalParams[i].Value = p.get(i*2+1); - System.out.println("Name: "+internalParams[i].Name); - System.out.println("Value: "+(String)internalParams[i].Value); - } + final NamedValue[] internalParams = new NamedValue[3]; + internalParams[0] = new NamedValue(); + internalParams[0].Name = "-OutProducer"; + internalParams[0].Value = "stats.SimpleFileOutProducer"; + internalParams[1] = new NamedValue(); + internalParams[1].Name = "-OutputPath"; + internalParams[1].Value = "/dev/null"; // do we have test jobs? - String testJob = (String)param.get("job"); - PropertyValue[]props; - if (testJob==null) - { - if ( param.get("job1")==null ) - { - // get all test jobs from runner service - XPropertyAccess xPropAcc = UnoRuntime.queryInterface(XPropertyAccess.class, oObj); - props = xPropAcc.getPropertyValues(); - } - else { - int index=1; - p = new ArrayList<Object>(); - while ( param.get("job"+index) != null ) { - p.add(param.get("job"+index)); - index++; - } - props = new PropertyValue[p.size()]; - for ( int i=0; i<props.length; i++ ) { - props[i] = new PropertyValue(); - props[i].Value = p.get(i); - } - } - } - else { - props = new PropertyValue[1]; - props[0] = new PropertyValue(); - props[0].Value = testJob; - } + final PropertyValue[] props = new PropertyValue[1]; + props[0] = new PropertyValue(); + props[0].Value = "sw.SwXTextTable"; System.out.println("Props length: "+ props.length); for (int i=0; i<props.length; i++) { XJob xJob = UnoRuntime.queryInterface(XJob.class, oObj); - internalParams[length-1] = new NamedValue(); - internalParams[length-1].Name = "-o"; - internalParams[length-1].Value = props[i].Value; + internalParams[2] = new NamedValue(); + internalParams[2].Name = "-o"; + internalParams[2].Value = props[i].Value; System.out.println("Executing: " + (String)props[i].Value); String erg = null; diff --git a/framework/qa/complex/api_internal/CheckAPI.props b/framework/qa/complex/api_internal/CheckAPI.props deleted file mode 100644 index 58bd942..0000000 --- a/framework/qa/complex/api_internal/CheckAPI.props +++ /dev/null @@ -1,4 +0,0 @@ -ParamList=-OutProducer stats.SimpleFileOutProducer -OutputPath /dev/null -#AppExecutionCommand=d:\\prj_new\\install\\src680_m17\\program\\soffice --norestore --accept=socket,host=0,port=8100;urp; -# the test job list -job1=sw.SwXTextTable commit e15807f4504a82657b9734f6a2631a2a0c5aa91a Author: Noel Grandin <[email protected]> Date: Mon Dec 22 14:54:07 2014 +0200 java: nothing is passing in a "ComplexIni" parameter Change-Id: Iae7530a52eda020f9074a6de0ef9e4b9779593f6 diff --git a/qadevOOo/runner/base/java_complex.java b/qadevOOo/runner/base/java_complex.java index 4dbf070..b5cafa1 100644 --- a/qadevOOo/runner/base/java_complex.java +++ b/qadevOOo/runner/base/java_complex.java @@ -45,14 +45,6 @@ public class java_complex implements TestBase public boolean executeTest(TestParameters param) { - // is there an ini file for the complex tests defined? - String complexIniFileName = ((String) param.get("ComplexIni")); - if (complexIniFileName != null) - { - CfgParser ini = new CfgParser(complexIniFileName); - ini.getIniParameters(param); - } - // get the test job String testJob = ((String) param.get("TestJob")); @@ -69,25 +61,17 @@ public class java_complex implements TestBase */ public boolean executeTest(TestParameters param, DescEntry[] entries) { - // is there an ini file for the complex tests defined? - String complexIniFileName = ((String) param.get("ComplexIni")); - if (complexIniFileName != null) - { - CfgParser ini = new CfgParser(complexIniFileName); - ini.getIniParameters(param); - } - DynamicClassLoader dcl = new DynamicClassLoader(); ComplexTestCase testClass = null; boolean returnVal = true; // the concept of the TimeOut depends on runner logs. If the runner log, // for example to start a test method, the timeout was reset. This is not -// while the test itself log something like "open docuent...". +// while the test itself log something like "open document...". // An property of complex test could be that it have only one test method -// which works for serveral minutes. Ih this case the TimeOut get not trigger +// which works for several minutes. In this case the TimeOut get not trigger // and the office was killed. -// In complex tests just use "ThreadTimeOut" as timout. +// In complex tests just use "ThreadTimeOut" as timeout. for (int i = 0; i < entries.length; i++) { commit 04e26ca21cf05989030e457e1f938b7066f677d7 Author: Noel Grandin <[email protected]> Date: Mon Dec 22 14:45:07 2014 +0200 java: nothing is passing a "-ini" parameter into the RunnerService Change-Id: Ic8dffc4ed757c74ce383b3dcf204d1c899a0c4f5 diff --git a/qadevOOo/runner/helper/ClParser.java b/qadevOOo/runner/helper/ClParser.java index 263ed2a..1dd70db 100644 --- a/qadevOOo/runner/helper/ClParser.java +++ b/qadevOOo/runner/helper/ClParser.java @@ -103,46 +103,6 @@ public class ClParser } } - /* - * This method returns the path to a Configuration file <br> - * if defined as command line parameter, an empty String elsewhere - */ - public String getIniPath(String[] args) - { - String iniFile = ""; - - for (int i = 0; i < args.length; i++) - { - if (args[i].equals("-ini")) - { - iniFile = args[i + 1]; - break; - } - } - - return iniFile; - } - - /* - * This method returns the path to a Configuration file <br> - * if defined as command line parameter, an empty String elsewhere - */ - public String getRunnerIniPath(String[] args) - { - String iniFile = ""; - - for (int i = 0; i < args.length; i++) - { - if (args[i].equals("-runnerini")) - { - iniFile = args[i + 1]; - break; - } - } - - return iniFile; - } - /** * Map command-line Parameters to TestParameters */ diff --git a/qadevOOo/runner/org/openoffice/Runner.java b/qadevOOo/runner/org/openoffice/Runner.java index 42b7767..c7ee6dc 100644 --- a/qadevOOo/runner/org/openoffice/Runner.java +++ b/qadevOOo/runner/org/openoffice/Runner.java @@ -17,7 +17,6 @@ */ package org.openoffice; -import helper.CfgParser; import helper.ClParser; import java.util.Enumeration; @@ -150,25 +149,6 @@ public class Runner ClParser cli = new ClParser(); - //parse the commandline arguments if an ini-parameter is given - String iniFile = cli.getIniPath(args); - - //initialize cfgParser with ini-path - CfgParser ini = new CfgParser(iniFile); - - //parse ConfigFile - ini.getIniParameters(param); - - - //parse the commandline arguments if an runnerprops-parameter is given - String runnerIniFile = cli.getRunnerIniPath(args); - - //initialize cfgParser with ini-path - CfgParser runnerIni = new CfgParser(runnerIniFile); - - //parse ConfigFile - runnerIni.getIniParameters(param); - //parse the commandline arguments // TODO: no right error message, if no parameter given! cli.getCommandLineParameter(param, args); diff --git a/qadevOOo/runner/org/openoffice/RunnerService.java b/qadevOOo/runner/org/openoffice/RunnerService.java index f04133f..99f3b15 100644 --- a/qadevOOo/runner/org/openoffice/RunnerService.java +++ b/qadevOOo/runner/org/openoffice/RunnerService.java @@ -18,7 +18,6 @@ package org.openoffice; -import helper.CfgParser; import helper.ClParser; import java.util.ArrayList; @@ -76,25 +75,6 @@ public class RunnerService implements XJob, XServiceInfo, ClParser cli = new ClParser(); - //parse the arguments if an ini-parameter is given - String iniFile = cli.getIniPath(arguments); - - //initialize cfgParser with ini-path - CfgParser ini = new CfgParser(iniFile); - - //parse ConfigFile - ini.getIniParameters(param); - - - //parse the commandline arguments if an runnerprops-parameter is given - String runnerIniFile = cli.getRunnerIniPath(arguments); - - //initialize cfgParser with ini-path - CfgParser runnerIni = new CfgParser(runnerIniFile); - - //parse ConfigFile - runnerIni.getIniParameters(param); - //parse the commandline arguments cli.getCommandLineParameter(param,arguments); commit c55f945e4b092a7c972e6f64260ba98784c85a77 Author: Noel Grandin <[email protected]> Date: Mon Dec 22 10:27:15 2014 +0200 java: move DEFAULT_SHORT_WAIT_MS to util.utils so I can turn PopertyNames into an enum Change-Id: I939a83c0962813302a3653e75976147b2300cb18 diff --git a/framework/qa/complex/framework/recovery/RecoveryTest.java b/framework/qa/complex/framework/recovery/RecoveryTest.java index 42f61c3..6bf108c 100644 --- a/framework/qa/complex/framework/recovery/RecoveryTest.java +++ b/framework/qa/complex/framework/recovery/RecoveryTest.java @@ -221,7 +221,7 @@ public class RecoveryTest extends ComplexTestCase { log.println("wating for recovery dialog..."); int counter = 0; - int maximum = param.getInt(PropertyName.THREAD_TIME_OUT) / PropertyName.DEFAULT_SHORT_WAIT_MS; + int maximum = param.getInt(PropertyName.THREAD_TIME_OUT) / utils.DEFAULT_SHORT_WAIT_MS; XDialog oDialog = rt.getActiveDialog(xMSF); @@ -352,7 +352,7 @@ public class RecoveryTest extends ComplexTestCase { util.utils.shortWait(); int counter = 0; - int maximum = param.getInt(PropertyName.THREAD_TIME_OUT) / PropertyName.DEFAULT_SHORT_WAIT_MS; + int maximum = param.getInt(PropertyName.THREAD_TIME_OUT) / utils.DEFAULT_SHORT_WAIT_MS; XAccessibleContext oButton = null; while ((oButton == null) && (counter < maximum)){ diff --git a/framework/qa/complex/framework/recovery/RecoveryTools.java b/framework/qa/complex/framework/recovery/RecoveryTools.java index 7037451..b199bce 100644 --- a/framework/qa/complex/framework/recovery/RecoveryTools.java +++ b/framework/qa/complex/framework/recovery/RecoveryTools.java @@ -93,7 +93,7 @@ public class RecoveryTools { // This could consumes more time then the TimeOut allow. int counter = 0; int multi = 5; - int pause = PropertyName.DEFAULT_SHORT_WAIT_MS * 10; + int pause = utils.DEFAULT_SHORT_WAIT_MS * 10; int timeOut = param.getInt(PropertyName.THREAD_TIME_OUT)*5; int maximum = (timeOut / pause) * multi; @@ -184,7 +184,7 @@ public class RecoveryTools { helper.ProcessHandler ph = (helper.ProcessHandler) param.get("AppProvider"); int timeOut = param.getInt(PropertyName.THREAD_TIME_OUT)*5; - int pause = PropertyName.DEFAULT_SHORT_WAIT_MS * 20; + int pause = utils.DEFAULT_SHORT_WAIT_MS * 20; int multi = 0; while ((ph != null) && (ph.getExitCode()<0) && (pause*multi < timeOut)) { log.println("waiting until the office is closed... remaining " + (timeOut - pause * multi)/1000 + " seconds"); @@ -257,7 +257,7 @@ public class RecoveryTools { { KlickButtonThread kbt = new KlickButtonThread(xWindow, buttonName); kbt.start(); - util.utils.pause(PropertyName.DEFAULT_SHORT_WAIT_MS * 10); + util.utils.pause(utils.DEFAULT_SHORT_WAIT_MS * 10); } public void copyRecoveryData(boolean backup) diff --git a/qadevOOo/runner/util/PropertyName.java b/qadevOOo/runner/util/PropertyName.java index 27e29b1..51d52a8 100644 --- a/qadevOOo/runner/util/PropertyName.java +++ b/qadevOOo/runner/util/PropertyName.java @@ -63,10 +63,6 @@ public interface PropertyName { */ String OUT_PRODUCER = "OutProducer"; /** - * Default short wait time for the Office - */ - int DEFAULT_SHORT_WAIT_MS = 500; - /** * internal only, no parameter * The OfficeProvider contains the full qualified * class that provides a connection to StarOffice<br> diff --git a/qadevOOo/runner/util/utils.java b/qadevOOo/runner/util/utils.java index 4557cb5..4a77e41 100644 --- a/qadevOOo/runner/util/utils.java +++ b/qadevOOo/runner/util/utils.java @@ -648,7 +648,7 @@ public class utils { * This is the default call, which waits for 500ms. */ public static void shortWait() { - pause(PropertyName.DEFAULT_SHORT_WAIT_MS); + pause(utils.DEFAULT_SHORT_WAIT_MS); } /** Causes the thread to sleep some time. @@ -857,4 +857,9 @@ public class utils { dfmt.format(cal.get(Calendar.MILLISECOND)); return "[" + dateTime + "]"; } + + /** + * Default short wait time for the Office + */ + public static final int DEFAULT_SHORT_WAIT_MS = 500; } diff --git a/qadevOOo/tests/java/ifc/awt/_XUserInputInterception.java b/qadevOOo/tests/java/ifc/awt/_XUserInputInterception.java index 56dbf53..43bffcf 100644 --- a/qadevOOo/tests/java/ifc/awt/_XUserInputInterception.java +++ b/qadevOOo/tests/java/ifc/awt/_XUserInputInterception.java @@ -39,7 +39,7 @@ import java.awt.event.InputEvent; import lib.MultiMethodTest; import util.AccessibilityTools; -import util.PropertyName; +import util.utils; /** * Testing <code>com.sun.star.awt.XUserInputInterception</code> @@ -151,7 +151,7 @@ public class _XUserInputInterception extends MultiMethodTest { et.run(); - util.utils.pause(PropertyName.DEFAULT_SHORT_WAIT_MS * 2); + util.utils.pause(utils.DEFAULT_SHORT_WAIT_MS * 2); log.println("key listener thread should be finished."); @@ -214,7 +214,7 @@ public class _XUserInputInterception extends MultiMethodTest { et.run(); - util.utils.pause(PropertyName.DEFAULT_SHORT_WAIT_MS * 2); + util.utils.pause(utils.DEFAULT_SHORT_WAIT_MS * 2); log.println("mouse listener thread should be finished."); boolean bOK = m_mousePressed1 & m_mouseReleased1 & commit b82cc80e8405086856a795a17e655cdcf85020fc Author: Noel Grandin <[email protected]> Date: Mon Dec 22 10:26:01 2014 +0200 java: NO_CWS_ATTACH parameter is unused Change-Id: I3e465987ef3dd502faecaf3c5ce151013a5bf314 diff --git a/qadevOOo/runner/helper/ClParser.java b/qadevOOo/runner/helper/ClParser.java index 22c3e9c..263ed2a 100644 --- a/qadevOOo/runner/helper/ClParser.java +++ b/qadevOOo/runner/helper/ClParser.java @@ -161,7 +161,6 @@ public class ClParser COMMAND_LINE_OPTION_TO_TEST_PARAMETER.put("-debug", "DebugIsActive"); COMMAND_LINE_OPTION_TO_TEST_PARAMETER.put("-log", "LoggingIsActive"); COMMAND_LINE_OPTION_TO_TEST_PARAMETER.put("-dbout", "DataBaseOut"); - COMMAND_LINE_OPTION_TO_TEST_PARAMETER.put("-nca", "NoCwsAttach"); } private String getParameterFor(String name) diff --git a/qadevOOo/runner/util/PropertyName.java b/qadevOOo/runner/util/PropertyName.java index 7a37125..27e29b1 100644 --- a/qadevOOo/runner/util/PropertyName.java +++ b/qadevOOo/runner/util/PropertyName.java @@ -144,12 +144,6 @@ public interface PropertyName { */ String CYGWIN = "Cygwin"; /** - * parameter name: "NoCwsAttach"<p> - * If this parameter is set to "true" , a status of CWS-UnoAPI-Tests was not attached to EIS<p> - * @see complex.unoapi.CheckModuleAPI - */ - String NO_CWS_ATTACH = "NoCwsAttach"; - /** * internal only, no parameter */ String WNTMSCI = "wntmsci"; diff --git a/qadevOOo/tests/java/complex/unoapi/CheckModuleAPI.java b/qadevOOo/tests/java/complex/unoapi/CheckModuleAPI.java index 7465b01..40e75d4 100644 --- a/qadevOOo/tests/java/complex/unoapi/CheckModuleAPI.java +++ b/qadevOOo/tests/java/complex/unoapi/CheckModuleAPI.java @@ -530,23 +530,18 @@ public class CheckModuleAPI extends ComplexTestCase private void setUnoApiCwsStatus(boolean status) { - - if (!param.getBool(PropertyName.NO_CWS_ATTACH)) + final String version = (String) param.get(PropertyName.VERSION); + if (version.startsWith("cws_")) { - - final String version = (String) param.get(PropertyName.VERSION); - if (version.startsWith("cws_")) + try { - try - { - final CwsDataExchangeImpl cde = new CwsDataExchangeImpl(param, log); - cde.setUnoApiCwsStatus(status); - } - catch (ParameterNotFoundException ex) - { - log.println("ERROR: could not wirte status to EIS database: " + ex.toString()); - } + final CwsDataExchangeImpl cde = new CwsDataExchangeImpl(param, log); + cde.setUnoApiCwsStatus(status); + } + catch (ParameterNotFoundException ex) + { + log.println("ERROR: could not wirte status to EIS database: " + ex.toString()); } } } commit 7e394e7746150699b42b464970d8ad71c462996d Author: Noel Grandin <[email protected]> Date: Mon Dec 22 10:22:57 2014 +0200 java: DONT_BACKUP_USERLAYER parameter is unused Change-Id: I2e66a6acfd50b929d43ffdb3e468042875b6b23d diff --git a/qadevOOo/runner/helper/OfficeProvider.java b/qadevOOo/runner/helper/OfficeProvider.java index a1d3910..8b20a3c 100644 --- a/qadevOOo/runner/helper/OfficeProvider.java +++ b/qadevOOo/runner/helper/OfficeProvider.java @@ -281,10 +281,7 @@ public class OfficeProvider implements AppProvider } else if (isExecutable) { - if (!param.getBool(util.PropertyName.DONT_BACKUP_USERLAYER)) - { - backupUserLayer(param, msf); - } + backupUserLayer(param, msf); } } else @@ -515,39 +512,36 @@ public class OfficeProvider implements AppProvider param.remove("AppProvider"); param.remove("ServiceFactory"); - if (!param.getBool(util.PropertyName.DONT_BACKUP_USERLAYER)) + //copy user_backup into user layer + try { - //copy user_backup into user layer - try + final String userLayer = (String) param.get("userLayer"); + final String copyLayer = (String) param.get("copyLayer"); + if (userLayer != null && copyLayer != null) { - final String userLayer = (String) param.get("userLayer"); - final String copyLayer = (String) param.get("copyLayer"); - if (userLayer != null && copyLayer != null) - { - deleteFilesAndDirector(new File(userLayer)); - final File copyFile = new File(copyLayer); - dbg("copy '" + copyFile + "' -> '" + userLayer + "'"); - FileTools.copyDirectory(copyFile, new File(userLayer), new String[] - { - "temp" - }); - dbg("copy '" + copyFile + "' -> '" + userLayer + "' finished"); + deleteFilesAndDirector(new File(userLayer)); + final File copyFile = new File(copyLayer); + dbg("copy '" + copyFile + "' -> '" + userLayer + "'"); + FileTools.copyDirectory(copyFile, new File(userLayer), new String[] + { + "temp" + }); + dbg("copy '" + copyFile + "' -> '" + userLayer + "' finished"); - // remove all user_backup folder in temp dir - // this is for the case the runner was killed and some old backup folder still stay in temp dir + // remove all user_backup folder in temp dir + // this is for the case the runner was killed and some old backup folder still stay in temp dir - } - else - { - System.out.println("Cannot copy layer: '" + copyLayer + "' back to user layer: '" + userLayer + "'"); - } } - catch (java.io.IOException e) + else { - dbg("Couldn't recover from backup\n" + e.getMessage()); + System.out.println("Cannot copy layer: '" + copyLayer + "' back to user layer: '" + userLayer + "'"); } } + catch (java.io.IOException e) + { + dbg("Couldn't recover from backup\n" + e.getMessage()); + } return result; } diff --git a/qadevOOo/runner/util/PropertyName.java b/qadevOOo/runner/util/PropertyName.java index 1932a74..7a37125 100644 --- a/qadevOOo/runner/util/PropertyName.java +++ b/qadevOOo/runner/util/PropertyName.java @@ -170,8 +170,4 @@ public interface PropertyName { */ String UNXMACXI = "unxmacxi"; - /** - * can be used to dont backup the user layer, faster office start/stop but less secure default is to backup the user layer - */ - String DONT_BACKUP_USERLAYER = "DontBackupUserLayer"; } _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
