diff options
author | Noel Grandin <noel@peralex.com> | 2015-06-09 15:24:08 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-06-11 12:52:06 +0000 |
commit | 3bd57cc2c0cabf33799edc57d3dd1c90c7857ecd (patch) | |
tree | 353a2b569d3acb9efa06ee4edf0178dd04ede9f8 /qadevOOo/runner | |
parent | 0a8d96b7b565e496a18e22b44d04be7aa2513c94 (diff) |
java:remove more unnecessary catch/re-throw
Change-Id: Id9a13c7f4ae0fd53c95c551544e60af44bb3fb95
Reviewed-on: https://gerrit.libreoffice.org/16203
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'qadevOOo/runner')
-rw-r--r-- | qadevOOo/runner/base/TestBase.java | 2 | ||||
-rw-r--r-- | qadevOOo/runner/base/java_fat.java | 635 | ||||
-rw-r--r-- | qadevOOo/runner/base/java_fat_service.java | 2 | ||||
-rw-r--r-- | qadevOOo/runner/lib/MultiMethodTest.java | 2 | ||||
-rw-r--r-- | qadevOOo/runner/lib/TestCase.java | 4 | ||||
-rw-r--r-- | qadevOOo/runner/org/openoffice/Runner.java | 4 | ||||
-rw-r--r-- | qadevOOo/runner/org/openoffice/RunnerService.java | 10 |
7 files changed, 298 insertions, 361 deletions
diff --git a/qadevOOo/runner/base/TestBase.java b/qadevOOo/runner/base/TestBase.java index 0e4d94710198..9fd0b2debc81 100644 --- a/qadevOOo/runner/base/TestBase.java +++ b/qadevOOo/runner/base/TestBase.java @@ -25,6 +25,6 @@ import lib.TestParameters; */ public interface TestBase { - boolean executeTest(TestParameters param); + boolean executeTest(TestParameters param) throws Exception; } diff --git a/qadevOOo/runner/base/java_fat.java b/qadevOOo/runner/base/java_fat.java index bc63f40b4dfb..c5c14768aa40 100644 --- a/qadevOOo/runner/base/java_fat.java +++ b/qadevOOo/runner/base/java_fat.java @@ -42,8 +42,7 @@ import com.sun.star.lang.XMultiServiceFactory; * * this class handles tests written in java and running on a fat Office */ -public class java_fat implements TestBase -{ +public class java_fat implements TestBase { private boolean logging = true; private DynamicClassLoader m_aDynamicClassLoader = null; @@ -51,273 +50,244 @@ public class java_fat implements TestBase private lib.TestParameters m_aParams; private AppProvider m_aOffice; - public boolean executeTest(lib.TestParameters _aParams) - { - m_aParams = _aParams; + public boolean executeTest(lib.TestParameters _aParams) throws Exception { + m_aParams = _aParams; + + m_aDynamicClassLoader = new DynamicClassLoader(); + + DescGetter dg = new APIDescGetter(); + String job = (String) m_aParams.get("TestJob"); + String ExclusionFile = (String) m_aParams.get("ExclusionList"); + ArrayList<String> exclusions = null; + boolean retValue = true; + boolean isDebug = m_aParams.getBool("DebugIsActive"); + logging = m_aParams.getBool("LoggingIsActive"); + boolean keepdocument = m_aParams.getBool("KeepDocument"); + boolean newOffice = m_aParams + .getBool(util.PropertyName.NEW_OFFICE_INSTANCE); + if (keepdocument) { + System.setProperty("KeepDocument", "true"); + } + if (ExclusionFile != null) { + exclusions = getExclusionList(ExclusionFile, isDebug); + } - m_aDynamicClassLoader = new DynamicClassLoader(); + String sDescriptionPath = (String) m_aParams.get("DescriptionPath"); + DescEntry[] entries = dg.getDescriptionFor(job, sDescriptionPath, + isDebug); - DescGetter dg = new APIDescGetter(); - String job = (String) m_aParams.get("TestJob"); - String ExclusionFile = (String) m_aParams.get("ExclusionList"); - ArrayList<String> exclusions = null; - boolean retValue = true; - boolean isDebug = m_aParams.getBool("DebugIsActive"); - logging = m_aParams.getBool("LoggingIsActive"); - boolean keepdocument = m_aParams.getBool("KeepDocument"); - boolean newOffice = m_aParams.getBool(util.PropertyName.NEW_OFFICE_INSTANCE); - if (keepdocument) - { - System.setProperty("KeepDocument", "true"); - } - if (ExclusionFile != null) - { - exclusions = getExclusionList(ExclusionFile, isDebug); - } + if (entries == null) { + System.out.println("Couldn't get Description for Job: " + job); - String sDescriptionPath = (String) m_aParams.get("DescriptionPath"); - DescEntry[] entries = dg.getDescriptionFor(job, sDescriptionPath, isDebug); + return false; + } - if (entries == null) - { - System.out.println("Couldn't get Description for Job: " + job); + m_aOffice = startOffice(m_aParams); - return false; - } + boolean firstRun = true; - m_aOffice = startOffice(m_aParams); + // Run through all entries (e.g. sw.SwXBookmark.*) - boolean firstRun = true; + for (int l = 0; l < entries.length; l++) { + DescEntry entry = entries[l]; - // Run through all entries (e.g. sw.SwXBookmark.*) + if (entry == null) { + continue; + } - for (int l = 0; l < entries.length; l++) - { - DescEntry entry = entries[l]; + if (entry.hasErrorMsg) { + System.out.println(entries[l].ErrorMsg); + retValue = false; + continue; + } - if (entry == null) - { - continue; + if (!firstRun && newOffice) { + if (!m_aOffice.closeExistingOffice(m_aParams, true)) { + m_aOffice.disposeManager(m_aParams); } + startOffice(m_aParams); + } + firstRun = false; - if (entry.hasErrorMsg) - { - System.out.println(entries[l].ErrorMsg); - retValue = false; - continue; - } + XMultiServiceFactory msf = m_aParams.getMSF(); - if (!firstRun && newOffice) - { - if (!m_aOffice.closeExistingOffice(m_aParams, true)) - { - m_aOffice.disposeManager(m_aParams); - } - startOffice(m_aParams); - } - firstRun = false; + if (msf == null) { + retValue = false; + continue; + } - XMultiServiceFactory msf = m_aParams.getMSF(); + // get some helper classes + Summarizer sumIt = new Summarizer(); + TestCase tCase = getTestCase(entry); + if (tCase == null) { + continue; + } - if (msf == null) - { - retValue = false; - continue; - } + util.utils.pause(2000); - //get some helper classes - Summarizer sumIt = new Summarizer(); - TestCase tCase = getTestCase(entry); - if (tCase == null) - { - continue; - } + System.out.println("Creating: " + entry.entryName); - util.utils.pause(2000); + LogWriter log = (LogWriter) m_aDynamicClassLoader + .getInstance((String) m_aParams.get("LogWriter")); + log.initialize(entry, logging); + entry.UserDefinedParams = m_aParams; - System.out.println("Creating: " + entry.entryName); + tCase.setLogWriter((PrintWriter) log); + tCase.initializeTestCase(m_aParams); - LogWriter log = (LogWriter) m_aDynamicClassLoader.getInstance((String) m_aParams.get("LogWriter")); - log.initialize(entry, logging); - entry.UserDefinedParams = m_aParams; + TestEnvironment tEnv = getTestEnvironment(tCase, entry); + if (tEnv == null) { + continue; + } - tCase.setLogWriter((PrintWriter) log); - tCase.initializeTestCase(m_aParams); + tCase.getObjectName(); - TestEnvironment tEnv = getTestEnvironment(tCase, entry); - if (tEnv == null) - { + for (int j = 0; j < entry.SubEntryCount; j++) { + DescEntry aSubEntry = entry.SubEntries[j]; + final boolean bIsToTest = aSubEntry.isToTest; + if (!bIsToTest) { + Summarizer.summarizeDown(aSubEntry, "not part of the job"); continue; } - tCase.getObjectName(); + final String sLongEntryName = aSubEntry.longName; - for (int j = 0; j < entry.SubEntryCount; j++) - { - DescEntry aSubEntry = entry.SubEntries[j]; - final boolean bIsToTest = aSubEntry.isToTest; - if (!bIsToTest) - { - Summarizer.summarizeDown(aSubEntry, "not part of the job"); - continue; - } + if ((exclusions != null) + && (exclusions.contains(sLongEntryName))) { + Summarizer.summarizeDown(aSubEntry, "known issue"); + continue; + } - final String sLongEntryName = aSubEntry.longName; + // this will shown in test itself - if ((exclusions != null) && (exclusions.contains(sLongEntryName))) - { - Summarizer.summarizeDown(aSubEntry, "known issue"); - continue; - } + LogWriter ifclog = (LogWriter) m_aDynamicClassLoader + .getInstance((String) m_aParams.get("LogWriter")); - // this will shown in test itself + ifclog.initialize(aSubEntry, logging); + aSubEntry.UserDefinedParams = m_aParams; + aSubEntry.Logger = ifclog; - LogWriter ifclog = (LogWriter) m_aDynamicClassLoader.getInstance( (String) m_aParams.get("LogWriter")); - - ifclog.initialize(aSubEntry, logging); - aSubEntry.UserDefinedParams = m_aParams; - aSubEntry.Logger = ifclog; + if (tEnv.isDisposed()) { + closeExistingOffice(); + tEnv = getEnv(entry, m_aParams); + tCase = tEnv.getTestCase(); + } - if (tEnv.isDisposed()) - { + lib.TestResult res = null; + + // run the interface test twice if it failed. + int countInterfaceTestRun = 0; + boolean finished = false; + while (!finished) { + try { + countInterfaceTestRun++; + finished = true; + res = executeInterfaceTest(aSubEntry, tEnv, m_aParams); + } catch (IllegalArgumentException iae) { + System.out.println("Couldn't load class " + + aSubEntry.entryName); + System.out + .println("**** " + iae.getMessage() + " ****"); + Summarizer.summarizeDown(aSubEntry, iae.getMessage()); + } catch (java.lang.NoClassDefFoundError iae) { + System.out.println("Couldn't load class " + + aSubEntry.entryName); + System.out + .println("**** " + iae.getMessage() + " ****"); + Summarizer.summarizeDown(aSubEntry, iae.getMessage()); + } catch (java.lang.RuntimeException e) { closeExistingOffice(); tEnv = getEnv(entry, m_aParams); tCase = tEnv.getTestCase(); - } - - lib.TestResult res = null; - - // run the interface test twice if it failed. - int countInterfaceTestRun = 0; - boolean finished = false; - while (!finished) - { - try - { - countInterfaceTestRun++; - finished = true; - res = executeInterfaceTest(aSubEntry, tEnv, m_aParams); - } - catch (IllegalArgumentException iae) - { - System.out.println("Couldn't load class " + aSubEntry.entryName); - System.out.println("**** " + iae.getMessage() + " ****"); - Summarizer.summarizeDown(aSubEntry, iae.getMessage()); - } - catch (java.lang.NoClassDefFoundError iae) - { - System.out.println("Couldn't load class " + aSubEntry.entryName); - System.out.println("**** " + iae.getMessage() + " ****"); - Summarizer.summarizeDown(aSubEntry, iae.getMessage()); - } - catch (java.lang.RuntimeException e) - { - closeExistingOffice(); - tEnv = getEnv(entry, m_aParams); - tCase = tEnv.getTestCase(); - if (countInterfaceTestRun < 2) - { - finished = false; - } - else - { - Summarizer.summarizeDown(aSubEntry, e.toString() + ".FAILED"); - } + if (countInterfaceTestRun < 2) { + finished = false; + } else { + Summarizer.summarizeDown(aSubEntry, e.toString() + + ".FAILED"); } } - setState(aSubEntry, res); + } + setState(aSubEntry, res); - sumIt.summarizeUp(aSubEntry); + sumIt.summarizeUp(aSubEntry); - LogWriter sumIfc = OutProducerFactory.createOutProducer(m_aParams); - aSubEntry.UserDefinedParams = m_aParams; - sumIfc.initialize(aSubEntry, logging); - sumIfc.summary(aSubEntry); - } + LogWriter sumIfc = OutProducerFactory + .createOutProducer(m_aParams); + aSubEntry.UserDefinedParams = m_aParams; + sumIfc.initialize(aSubEntry, logging); + sumIfc.summary(aSubEntry); + } - try - { - if (!keepdocument) - { - tCase.cleanupTestCase(m_aParams); - } - } - catch (Exception e) - { - System.err.println( "couldn't cleanup:" + e.toString() ); + try { + if (!keepdocument) { + tCase.cleanupTestCase(m_aParams); } - catch (java.lang.NoClassDefFoundError e) - { - System.err.println( "couldn't cleanup:" + e.toString() ); - } - - sumIt.summarizeUp(entry); + } catch (Exception e) { + System.err.println("couldn't cleanup:" + e.toString()); + } catch (java.lang.NoClassDefFoundError e) { + System.err.println("couldn't cleanup:" + e.toString()); + } - LogWriter sumObj = OutProducerFactory.createOutProducer(m_aParams); + sumIt.summarizeUp(entry); - sumObj.initialize(entry, logging); - sumObj.summary(entry); - } + LogWriter sumObj = OutProducerFactory.createOutProducer(m_aParams); - if (entries.length > 0) - { - System.out.println(); + sumObj.initialize(entry, logging); + sumObj.summary(entry); + } - int counter = 0; - System.out.println("Failures that appeared during scenario execution:"); + if (entries.length > 0) { + System.out.println(); - for (int i = 0; i < entries.length; i++) - { - final String sState = entries[i].State; - if (!sState.endsWith("OK")) - { - System.out.println("\t " + entries[i].longName); - counter++; - } - } + int counter = 0; + System.out + .println("Failures that appeared during scenario execution:"); - System.out.println(counter + " of " + entries.length + " tests failed"); - if (counter != 0) { - retValue = false; + for (int i = 0; i < entries.length; i++) { + final String sState = entries[i].State; + if (!sState.endsWith("OK")) { + System.out.println("\t " + entries[i].longName); + counter++; } } - closeExistingOffice(); - return retValue; + System.out.println(counter + " of " + entries.length + + " tests failed"); + if (counter != 0) { + retValue = false; + } } + closeExistingOffice(); + return retValue; + } - private TestEnvironment getTestEnvironment(TestCase tCase, DescEntry entry) - { + private TestEnvironment getTestEnvironment(TestCase tCase, DescEntry entry) { TestEnvironment tEnv = null; - try - { + try { tEnv = tCase.getTestEnvironment(m_aParams); - } - catch (Exception e) - { - System.out.println("Exception while creating " + tCase.getObjectName()); + } catch (Exception e) { + System.out.println("Exception while creating " + + tCase.getObjectName()); System.out.println("Message " + e.getMessage()); e.printStackTrace(); tEnv = null; - } - catch (java.lang.UnsatisfiedLinkError e) - { - System.out.println("Exception while creating " + tCase.getObjectName()); + } catch (java.lang.UnsatisfiedLinkError e) { + System.out.println("Exception while creating " + + tCase.getObjectName()); System.out.println("Message " + e.getMessage()); tEnv = null; - } - catch (java.lang.NoClassDefFoundError e) - { - System.out.println("Exception while creating " + tCase.getObjectName()); + } catch (java.lang.NoClassDefFoundError e) { + System.out.println("Exception while creating " + + tCase.getObjectName()); System.out.println("Message " + e.getMessage()); tEnv = null; } - if (tEnv == null) - { - Summarizer.summarizeDown(entry, "Couldn't create " + tCase.getObjectName()); + if (tEnv == null) { + Summarizer.summarizeDown(entry, + "Couldn't create " + tCase.getObjectName()); LogWriter sumObj = OutProducerFactory.createOutProducer(m_aParams); entry.UserDefinedParams = m_aParams; @@ -327,27 +297,21 @@ public class java_fat implements TestBase return tEnv; } - private TestCase getTestCase(DescEntry _aEntry) - { + private TestCase getTestCase(DescEntry _aEntry) { TestCase tCase = null; - try - { - tCase = (TestCase) m_aDynamicClassLoader.getInstance("mod._" + _aEntry.entryName); - } - catch (java.lang.IllegalArgumentException ie) - { + try { + tCase = (TestCase) m_aDynamicClassLoader.getInstance("mod._" + + _aEntry.entryName); + } catch (java.lang.IllegalArgumentException ie) { _aEntry.ErrorMsg = ie.getMessage(); _aEntry.hasErrorMsg = true; - } - catch (java.lang.NoClassDefFoundError ie) - { + } catch (java.lang.NoClassDefFoundError ie) { _aEntry.ErrorMsg = ie.getMessage(); _aEntry.hasErrorMsg = true; } - if (tCase == null) - { + if (tCase == null) { Summarizer.summarizeDown(_aEntry, _aEntry.ErrorMsg); LogWriter sumObj = OutProducerFactory.createOutProducer(m_aParams); @@ -356,175 +320,144 @@ public class java_fat implements TestBase sumObj.summary(_aEntry); } return tCase; -} + } - private void setState(DescEntry aSubEntry, lib.TestResult res) - { - if (res != null) - { - for (int k = 0; k < aSubEntry.SubEntryCount; k++) - { + private void setState(DescEntry aSubEntry, lib.TestResult res) { + if (res != null) { + for (int k = 0; k < aSubEntry.SubEntryCount; k++) { DescEntry aSubSubEntry = aSubEntry.SubEntries[k]; - if (res.hasMethod( aSubSubEntry.entryName)) - { - aSubSubEntry.State = res.getStatusFor(aSubSubEntry.entryName).toString(); + if (res.hasMethod(aSubSubEntry.entryName)) { + aSubSubEntry.State = res.getStatusFor( + aSubSubEntry.entryName).toString(); } } } } - private TestEnvironment getEnv(DescEntry entry, TestParameters param) - { - TestCase tCase = null; + private TestEnvironment getEnv(DescEntry entry, TestParameters param) throws Exception { + TestCase tCase = null; - try - { - tCase = (TestCase) m_aDynamicClassLoader.getInstance("mod._" + entry.entryName); - } - catch (java.lang.IllegalArgumentException ie) - { - entry.ErrorMsg = ie.getMessage(); - entry.hasErrorMsg = true; - } - catch (java.lang.NoClassDefFoundError ie) - { - entry.ErrorMsg = ie.getMessage(); - entry.hasErrorMsg = true; - } + try { + tCase = (TestCase) m_aDynamicClassLoader.getInstance("mod._" + + entry.entryName); + } catch (java.lang.IllegalArgumentException ie) { + entry.ErrorMsg = ie.getMessage(); + entry.hasErrorMsg = true; + } catch (java.lang.NoClassDefFoundError ie) { + entry.ErrorMsg = ie.getMessage(); + entry.hasErrorMsg = true; + } - System.out.println("Creating: " + entry.entryName); + System.out.println("Creating: " + entry.entryName); - entry.UserDefinedParams = param; + entry.UserDefinedParams = param; - LogWriter log = (LogWriter) m_aDynamicClassLoader.getInstance((String) param.get("LogWriter")); - log.initialize(entry, logging); - tCase.setLogWriter((PrintWriter) log); + LogWriter log = (LogWriter) m_aDynamicClassLoader + .getInstance((String) param.get("LogWriter")); + log.initialize(entry, logging); + tCase.setLogWriter((PrintWriter) log); - try - { - tCase.initializeTestCase(param); - return tCase.getTestEnvironment(param); - } - catch (com.sun.star.lang.DisposedException de) - { - System.out.println("Office disposed"); - closeExistingOffice(); - throw de; - } - catch (lib.StatusException e) - { - System.out.println(e.getMessage()); + try { + tCase.initializeTestCase(param); + return tCase.getTestEnvironment(param); + } catch (com.sun.star.lang.DisposedException de) { + System.out.println("Office disposed"); + closeExistingOffice(); + throw de; + } catch (Exception e) { + System.out.println(e.getMessage()); - closeExistingOffice(); + closeExistingOffice(); - entry.ErrorMsg = e.getMessage(); - entry.hasErrorMsg = true; - throw e; - } + entry.ErrorMsg = e.getMessage(); + entry.hasErrorMsg = true; + throw e; } + } - private void closeExistingOffice() - { - helper.ProcessHandler ph = (helper.ProcessHandler) m_aParams.get("AppProvider"); - - if (ph != null) - { - m_aOffice.closeExistingOffice(m_aParams, true); - util.utils.pause(5000); - } + private void closeExistingOffice() { + helper.ProcessHandler ph = (helper.ProcessHandler) m_aParams + .get("AppProvider"); + if (ph != null) { + m_aOffice.closeExistingOffice(m_aParams, true); + util.utils.pause(5000); } - private ArrayList<String> getExclusionList(String url, boolean debug) - { - ArrayList<String> entryList = new ArrayList<String>(); - String line = "#"; - BufferedReader exclusion = null; + } - try - { - exclusion = new BufferedReader(new FileReader(url)); - } - catch (java.io.FileNotFoundException fnfe) - { - if (debug) - { - System.out.println("Couldn't find file " + url); - } + private ArrayList<String> getExclusionList(String url, boolean debug) { + ArrayList<String> entryList = new ArrayList<String>(); + String line = "#"; + BufferedReader exclusion = null; - return entryList; + try { + exclusion = new BufferedReader(new FileReader(url)); + } catch (java.io.FileNotFoundException fnfe) { + if (debug) { + System.out.println("Couldn't find file " + url); } - try - { - while (line != null) - { - try - { - if (!line.startsWith("#") && (line.length() > 1)) - { - entryList.add(line.trim()); - } + return entryList; + } - line = exclusion.readLine(); + try { + while (line != null) { + try { + if (!line.startsWith("#") && (line.length() > 1)) { + entryList.add(line.trim()); } - catch (java.io.IOException ioe) - { - if (debug) - { - System.out.println("Exception while reading exclusion list"); - } - return entryList; + line = exclusion.readLine(); + } catch (java.io.IOException ioe) { + if (debug) { + System.out + .println("Exception while reading exclusion list"); } + + return entryList; } } - finally - { - try - { - exclusion.close(); - } - catch (java.io.IOException ioe) - { - } + } finally { + try { + exclusion.close(); + } catch (java.io.IOException ioe) { } - - return entryList; } - private TestResult executeInterfaceTest( - DescEntry entry, TestEnvironment tEnv, TestParameters param) - throws IllegalArgumentException, java.lang.NoClassDefFoundError - { - MultiMethodTest ifc = (MultiMethodTest) m_aDynamicClassLoader.getInstance(entry.entryName); - return ifc.run(entry, tEnv, param); - } - - private AppProvider startOffice(lib.TestParameters param) - { + return entryList; + } - if (m_aDynamicClassLoader == null) - { - m_aDynamicClassLoader = new DynamicClassLoader(); - } + private TestResult executeInterfaceTest(DescEntry entry, + TestEnvironment tEnv, TestParameters param) + throws IllegalArgumentException, java.lang.NoClassDefFoundError { + MultiMethodTest ifc = (MultiMethodTest) m_aDynamicClassLoader + .getInstance(entry.entryName); + return ifc.run(entry, tEnv, param); + } - String officeProviderName = (String) param.get("OfficeProvider"); - AppProvider office = (AppProvider) m_aDynamicClassLoader.getInstance(officeProviderName); + private AppProvider startOffice(lib.TestParameters param) { + if (m_aDynamicClassLoader == null) { + m_aDynamicClassLoader = new DynamicClassLoader(); + } - if (office == null) - { - System.out.println("ERROR: Wrong parameter 'OfficeProvider', " + " it cannot be instantiated."); - System.exit(-1); - } + String officeProviderName = (String) param.get("OfficeProvider"); + AppProvider office = (AppProvider) m_aDynamicClassLoader + .getInstance(officeProviderName); - XMultiServiceFactory msf = (XMultiServiceFactory) office.getManager(param); + if (office == null) { + System.out.println("ERROR: Wrong parameter 'OfficeProvider', " + + " it cannot be instantiated."); + System.exit(-1); + } - if (msf != null) - { - param.put("ServiceFactory", msf); - } + XMultiServiceFactory msf = (XMultiServiceFactory) office + .getManager(param); - return office; + if (msf != null) { + param.put("ServiceFactory", msf); } + + return office; + } } diff --git a/qadevOOo/runner/base/java_fat_service.java b/qadevOOo/runner/base/java_fat_service.java index 485eec707edb..5a254af2819d 100644 --- a/qadevOOo/runner/base/java_fat_service.java +++ b/qadevOOo/runner/base/java_fat_service.java @@ -231,7 +231,7 @@ public class java_fat_service implements TestBase { } catch (com.sun.star.lang.DisposedException de) { log.println("Office disposed"); } - } catch (java.lang.IllegalArgumentException ie) { + } catch (java.lang.Exception ie) { entry.ErrorMsg=ie.getMessage(); entry.hasErrorMsg=true; } diff --git a/qadevOOo/runner/lib/MultiMethodTest.java b/qadevOOo/runner/lib/MultiMethodTest.java index ab2dd9630940..96adacd3e0cc 100644 --- a/qadevOOo/runner/lib/MultiMethodTest.java +++ b/qadevOOo/runner/lib/MultiMethodTest.java @@ -243,7 +243,7 @@ public class MultiMethodTest * Is called before calling method tests, but after initialization. * Subclasses may override to perform actions before method tests. */ - protected void before() + protected void before() throws Exception { } diff --git a/qadevOOo/runner/lib/TestCase.java b/qadevOOo/runner/lib/TestCase.java index 3a3d7e9c9467..e68eff62e15e 100644 --- a/qadevOOo/runner/lib/TestCase.java +++ b/qadevOOo/runner/lib/TestCase.java @@ -63,7 +63,7 @@ public abstract class TestCase { * * @param tParam test parameters. */ - public final void initializeTestCase( TestParameters tParam ) { + public final void initializeTestCase( TestParameters tParam ) throws Exception { initialize( tParam, log ); } @@ -77,7 +77,7 @@ public abstract class TestCase { * * @see #initializeTestCase */ - protected void initialize( TestParameters tParam, PrintWriter log ) { + protected void initialize( TestParameters tParam, PrintWriter log ) throws Exception { } diff --git a/qadevOOo/runner/org/openoffice/Runner.java b/qadevOOo/runner/org/openoffice/Runner.java index c7ee6dc3b154..05fdb6b2c2e4 100644 --- a/qadevOOo/runner/org/openoffice/Runner.java +++ b/qadevOOo/runner/org/openoffice/Runner.java @@ -136,7 +136,7 @@ public class Runner } } - public static boolean run(String... args) + public static boolean run(String... args) throws Exception { System.out.println("OOoRunner Main() version from 20101118 (yyyymmdd)"); @@ -189,7 +189,7 @@ public class Runner return worked; } - public static void main(String[] args) + public static void main(String[] args) throws Exception { System.exit(run(args) ? 0 : -1); } diff --git a/qadevOOo/runner/org/openoffice/RunnerService.java b/qadevOOo/runner/org/openoffice/RunnerService.java index 9240f6e1320d..f61638c4702f 100644 --- a/qadevOOo/runner/org/openoffice/RunnerService.java +++ b/qadevOOo/runner/org/openoffice/RunnerService.java @@ -94,9 +94,13 @@ public class RunnerService implements XJob, XServiceInfo, TestBase toExecute = (TestBase)dcl.getInstance("base.java_fat_service"); - boolean worked = toExecute.executeTest(param); - if (!worked) - log.println("Test did not execute correctly."); + try { + boolean worked = toExecute.executeTest(param); + if (!worked) + log.println("Test did not execute correctly."); + } catch (Exception ex) { + throw new RuntimeException(ex); + } String returnString = ""; if (log instanceof InternalLogWriter) |