diff options
69 files changed, 237 insertions, 387 deletions
diff --git a/qadevOOo/runner/complexlib/Assurance.java b/qadevOOo/runner/complexlib/Assurance.java index 3b4d03a64602..53d287e9dc48 100644 --- a/qadevOOo/runner/complexlib/Assurance.java +++ b/qadevOOo/runner/complexlib/Assurance.java @@ -173,5 +173,8 @@ public class Assurance public AssureException(String msg) { super(msg); } + public AssureException(Throwable cause) { + super(cause); + } } } diff --git a/qadevOOo/runner/convwatch/ConvWatchCancelException.java b/qadevOOo/runner/convwatch/ConvWatchCancelException.java index ad37c2da2a8b..f360293e18f3 100644 --- a/qadevOOo/runner/convwatch/ConvWatchCancelException.java +++ b/qadevOOo/runner/convwatch/ConvWatchCancelException.java @@ -24,4 +24,9 @@ public class ConvWatchCancelException extends ConvWatchException { super(_aMessage); } + + public ConvWatchCancelException(String _aMessage, Throwable cause) + { + super(_aMessage, cause); + } } diff --git a/qadevOOo/runner/convwatch/ConvWatchException.java b/qadevOOo/runner/convwatch/ConvWatchException.java index 28b15121131a..efd1e67e3dc9 100644 --- a/qadevOOo/runner/convwatch/ConvWatchException.java +++ b/qadevOOo/runner/convwatch/ConvWatchException.java @@ -24,5 +24,10 @@ public class ConvWatchException extends Exception { super(_aMessage); } + + public ConvWatchException(String _aMessage, Throwable cause) + { + super(_aMessage, cause); + } } diff --git a/qadevOOo/runner/convwatch/GraphicalDifferenceCheck.java b/qadevOOo/runner/convwatch/GraphicalDifferenceCheck.java index 2d59022c527d..f9d1e29edbc4 100644 --- a/qadevOOo/runner/convwatch/GraphicalDifferenceCheck.java +++ b/qadevOOo/runner/convwatch/GraphicalDifferenceCheck.java @@ -279,7 +279,7 @@ public class GraphicalDifferenceCheck catch (com.sun.star.io.IOException e) { // wrap IOException - throw new ConvWatchCancelException("Wrap IOException caught, " + e.getMessage()); + throw new ConvWatchCancelException("Wrap IOException caught", e); } GlobalLogWriter.get().println("Saving XComponent as " + resultURL); diff --git a/qadevOOo/runner/convwatch/MSOfficePrint.java b/qadevOOo/runner/convwatch/MSOfficePrint.java index ba65b5bcf80e..9ed3b4b60727 100644 --- a/qadevOOo/runner/convwatch/MSOfficePrint.java +++ b/qadevOOo/runner/convwatch/MSOfficePrint.java @@ -251,7 +251,7 @@ public class MSOfficePrint } catch (IndexOutOfBoundsException e) { - throw new ConvWatchCancelException/*WrongEnvironmentException*/("Given list is too short."); + throw new ConvWatchCancelException/*WrongEnvironmentException*/("Given list is too short.", e); } // return aHandler.getExitCode(); diff --git a/qadevOOo/runner/convwatch/OfficePrint.java b/qadevOOo/runner/convwatch/OfficePrint.java index cc7867db015e..432620005573 100644 --- a/qadevOOo/runner/convwatch/OfficePrint.java +++ b/qadevOOo/runner/convwatch/OfficePrint.java @@ -767,14 +767,13 @@ public class OfficePrint { } catch(ConvWatchCancelException e) { - e.printStackTrace(); GlobalLogWriter.get().println(e.getMessage()); - throw new ConvWatchCancelException("Exception caught. Problem with MSOffice printer methods."); + throw new ConvWatchCancelException("Exception caught. Problem with MSOffice printer methods.", e); } catch(java.io.IOException e) { GlobalLogWriter.get().println(e.getMessage()); - throw new ConvWatchCancelException("IOException caught. Problem with MSOffice printer methods."); + throw new ConvWatchCancelException("IOException caught. Problem with MSOffice printer methods.", e); } bBack = true; } diff --git a/qadevOOo/runner/convwatch/ReportDesignerTest.java b/qadevOOo/runner/convwatch/ReportDesignerTest.java index 6dd5001c3441..204f8d9c70f3 100644 --- a/qadevOOo/runner/convwatch/ReportDesignerTest.java +++ b/qadevOOo/runner/convwatch/ReportDesignerTest.java @@ -285,7 +285,7 @@ public class ReportDesignerTest extends ComplexTestCase { catch (AssureException e) { stopOffice(); - throw new AssureException(e.getMessage()); + throw new AssureException(e); } // ------------------------------ Office shutdown ------------------------------ diff --git a/qadevOOo/runner/graphical/MSOfficePostscriptCreator.java b/qadevOOo/runner/graphical/MSOfficePostscriptCreator.java index 6133094ece6d..a5c1667e7eb1 100644 --- a/qadevOOo/runner/graphical/MSOfficePostscriptCreator.java +++ b/qadevOOo/runner/graphical/MSOfficePostscriptCreator.java @@ -89,14 +89,13 @@ public class MSOfficePostscriptCreator implements IOffice } catch(OfficeException e) { - e.printStackTrace(); GlobalLogWriter.println(e.getMessage()); - throw new OfficeException("Exception caught. Problem with MSOffice printer methods."); + throw new OfficeException("Exception caught. Problem with MSOffice printer methods.", e); } catch(java.io.IOException e) { GlobalLogWriter.println(e.getMessage()); - throw new OfficeException("IOException caught. Problem with MSOffice printer methods."); + throw new OfficeException("IOException caught. Problem with MSOffice printer methods.", e); } } @@ -258,7 +257,7 @@ public class MSOfficePostscriptCreator implements IOffice } catch (IndexOutOfBoundsException e) { - throw new WrongEnvironmentException("Given list is too short."); + throw new WrongEnvironmentException("Given list is too short.", e); } } diff --git a/qadevOOo/runner/graphical/OfficeException.java b/qadevOOo/runner/graphical/OfficeException.java index 1241c1b2db0d..94c0d3ae942c 100644 --- a/qadevOOo/runner/graphical/OfficeException.java +++ b/qadevOOo/runner/graphical/OfficeException.java @@ -28,4 +28,9 @@ public class OfficeException extends Exception { super(_aMessage); } + + public OfficeException(String _aMessage, Throwable cause) + { + super(_aMessage, cause); + } } diff --git a/qadevOOo/runner/graphical/WrongEnvironmentException.java b/qadevOOo/runner/graphical/WrongEnvironmentException.java index 922ee8c6e8e3..fe60de560f27 100644 --- a/qadevOOo/runner/graphical/WrongEnvironmentException.java +++ b/qadevOOo/runner/graphical/WrongEnvironmentException.java @@ -24,4 +24,8 @@ public class WrongEnvironmentException extends OfficeException { super(_aMessage); } + public WrongEnvironmentException(String _aMessage, Throwable cause) + { + super(_aMessage, cause); + } } diff --git a/qadevOOo/runner/helper/ConfigHelper.java b/qadevOOo/runner/helper/ConfigHelper.java index da873a59b97c..cfa61a3bf15a 100644 --- a/qadevOOo/runner/helper/ConfigHelper.java +++ b/qadevOOo/runner/helper/ConfigHelper.java @@ -212,18 +212,18 @@ public class ConfigHelper xProp = UnoRuntime.queryInterface( XPropertySet.class, xSetCont.getByName(groupName)); - } catch (com.sun.star.container.NoSuchElementException e){ - throw new com.sun.star.uno.Exception( + } catch (com.sun.star.container.NoSuchElementException ex){ + throw new com.sun.star.uno.Exception(ex, "could not get group '" + groupName + - "' from set '"+ setName +"':\n" + e.toString()); + "' from set '"+ setName +"'"); } try{ xProp.setPropertyValue(propName, propValue); - } catch (com.sun.star.uno.Exception e) { - throw new com.sun.star.uno.Exception( + } catch (com.sun.star.uno.Exception ex) { + throw new com.sun.star.uno.Exception(ex, "could not set property '" + propName + "' from group '"+ groupName + - "' from set '"+ setName +"':\n" + e.toString()); + "' from set '"+ setName +"'"); } } @@ -255,28 +255,28 @@ public class ConfigHelper Object xGroup=xSetCont.getByName(group); xGroupAccess = UnoRuntime.queryInterface( XNameReplace.class,xGroup); - } catch(com.sun.star.container.NoSuchElementException e) { - throw new com.sun.star.uno.Exception( + } catch(com.sun.star.container.NoSuchElementException ex) { + throw new com.sun.star.uno.Exception(ex, "could not get group '" + group + - "' from set '"+ setName +"':\n" + e.toString()); + "' from set '"+ setName +"'"); } try { Object xGroup=xGroupAccess.getByName(extGroup); xExtGroupCont = UnoRuntime.queryInterface( XNameContainer.class,xGroup); - } catch(com.sun.star.container.NoSuchElementException e) { - throw new com.sun.star.uno.Exception( + } catch(com.sun.star.container.NoSuchElementException ex) { + throw new com.sun.star.uno.Exception(ex, "could not get extensilbe group '"+extGroup+ "' from group '"+ group + - "' from set '"+ setName +"':\n" + e.toString()); + "' from set '"+ setName +"'"); } try { xExtGroupCont.insertByName(propName, propValue); } catch(com.sun.star.container.ElementExistException e) { - xExtGroupCont .replaceByName(propName, propValue); + xExtGroupCont.replaceByName(propName, propValue); } } diff --git a/qadevOOo/runner/helper/StreamSimulator.java b/qadevOOo/runner/helper/StreamSimulator.java index 1b53d4a9a492..7571ce6864cf 100644 --- a/qadevOOo/runner/helper/StreamSimulator.java +++ b/qadevOOo/runner/helper/StreamSimulator.java @@ -106,7 +106,7 @@ public class StreamSimulator implements com.sun.star.io.XInputStream , } catch(com.sun.star.uno.Exception exUno) { - throw new com.sun.star.io.NotConnectedException("Could not open the file."); + throw new com.sun.star.io.NotConnectedException(exUno); } } diff --git a/qadevOOo/runner/util/BasicMacroTools.java b/qadevOOo/runner/util/BasicMacroTools.java index 34407cac336d..0a2a856f774f 100644 --- a/qadevOOo/runner/util/BasicMacroTools.java +++ b/qadevOOo/runner/util/BasicMacroTools.java @@ -47,32 +47,26 @@ public class BasicMacroTools { */ public BasicMacroTools(XMultiServiceFactory msf, XModel xModel, XComponent xDoc) throws java.lang.Exception { - try { - mMSF = msf; - mDispProv = makeDispatchProvider(xModel); - mParser = makeParser(mMSF); + mMSF = msf; + mDispProv = makeDispatchProvider(xModel); + mParser = makeParser(mMSF); - Object DocLibCont = null; + Object DocLibCont = null; - try { - XPropertySet xDocProps = UnoRuntime.queryInterface( - XPropertySet.class, xDoc); - DocLibCont = xDocProps.getPropertyValue("BasicLibraries"); - } catch (com.sun.star.uno.Exception e) { - throw new Exception( - "Couldn't get BasicLibraries-Container from document: " + e.toString()); - } - - mLCxNA = UnoRuntime.queryInterface(XNameAccess.class, - DocLibCont); + try { + XPropertySet xDocProps = UnoRuntime.queryInterface( + XPropertySet.class, xDoc); + DocLibCont = xDocProps.getPropertyValue("BasicLibraries"); + } catch (com.sun.star.uno.Exception e) { + throw new Exception( + "Couldn't get BasicLibraries-Container from document", e); + } - mLCxLC = UnoRuntime.queryInterface( - XLibraryContainer.class, DocLibCont); + mLCxNA = UnoRuntime.queryInterface(XNameAccess.class, + DocLibCont); - } catch (Exception e) { - throw new Exception("could not initialize BasicMacros " + - e.toString()); - } + mLCxLC = UnoRuntime.queryInterface( + XLibraryContainer.class, DocLibCont); } /* @@ -80,31 +74,24 @@ public class BasicMacroTools { */ public BasicMacroTools(XMultiServiceFactory msf, XModel xModel) throws java.lang.Exception { - try { - mMSF = msf; - mDispProv = makeDispatchProvider(xModel); - mParser = makeParser(mMSF); + mMSF = msf; + mDispProv = makeDispatchProvider(xModel); + mParser = makeParser(mMSF); - Object ASLC = null; + Object ASLC = null; - try { - ASLC = mMSF.createInstance( - "com.sun.star.script.ApplicationScriptLibraryContainer"); - } catch (com.sun.star.uno.Exception e) { - throw new Exception( - "Couldn't create ApplicationScriptLibraryContainer" + e.toString()); - } - - mLCxNA = UnoRuntime.queryInterface(XNameAccess.class, - ASLC); + try { + ASLC = mMSF.createInstance( + "com.sun.star.script.ApplicationScriptLibraryContainer"); + } catch (com.sun.star.uno.Exception e) { + throw new Exception("Couldn't create ApplicationScriptLibraryContainer", e); + } - mLCxLC = UnoRuntime.queryInterface( - XLibraryContainer.class, ASLC); + mLCxNA = UnoRuntime.queryInterface(XNameAccess.class, + ASLC); - } catch (Exception e) { - throw new Exception("could not initialize BasicMacros " + - e.toString()); - } + mLCxLC = UnoRuntime.queryInterface( + XLibraryContainer.class, ASLC); } private static XDispatchProvider makeDispatchProvider(XModel aModel) @@ -137,21 +124,15 @@ public class BasicMacroTools { try { appendLibrary(LibraryName, LibraryURL); } catch (java.lang.Exception e) { - e.printStackTrace(); - throw new Exception("ERROR: Could not append Library " + - LibraryName + e.toString()); + throw new Exception("Could not append Library " + LibraryName, e); } try { mLCxLC.loadLibrary(LibraryName); } catch (com.sun.star.container.NoSuchElementException e) { - e.printStackTrace(); - throw new Exception("ERROR: Could not load Library " + - LibraryName + e.toString()); + throw new Exception("Could not load Library " + LibraryName, e); } catch (com.sun.star.lang.WrappedTargetException e) { - e.printStackTrace(); - throw new Exception("ERROR: Could not load Library " + - LibraryName + e.toString()); + throw new Exception("Could not load Library " + LibraryName, e); } } @@ -165,13 +146,9 @@ public class BasicMacroTools { try { mLCxLC.createLibraryLink(LibraryName, LibraryURL, false); } catch (com.sun.star.container.ElementExistException e) { - e.printStackTrace(); - throw new Exception("ERROR: Library " + LibraryName + - "already exist." + e.toString()); + throw new Exception("Library " + LibraryName + "already exists.", e); } catch (com.sun.star.lang.IllegalArgumentException e) { - e.printStackTrace(); - throw new Exception("Could not link Basic library:" + - LibraryName + e.toString()); + throw new Exception("Could not link Basic library " + LibraryName, e); } } @@ -180,13 +157,9 @@ public class BasicMacroTools { try { mLCxLC.removeLibrary(LibraryName); } catch (com.sun.star.container.NoSuchElementException e) { - e.printStackTrace(); - throw new Exception("Could not remove Basic library:" + - LibraryName + ": Library does not exist" + e.toString()); + throw new Exception("Could not remove Basic library " + LibraryName + ", Library does not exist", e); } catch (com.sun.star.lang.WrappedTargetException e) { - e.printStackTrace(); - throw new Exception("Could not remove Basic library:" + - LibraryName + e.toString()); + throw new Exception("Could not remove Basic library " + LibraryName, e); } } } diff --git a/qadevOOo/runner/util/CalcTools.java b/qadevOOo/runner/util/CalcTools.java index dd6defab8050..73f11ba81cf0 100644 --- a/qadevOOo/runner/util/CalcTools.java +++ b/qadevOOo/runner/util/CalcTools.java @@ -34,7 +34,7 @@ import com.sun.star.uno.Type; import com.sun.star.uno.UnoRuntime; /** - * This class contains some useful mathods to handle Calc documents + * This class contains some useful methods to handle Calc documents * and its sheets. */ public class CalcTools { @@ -42,7 +42,7 @@ public class CalcTools { /** * fills a range of a calc sheet with computed data of type * <CODE>Double</CODE>. - * @param xSheetDoc the Clac documents which should be filled + * @param xSheetDoc the Calc documents which should be filled * @param sheetNumber the number of the sheet of <CODE>xSheetDoc</CODE> * @param startCellX the cell number of the X start point (row) of the range to fill * @param startCellY the cell number of the Y start point (column) of the range to fill @@ -53,15 +53,9 @@ public class CalcTools { public static void fillCalcSheetWithContent(XComponent xSheetDoc, int sheetNumber, int startCellX, int startCellY, int rangeLengthX, int rangeLengthY) throws java.lang.Exception { - try{ - XSpreadsheet xSheet = getSpreadSheetFromSheetDoc(xSheetDoc, sheetNumber); - - fillCalcSheetWithContent(xSheet, startCellX, startCellY, rangeLengthX, rangeLengthY); + XSpreadsheet xSheet = getSpreadSheetFromSheetDoc(xSheetDoc, sheetNumber); - } catch (Exception e){ - throw new Exception( - "Couldn't fill CalcSheet with content: " + e.toString()); - } + fillCalcSheetWithContent(xSheet, startCellX, startCellY, rangeLengthX, rangeLengthY); } /** @@ -77,31 +71,24 @@ public class CalcTools { public static void fillCalcSheetWithContent(XSpreadsheet xSheet, int startCellX, int startCellY, int rangeLengthX, int rangeLengthY) throws java.lang.Exception { - - try{ - // create a range with content - Object[][] newData = new Object[rangeLengthY][rangeLengthX]; - for (int i=0; i<rangeLengthY; i++) { - for (int j=0; j<rangeLengthX; j++) { - newData[i][j] = new Double(10*i +j); - } - } - XCellRange xRange = null; - try { - xRange = xSheet.getCellRangeByPosition(startCellX, startCellY, - startCellX+rangeLengthX-1, startCellY+rangeLengthY-1); - } catch ( IndexOutOfBoundsException e){ - throw new Exception( - "Couldn't get CellRange from sheett: " + e.toString()); + // create a range with content + Object[][] newData = new Object[rangeLengthY][rangeLengthX]; + for (int i=0; i<rangeLengthY; i++) { + for (int j=0; j<rangeLengthX; j++) { + newData[i][j] = new Double(10*i +j); } + } + XCellRange xRange = null; + try { + xRange = xSheet.getCellRangeByPosition(startCellX, startCellY, + startCellX+rangeLengthX-1, startCellY+rangeLengthY-1); + } catch ( IndexOutOfBoundsException ex){ + throw new Exception(ex, "Couldn't get CellRange from sheet"); + } - XCellRangeData xRangeData = UnoRuntime.queryInterface(XCellRangeData.class, xRange); + XCellRangeData xRangeData = UnoRuntime.queryInterface(XCellRangeData.class, xRange); - xRangeData.setDataArray(newData); - } catch (Exception e){ - throw new Exception( - "Couldn't fill CalcSheet with content: " + e.toString()); - } + xRangeData.setDataArray(newData); } /** @@ -125,24 +112,16 @@ public class CalcTools { XIndexAccess xSheetsIndexArray = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); - try{ - xSheet = (XSpreadsheet) AnyConverter.toObject( - new Type(XSpreadsheet.class),xSheetsIndexArray.getByIndex(sheetNumber)); + xSheet = (XSpreadsheet) AnyConverter.toObject( + new Type(XSpreadsheet.class),xSheetsIndexArray.getByIndex(sheetNumber)); - } catch (IllegalArgumentException e){ - throw new Exception( - "Couldn't get sheet '" +sheetNumber + "' : " + e.toString()); - } catch (IndexOutOfBoundsException e){ - throw new Exception( - "Couldn't get sheet '" +sheetNumber + "' : " + e.toString()); - } catch (WrappedTargetException e){ - throw new Exception( - "Couldn't get sheet '" +sheetNumber + "' : " + e.toString()); - } - } catch (Exception e){ - throw new Exception( - "Couldn't get sheet '" +sheetNumber + "' : " + e.toString()); + } catch (IllegalArgumentException ex){ + throw new Exception(ex, "Couldn't get sheet '" +sheetNumber + "'"); + } catch (IndexOutOfBoundsException ex){ + throw new Exception(ex, "Couldn't get sheet '" +sheetNumber + "'"); + } catch (WrappedTargetException ex) { + throw new Exception(ex, "Couldn't get sheet '" +sheetNumber + "'"); } - return xSheet; + return xSheet; } } diff --git a/qadevOOo/runner/util/DesktopTools.java b/qadevOOo/runner/util/DesktopTools.java index 646ffcbdce5d..e0cc25f6e746 100644 --- a/qadevOOo/runner/util/DesktopTools.java +++ b/qadevOOo/runner/util/DesktopTools.java @@ -83,7 +83,7 @@ public class DesktopTools } catch (com.sun.star.uno.Exception e) { - throw new IllegalArgumentException("Desktop Service not available"); + throw new IllegalArgumentException("Desktop Service not available", e); } return oInterface; @@ -230,7 +230,7 @@ public class DesktopTools } catch (com.sun.star.uno.Exception e) { - throw new IllegalArgumentException("Document could not be opened"); + throw new IllegalArgumentException("Document could not be opened", e); } return oDoc; @@ -258,7 +258,7 @@ public class DesktopTools } catch (com.sun.star.uno.Exception e) { - throw new IllegalArgumentException("Document could not be loaded"); + throw new IllegalArgumentException("Document could not be loaded", e); } bringWindowToFront(oDoc); diff --git a/qadevOOo/runner/util/DrawTools.java b/qadevOOo/runner/util/DrawTools.java index 5a37f4d1c7d7..a8f416312de3 100644 --- a/qadevOOo/runner/util/DrawTools.java +++ b/qadevOOo/runner/util/DrawTools.java @@ -65,7 +65,7 @@ public class DrawTools { oDPn = oDPS.getDrawPages(); } catch ( Exception e ) { - throw new IllegalArgumentException( "Couldn't get drawpages" ); + throw new IllegalArgumentException( "Couldn't get drawpages", e ); } return oDPn; } // finish getDrawPages @@ -84,7 +84,7 @@ public class DrawTools { oDP = (XDrawPage) AnyConverter.toObject( new Type(XDrawPage.class),getDrawPages( aDoc ).getByIndex( nr )); } catch ( Exception e ) { - throw new IllegalArgumentException( "Couldn't get drawpage" ); + throw new IllegalArgumentException( "Couldn't get drawpage", e ); } return oDP; } diff --git a/qadevOOo/runner/util/FormTools.java b/qadevOOo/runner/util/FormTools.java index bebd3c3ddd2a..c89e41b925dc 100644 --- a/qadevOOo/runner/util/FormTools.java +++ b/qadevOOo/runner/util/FormTools.java @@ -199,7 +199,7 @@ public class FormTools { XForm oForm = UnoRuntime.queryInterface(XForm.class, oControl); Forms.insertByName(aName,oForm); } catch ( Exception e ) { - throw new IllegalArgumentException( "Couldn't insert Form" ); + throw new IllegalArgumentException( "Couldn't insert Form", e ); } } diff --git a/qadevOOo/runner/util/SOfficeFactory.java b/qadevOOo/runner/util/SOfficeFactory.java index f672733a4e97..c45fbd6131e0 100644 --- a/qadevOOo/runner/util/SOfficeFactory.java +++ b/qadevOOo/runner/util/SOfficeFactory.java @@ -50,8 +50,7 @@ public class SOfficeFactory { try { oInterface = xMSF.createInstance("com.sun.star.frame.Desktop"); } catch (com.sun.star.uno.Exception e) { - throw new IllegalArgumentException( - "Desktop Service not available"); + throw new IllegalArgumentException("Desktop Service not available", e); } // query the desktop interface and then it's componentloader diff --git a/qadevOOo/runner/util/UITools.java b/qadevOOo/runner/util/UITools.java index dfff8356910e..f3aea0610dbe 100644 --- a/qadevOOo/runner/util/UITools.java +++ b/qadevOOo/runner/util/UITools.java @@ -143,7 +143,7 @@ public class UITools { oAction.doAccessibleAction(0); } catch (com.sun.star.lang.IndexOutOfBoundsException e) { throw new Exception("Could not do accessible action with '" + - buttonName + "'" + e.toString()); + buttonName + "'", e); } } @@ -193,13 +193,13 @@ public class UITools { } catch (com.sun.star.lang.IndexOutOfBoundsException e) { throw new Exception("Could not get child form list of '" - + ListBoxName + "' : " + e.toString()); + + ListBoxName + "'", e); } } } catch (Exception e) { throw new Exception("Could not get list of items from '" - + ListBoxName + "' : " + e.toString()); + + ListBoxName + "'", e); } String[]ret = new String[Items.size()]; return Items.toArray(ret); @@ -227,7 +227,7 @@ public class UITools { } catch (Exception e) { throw new Exception("Could not set value to CheckBox '" - + CheckBoxName + "' : " + e.toString()); + + CheckBoxName + "'", e); } } diff --git a/qadevOOo/runner/util/WriterTools.java b/qadevOOo/runner/util/WriterTools.java index e7189ebaa5e5..4681a9963235 100644 --- a/qadevOOo/runner/util/WriterTools.java +++ b/qadevOOo/runner/util/WriterTools.java @@ -70,7 +70,7 @@ public class WriterTools { XDrawPageSupplier.class, aDoc); oDP = oDPS.getDrawPage(); } catch (Exception e) { - throw new IllegalArgumentException("Couldn't get drawpage"); + throw new IllegalArgumentException("Couldn't get drawpage", e); } return oDP; diff --git a/qadevOOo/runner/util/compare/GraphicalComparator.java b/qadevOOo/runner/util/compare/GraphicalComparator.java index af0492ddc280..82495a8a9a7d 100644 --- a/qadevOOo/runner/util/compare/GraphicalComparator.java +++ b/qadevOOo/runner/util/compare/GraphicalComparator.java @@ -150,7 +150,9 @@ class GraphicalComparator implements DocComparator catch (ConvWatchException e) { // wrap it to IOException - throw new java.io.IOException(e.getMessage()); + java.io.IOException ex2 = new java.io.IOException(e.getMessage()); + ex2.initCause(e); + throw ex2; } } @@ -181,7 +183,9 @@ class GraphicalComparator implements DocComparator System.err.println(" Outputpath: '" + m_aArguments.getOutputPath() + "'"); System.err.println("Referencepath: '" + m_aArguments.getReferencePath() + "'"); } - throw new java.io.IOException(e.getMessage()); + java.io.IOException ex2 = new java.io.IOException(e.getMessage()); + ex2.initCause(e); + throw ex2; } } @@ -223,7 +227,9 @@ class GraphicalComparator implements DocComparator catch(ConvWatchException e) { // wrap it to IOException - throw new java.io.IOException(e.getMessage()); + java.io.IOException ex2 = new java.io.IOException(e.getMessage()); + ex2.initCause(e); + throw ex2; } } diff --git a/qadevOOo/testdocs/backend/org/openoffice/JavaSystemBackend.java b/qadevOOo/testdocs/backend/org/openoffice/JavaSystemBackend.java index 2a633c08e403..91aa80848c6b 100644 --- a/qadevOOo/testdocs/backend/org/openoffice/JavaSystemBackend.java +++ b/qadevOOo/testdocs/backend/org/openoffice/JavaSystemBackend.java @@ -218,7 +218,7 @@ public class JavaSystemBackend implements XSingleLayerStratum, XTypeProvider, msf.createInstance( "com.sun.star.comp.configuration.backend.LayerDescriber")); } catch (com.sun.star.uno.Exception e) { - throw new com.sun.star.lang.NullPointerException( + throw new com.sun.star.lang.NullPointerException(e, "exception while creating LayerDesccriber"); } diff --git a/qadevOOo/tests/java/ifc/beans/_XMultiPropertyStates.java b/qadevOOo/tests/java/ifc/beans/_XMultiPropertyStates.java index 81836c2c9b26..600be127c70a 100644 --- a/qadevOOo/tests/java/ifc/beans/_XMultiPropertyStates.java +++ b/qadevOOo/tests/java/ifc/beans/_XMultiPropertyStates.java @@ -133,9 +133,7 @@ public class _XMultiPropertyStates extends MultiMethodTest { prop = xPropSetInfo.getPropertyByName(names[i]); } catch(com.sun.star.beans.UnknownPropertyException e) { - log.println("couldn't get property info: " + e.toString()); - throw new StatusException(Status.failed - ("couldn't get property info")); + throw new StatusException(e, Status.failed("couldn't get property info")); } if ( (prop.Attributes & PropertyAttribute.MAYBEDEFAULT) != 0){ log.println("Property " + names[i] + diff --git a/qadevOOo/tests/java/ifc/beans/_XPropertyWithState.java b/qadevOOo/tests/java/ifc/beans/_XPropertyWithState.java index f7cf1114fdf9..6bc506ea2b8d 100644 --- a/qadevOOo/tests/java/ifc/beans/_XPropertyWithState.java +++ b/qadevOOo/tests/java/ifc/beans/_XPropertyWithState.java @@ -93,8 +93,7 @@ public class _XPropertyWithState extends MultiMethodTest { oObj.setToDefaultAsProperty(); } catch (com.sun.star.lang.WrappedTargetException e){ - e.printStackTrace(log); - throw new StatusException(Status.failed("'com.sun.star.lang.WrappedTargetException' was thrown")); + throw new StatusException(e, Status.failed("'com.sun.star.lang.WrappedTargetException' was thrown")); } tRes.tested("setToDefaultAsProperty()", true); diff --git a/qadevOOo/tests/java/ifc/document/_Settings.java b/qadevOOo/tests/java/ifc/document/_Settings.java index 01e7be08f35e..a0b0f87b6b8c 100644 --- a/qadevOOo/tests/java/ifc/document/_Settings.java +++ b/qadevOOo/tests/java/ifc/document/_Settings.java @@ -46,9 +46,9 @@ public class _Settings extends MultiPropertyTest { testProperty("PrinterIndependentLayout", oldVal, newVal); } catch (com.sun.star.beans.UnknownPropertyException e) { - throw new StatusException(Status.failed("the property 'PrinterIndependentLayout' is unknown.")); + throw new StatusException(e, Status.failed("the property 'PrinterIndependentLayout' is unknown.")); } catch (com.sun.star.lang.WrappedTargetException e) { - throw new StatusException(Status.failed("the property 'PrinterIndependentLayout' could not be tested.")); + throw new StatusException(e, Status.failed("the property 'PrinterIndependentLayout' could not be tested.")); } } diff --git a/qadevOOo/tests/java/ifc/io/_XActiveDataControl.java b/qadevOOo/tests/java/ifc/io/_XActiveDataControl.java index 33a2bd09b78e..32ce987f6f5d 100644 --- a/qadevOOo/tests/java/ifc/io/_XActiveDataControl.java +++ b/qadevOOo/tests/java/ifc/io/_XActiveDataControl.java @@ -138,8 +138,7 @@ public class _XActiveDataControl extends MultiMethodTest { try { Thread.sleep(200); } catch (InterruptedException e) { - e.printStackTrace(log) ; - throw new StatusException(Status.failed(e.getMessage())); + throw new StatusException(e, Status.failed(e.getMessage())); } } @@ -177,8 +176,7 @@ public class _XActiveDataControl extends MultiMethodTest { try { Thread.sleep(200); } catch (InterruptedException e) { - e.printStackTrace(log) ; - throw new StatusException(Status.failed(e.getMessage())); + throw new StatusException(e, Status.failed(e.getMessage())); } // check that no removed listener's method was called @@ -203,8 +201,7 @@ public class _XActiveDataControl extends MultiMethodTest { try { Thread.sleep(200); } catch (InterruptedException e) { - e.printStackTrace(log) ; - throw new StatusException(Status.failed(e.getMessage())); + throw new StatusException(e, Status.failed(e.getMessage())); } // check, if any error occurred diff --git a/qadevOOo/tests/java/ifc/sheet/_XFormulaQuery.java b/qadevOOo/tests/java/ifc/sheet/_XFormulaQuery.java index 7a41fc0603c0..b4958937ee2f 100644 --- a/qadevOOo/tests/java/ifc/sheet/_XFormulaQuery.java +++ b/qadevOOo/tests/java/ifc/sheet/_XFormulaQuery.java @@ -63,8 +63,7 @@ public class _XFormulaQuery extends MultiMethodTest { try { mxCell = oSheet.getCellByPosition(15, 15); } catch (com.sun.star.lang.IndexOutOfBoundsException e) { - throw new StatusException( - Status.failed("Couldn't get initial cell")); + throw new StatusException(e, Status.failed("Couldn't get initial cell")); } } diff --git a/qadevOOo/tests/java/ifc/sheet/_XSheetAuditing.java b/qadevOOo/tests/java/ifc/sheet/_XSheetAuditing.java index ea2eec6a845e..e17e82599950 100644 --- a/qadevOOo/tests/java/ifc/sheet/_XSheetAuditing.java +++ b/qadevOOo/tests/java/ifc/sheet/_XSheetAuditing.java @@ -80,7 +80,7 @@ public class _XSheetAuditing extends MultiMethodTest { xPrecedentAddress = xSheet.getCellByPosition(precedentAddress.Column, precedentAddress.Row); } catch(com.sun.star.lang.IndexOutOfBoundsException e) { - throw new StatusException(Status.failed("Invalid cell addresses in object relations.")); + throw new StatusException(e, Status.failed("Invalid cell addresses in object relations.")); } } diff --git a/qadevOOo/tests/java/mod/_adabas/ODriver.java b/qadevOOo/tests/java/mod/_adabas/ODriver.java index d97206a53a1e..c1af17d5ad80 100644 --- a/qadevOOo/tests/java/mod/_adabas/ODriver.java +++ b/qadevOOo/tests/java/mod/_adabas/ODriver.java @@ -67,8 +67,7 @@ public class ODriver extends TestCase { oObj = (XInterface)Param.getMSF(). createInstance("com.sun.star.comp.sdbcx.adabas.ODriver"); } catch (com.sun.star.uno.Exception e) { - e.printStackTrace(log); - throw new StatusException(Status.failed("Couldn't create object")); + throw new StatusException(e, Status.failed("Couldn't create object")); } log.println("creating a new environment for object"); diff --git a/qadevOOo/tests/java/mod/_ado/ODriver.java b/qadevOOo/tests/java/mod/_ado/ODriver.java index 83c9a87b579a..db4b9b466de6 100644 --- a/qadevOOo/tests/java/mod/_ado/ODriver.java +++ b/qadevOOo/tests/java/mod/_ado/ODriver.java @@ -66,8 +66,7 @@ public class ODriver extends TestCase { oObj = (XInterface)Param.getMSF(). createInstance("com.sun.star.comp.sdbc.ado.ODriver"); } catch (com.sun.star.uno.Exception e) { - e.printStackTrace(log); - throw new StatusException(Status.failed("Couldn't create object")); + throw new StatusException(e, Status.failed("Couldn't create object")); } log.println("creating a new environment for object"); diff --git a/qadevOOo/tests/java/mod/_dbaccess/ConnectionLineAccessibility.java b/qadevOOo/tests/java/mod/_dbaccess/ConnectionLineAccessibility.java index 6988bc70e9e7..1b81aa16ebf5 100644 --- a/qadevOOo/tests/java/mod/_dbaccess/ConnectionLineAccessibility.java +++ b/qadevOOo/tests/java/mod/_dbaccess/ConnectionLineAccessibility.java @@ -115,8 +115,7 @@ public class ConnectionLineAccessibility extends TestCase } catch (com.sun.star.uno.Exception e) { - e.printStackTrace(log); - throw new StatusException(Status.failed("Couldn't create instance")); + throw new StatusException(e, Status.failed("Couldn't create instance")); } String mysqlURL = (String) Param.get("mysql.url"); @@ -154,26 +153,22 @@ public class ConnectionLineAccessibility extends TestCase } catch (com.sun.star.lang.WrappedTargetException e) { - e.printStackTrace(log); - throw new StatusException(Status.failed( + throw new StatusException(e, Status.failed( "Couldn't set property value")); } catch (com.sun.star.lang.IllegalArgumentException e) { - e.printStackTrace(log); - throw new StatusException(Status.failed( + throw new StatusException(e, Status.failed( "Couldn't set property value")); } catch (com.sun.star.beans.PropertyVetoException e) { - e.printStackTrace(log); - throw new StatusException(Status.failed( + throw new StatusException(e, Status.failed( "Couldn't set property value")); } catch (com.sun.star.beans.UnknownPropertyException e) { - e.printStackTrace(log); - throw new StatusException(Status.failed( + throw new StatusException(e, Status.failed( "Couldn't set property value")); } @@ -192,8 +187,7 @@ public class ConnectionLineAccessibility extends TestCase } catch (com.sun.star.uno.Exception e) { - e.printStackTrace(log); - throw new StatusException(Status.failed("Couldn't register object")); + throw new StatusException(e, Status.failed("Couldn't register object")); } isolConnection = UnoRuntime.queryInterface( @@ -236,8 +230,7 @@ public class ConnectionLineAccessibility extends TestCase } catch (com.sun.star.sdbc.SQLException e2) { - e2.printStackTrace(log); - throw new StatusException(Status.failed("SQLException")); + throw new StatusException(e2, Status.failed("SQLException")); } } @@ -260,26 +253,22 @@ public class ConnectionLineAccessibility extends TestCase } catch (com.sun.star.lang.WrappedTargetException e) { - e.printStackTrace(log); - throw new StatusException(Status.failed( + throw new StatusException(e, Status.failed( "Couldn't set property value")); } catch (com.sun.star.lang.IllegalArgumentException e) { - e.printStackTrace(log); - throw new StatusException(Status.failed( + throw new StatusException(e, Status.failed( "Couldn't set property value")); } catch (com.sun.star.beans.PropertyVetoException e) { - e.printStackTrace(log); - throw new StatusException(Status.failed( + throw new StatusException(e, Status.failed( "Couldn't set property value")); } catch (com.sun.star.beans.UnknownPropertyException e) { - e.printStackTrace(log); - throw new StatusException(Status.failed( + throw new StatusException(e, Status.failed( "Couldn't set property value")); } @@ -295,28 +284,23 @@ public class ConnectionLineAccessibility extends TestCase } catch (com.sun.star.lang.WrappedTargetException e) { - e.printStackTrace(log); - throw new StatusException(Status.failed("Couldn't insert query")); + throw new StatusException(e, Status.failed("Couldn't insert query")); } catch (com.sun.star.container.ElementExistException e) { - e.printStackTrace(log); - throw new StatusException(Status.failed("Couldn't insert query")); + throw new StatusException(e, Status.failed("Couldn't insert query")); } catch (com.sun.star.lang.IllegalArgumentException e) { - e.printStackTrace(log); - throw new StatusException(Status.failed("Couldn't insert query")); + throw new StatusException(e, Status.failed("Couldn't insert query")); } catch (com.sun.star.io.IOException e) { - e.printStackTrace(log); - throw new StatusException(Status.failed("Couldn't insert query")); + throw new StatusException(e, Status.failed("Couldn't insert query")); } catch (com.sun.star.sdbc.SQLException e) { - e.printStackTrace(log); - throw new StatusException(Status.failed("Couldn't insert query")); + throw new StatusException(e, Status.failed("Couldn't insert query")); } PropertyValue[] loadProps = new PropertyValue[3]; diff --git a/qadevOOo/tests/java/mod/_dbaccess/JoinViewAccessibility.java b/qadevOOo/tests/java/mod/_dbaccess/JoinViewAccessibility.java index 2dbcd0bc672b..46a5551c68a1 100644 --- a/qadevOOo/tests/java/mod/_dbaccess/JoinViewAccessibility.java +++ b/qadevOOo/tests/java/mod/_dbaccess/JoinViewAccessibility.java @@ -113,8 +113,7 @@ public class JoinViewAccessibility extends TestCase { .createInstance ("com.sun.star.awt.Toolkit"); } catch (com.sun.star.uno.Exception e) { - e.printStackTrace (log); - throw new StatusException (Status.failed ("Couldn't create instance")); + throw new StatusException(e, Status.failed ("Couldn't create instance")); } String mysqlURL = (String) Param.get ("mysql.url"); @@ -151,24 +150,16 @@ public class JoinViewAccessibility extends TestCase { propSetDBSource.setPropertyValue ("Info", info); } catch (com.sun.star.lang.WrappedTargetException e) { - e.printStackTrace (log); - throw new StatusException (Status.failed ( - "Couldn't set property value")); + throw new StatusException(e, Status.failed("Couldn't set property value")); } catch (com.sun.star.lang.IllegalArgumentException e) { - e.printStackTrace (log); - throw new StatusException (Status.failed ( - "Couldn't set property value")); + throw new StatusException(e, Status.failed("Couldn't set property value")); } catch (com.sun.star.beans.PropertyVetoException e) { - e.printStackTrace (log); - throw new StatusException (Status.failed ( - "Couldn't set property value")); + throw new StatusException(e, Status.failed("Couldn't set property value")); } catch (com.sun.star.beans.UnknownPropertyException e) { - e.printStackTrace (log); - throw new StatusException (Status.failed ( - "Couldn't set property value")); + throw new StatusException(e, Status.failed("Couldn't set property value")); } try @@ -184,8 +175,7 @@ public class JoinViewAccessibility extends TestCase { log.println ("... done"); } catch (com.sun.star.uno.Exception e) { - e.printStackTrace (log); - throw new StatusException (Status.failed ("Couldn't register object")); + throw new StatusException(e, Status.failed ("Couldn't register object")); } isolConnection = UnoRuntime.queryInterface ( @@ -226,8 +216,7 @@ public class JoinViewAccessibility extends TestCase { col_name2 + " int)"); } catch (com.sun.star.sdbc.SQLException e2) { - e2.printStackTrace (log); - throw new StatusException (Status.failed ("SQLException")); + throw new StatusException(e, Status.failed ("SQLException")); } } @@ -249,24 +238,16 @@ public class JoinViewAccessibility extends TestCase { queryProp.setPropertyValue ("Command", query); } catch (com.sun.star.lang.WrappedTargetException e) { - e.printStackTrace (log); - throw new StatusException (Status.failed ( - "Couldn't set property value")); + throw new StatusException(e, Status.failed("Couldn't set property value")); } catch (com.sun.star.lang.IllegalArgumentException e) { - e.printStackTrace (log); - throw new StatusException (Status.failed ( - "Couldn't set property value")); + throw new StatusException(e, Status.failed("Couldn't set property value")); } catch (com.sun.star.beans.PropertyVetoException e) { - e.printStackTrace (log); - throw new StatusException (Status.failed ( - "Couldn't set property value")); + throw new StatusException(e, Status.failed("Couldn't set property value")); } catch (com.sun.star.beans.UnknownPropertyException e) { - e.printStackTrace (log); - throw new StatusException (Status.failed ( - "Couldn't set property value")); + throw new StatusException(e, Status.failed("Couldn't set property value")); } XNameContainer queryContainer = UnoRuntime.queryInterface ( @@ -280,24 +261,19 @@ public class JoinViewAccessibility extends TestCase { connection.close (); } catch (com.sun.star.lang.WrappedTargetException e) { - e.printStackTrace (log); - throw new StatusException (Status.failed ("Couldn't insert query")); + throw new StatusException(e, Status.failed ("Couldn't insert query")); } catch (com.sun.star.container.ElementExistException e) { - e.printStackTrace (log); - throw new StatusException (Status.failed ("Couldn't insert query")); + throw new StatusException(e, Status.failed ("Couldn't insert query")); } catch (com.sun.star.lang.IllegalArgumentException e) { - e.printStackTrace (log); - throw new StatusException (Status.failed ("Couldn't insert query")); + throw new StatusException(e, Status.failed ("Couldn't insert query")); } catch (com.sun.star.io.IOException e) { - e.printStackTrace (log); - throw new StatusException (Status.failed ("Couldn't insert query")); + throw new StatusException(e, Status.failed ("Couldn't insert query")); } catch (com.sun.star.sdbc.SQLException e) { - e.printStackTrace (log); - throw new StatusException (Status.failed ("Couldn't insert query")); + throw new StatusException(e, Status.failed ("Couldn't insert query")); } PropertyValue[] loadProps = new PropertyValue[3]; diff --git a/qadevOOo/tests/java/mod/_dbaccess/ORowSet.java b/qadevOOo/tests/java/mod/_dbaccess/ORowSet.java index be7877107b28..dbb72469ea0a 100644 --- a/qadevOOo/tests/java/mod/_dbaccess/ORowSet.java +++ b/qadevOOo/tests/java/mod/_dbaccess/ORowSet.java @@ -265,13 +265,12 @@ public class ORowSet extends TestCase { } catch(java.sql.SQLException e) { - e.printStackTrace(log); - throw new StatusException(Status.failed("Couldn't " + + throw new StatusException(e, Status.failed("Couldn't " + " init test table. SQLException...")); } catch(java.lang.ClassNotFoundException e) { - throw new StatusException(Status.failed("Couldn't " + + throw new StatusException(e, Status.failed("Couldn't " + "register mysql driver")); } } diff --git a/qadevOOo/tests/java/mod/_dbaccess/TableWindowAccessibility.java b/qadevOOo/tests/java/mod/_dbaccess/TableWindowAccessibility.java index 3a7b8b528d70..17839ab97c3b 100644 --- a/qadevOOo/tests/java/mod/_dbaccess/TableWindowAccessibility.java +++ b/qadevOOo/tests/java/mod/_dbaccess/TableWindowAccessibility.java @@ -112,8 +112,7 @@ public class TableWindowAccessibility extends TestCase { Param.getMSF() .createInstance("com.sun.star.awt.Toolkit"); } catch (com.sun.star.uno.Exception e) { - e.printStackTrace(log); - throw new StatusException(Status.failed("Couldn't create instance")); + throw new StatusException(e, Status.failed("Couldn't create instance")); } String mysqlURL = (String) Param.get("mysql.url"); @@ -146,21 +145,13 @@ public class TableWindowAccessibility extends TestCase { propSetDBSource.setPropertyValue("URL", mysqlURL); propSetDBSource.setPropertyValue("Info", info); } catch (com.sun.star.lang.WrappedTargetException e) { - e.printStackTrace(log); - throw new StatusException(Status.failed( - "Couldn't set property value")); + throw new StatusException(e, Status.failed("Couldn't set property value")); } catch (com.sun.star.lang.IllegalArgumentException e) { - e.printStackTrace(log); - throw new StatusException(Status.failed( - "Couldn't set property value")); + throw new StatusException(e, Status.failed("Couldn't set property value")); } catch (com.sun.star.beans.PropertyVetoException e) { - e.printStackTrace(log); - throw new StatusException(Status.failed( - "Couldn't set property value")); + throw new StatusException(e, Status.failed("Couldn't set property value")); } catch (com.sun.star.beans.UnknownPropertyException e) { - e.printStackTrace(log); - throw new StatusException(Status.failed( - "Couldn't set property value")); + throw new StatusException(e, Status.failed("Couldn't set property value")); } try { @@ -211,8 +202,7 @@ public class TableWindowAccessibility extends TestCase { statement.executeUpdate("create table " + tbl_name2 + " (" + col_name2 + " int)"); } catch (com.sun.star.sdbc.SQLException e2) { - e2.printStackTrace(log); - throw new StatusException(Status.failed("SQLException")); + throw new StatusException(e2, Status.failed("SQLException")); } } @@ -232,21 +222,13 @@ public class TableWindowAccessibility extends TestCase { col_name2; queryProp.setPropertyValue("Command", query); } catch (com.sun.star.lang.WrappedTargetException e) { - e.printStackTrace(log); - throw new StatusException(Status.failed( - "Couldn't set property value")); + throw new StatusException(e, Status.failed("Couldn't set property value")); } catch (com.sun.star.lang.IllegalArgumentException e) { - e.printStackTrace(log); - throw new StatusException(Status.failed( - "Couldn't set property value")); + throw new StatusException(e, Status.failed("Couldn't set property value")); } catch (com.sun.star.beans.PropertyVetoException e) { - e.printStackTrace(log); - throw new StatusException(Status.failed( - "Couldn't set property value")); + throw new StatusException(e, Status.failed("Couldn't set property value")); } catch (com.sun.star.beans.UnknownPropertyException e) { - e.printStackTrace(log); - throw new StatusException(Status.failed( - "Couldn't set property value")); + throw new StatusException(e, Status.failed("Couldn't set property value")); } XNameContainer queryContainer = UnoRuntime.queryInterface( @@ -258,20 +240,15 @@ public class TableWindowAccessibility extends TestCase { store.store(); connection.close (); } catch (com.sun.star.lang.WrappedTargetException e) { - e.printStackTrace(log); - throw new StatusException(Status.failed("Couldn't insert query")); + throw new StatusException(e, Status.failed("Couldn't insert query")); } catch (com.sun.star.container.ElementExistException e) { - e.printStackTrace(log); - throw new StatusException(Status.failed("Couldn't insert query")); + throw new StatusException(e, Status.failed("Couldn't insert query")); } catch (com.sun.star.lang.IllegalArgumentException e) { - e.printStackTrace(log); - throw new StatusException(Status.failed("Couldn't insert query")); + throw new StatusException(e, Status.failed("Couldn't insert query")); } catch (com.sun.star.io.IOException e) { - e.printStackTrace(log); - throw new StatusException(Status.failed("Couldn't insert query")); + throw new StatusException(e, Status.failed("Couldn't insert query")); } catch (com.sun.star.sdbc.SQLException e) { - e.printStackTrace(log); - throw new StatusException(Status.failed("Couldn't insert query")); + throw new StatusException(e, Status.failed("Couldn't insert query")); } PropertyValue[] loadProps = new PropertyValue[3]; diff --git a/qadevOOo/tests/java/mod/_dbpool/OConnectionPool.java b/qadevOOo/tests/java/mod/_dbpool/OConnectionPool.java index 4eac4ab86735..468d97966523 100644 --- a/qadevOOo/tests/java/mod/_dbpool/OConnectionPool.java +++ b/qadevOOo/tests/java/mod/_dbpool/OConnectionPool.java @@ -52,8 +52,7 @@ public class OConnectionPool extends TestCase { oObj = (XInterface) xMSF.createInstance("com.sun.star.sdbc.ConnectionPool"); } catch(com.sun.star.uno.Exception e) { - throw new StatusException( - Status.failed("Couldn't create instance")); + throw new StatusException(e, Status.failed("Couldn't create instance")); } log.println("creating a new environment for object"); diff --git a/qadevOOo/tests/java/mod/_file/calc/ODriver.java b/qadevOOo/tests/java/mod/_file/calc/ODriver.java index 4e17d9a448e8..a73a0a3e0333 100644 --- a/qadevOOo/tests/java/mod/_file/calc/ODriver.java +++ b/qadevOOo/tests/java/mod/_file/calc/ODriver.java @@ -70,8 +70,7 @@ public class ODriver extends TestCase { oObj = (XInterface)Param.getMSF().createInstance( "com.sun.star.comp.sdbc.calc.ODriver"); } catch (com.sun.star.uno.Exception e) { - e.printStackTrace(log); - throw new StatusException(Status.failed("Couldn't create object")); + throw new StatusException(e, Status.failed("Couldn't create object")); } log.println("creating a new environment for calc.ODriver object"); diff --git a/qadevOOo/tests/java/mod/_file/dbase/ODriver.java b/qadevOOo/tests/java/mod/_file/dbase/ODriver.java index 70ffcd27094f..e8dd2d466933 100644 --- a/qadevOOo/tests/java/mod/_file/dbase/ODriver.java +++ b/qadevOOo/tests/java/mod/_file/dbase/ODriver.java @@ -69,8 +69,7 @@ public class ODriver extends TestCase { oObj = (XInterface)Param.getMSF().createInstance( "com.sun.star.comp.sdbc.dbase.ODriver"); } catch (com.sun.star.uno.Exception e) { - e.printStackTrace(log); - throw new StatusException(Status.failed("Couldn't create object")); + throw new StatusException(e, Status.failed("Couldn't create object")); } log.println("creating a new environment for dbase.ODriver object"); diff --git a/qadevOOo/tests/java/mod/_file/flat/ODriver.java b/qadevOOo/tests/java/mod/_file/flat/ODriver.java index 849de8497ea0..5287ea31fbd6 100644 --- a/qadevOOo/tests/java/mod/_file/flat/ODriver.java +++ b/qadevOOo/tests/java/mod/_file/flat/ODriver.java @@ -67,8 +67,7 @@ public class ODriver extends TestCase { oObj = (XInterface)Param.getMSF().createInstance( "com.sun.star.comp.sdbc.flat.ODriver"); } catch (com.sun.star.uno.Exception e) { - e.printStackTrace(log); - throw new StatusException(Status.failed("Couldn't create object")); + throw new StatusException(e, Status.failed("Couldn't create object")); } log.println("creating a new environment for flat.ODriver object"); diff --git a/qadevOOo/tests/java/mod/_forms/ODatabaseForm.java b/qadevOOo/tests/java/mod/_forms/ODatabaseForm.java index e1a2c68e61ae..8a1b43c88f56 100644 --- a/qadevOOo/tests/java/mod/_forms/ODatabaseForm.java +++ b/qadevOOo/tests/java/mod/_forms/ODatabaseForm.java @@ -330,10 +330,9 @@ public class ODatabaseForm extends TestCase { try { dbTools.initTestTableUsingJDBC(tableName, srcInf); } catch (java.sql.SQLException e) { - e.printStackTrace(log); - throw new StatusException(Status.failed("Couldn't " + " init test table. SQLException...")); + throw new StatusException(e, Status.failed("Couldn't " + " init test table. SQLException...")); } catch (java.lang.ClassNotFoundException e) { - throw new StatusException(Status.failed("Couldn't " + "register mysql driver")); + throw new StatusException(e, Status.failed("Couldn't " + "register mysql driver")); } } diff --git a/qadevOOo/tests/java/mod/_forms/OFileControlModel.java b/qadevOOo/tests/java/mod/_forms/OFileControlModel.java index d0644dbbc7cc..b44bbbb8a29a 100644 --- a/qadevOOo/tests/java/mod/_forms/OFileControlModel.java +++ b/qadevOOo/tests/java/mod/_forms/OFileControlModel.java @@ -102,9 +102,7 @@ public class OFileControlModel extends TestCase { log.println("creating a draw document"); xDrawDoc = SOF.createDrawDoc(null); } catch (com.sun.star.uno.Exception e) { - log.println("Can't create a document :"); - e.printStackTrace(log); - throw new StatusException(Status.failed("Can't create a document")); + throw new StatusException(e, Status.failed("Can't create a document")); } } @@ -176,9 +174,7 @@ public class OFileControlModel extends TestCase { aShape.setSize(size); aShape.setPosition(position); } catch (com.sun.star.uno.Exception e) { - // Some exception occurs.FAILED - log.println("Couldn't create a component " + e); - throw new StatusException(Status.failed("Can't create component")); + throw new StatusException(e, Status.failed("Can't create component")); } aShape.setControl(aControl); diff --git a/qadevOOo/tests/java/mod/_fwk/Desktop.java b/qadevOOo/tests/java/mod/_fwk/Desktop.java index f97d440b1588..35fd5183d6e7 100644 --- a/qadevOOo/tests/java/mod/_fwk/Desktop.java +++ b/qadevOOo/tests/java/mod/_fwk/Desktop.java @@ -100,9 +100,7 @@ public class Desktop extends TestCase { log.println( "creating a text document" ); xTextDoc = SOF.createTextDoc(null); } catch ( com.sun.star.uno.Exception e ) { - // Some exception occurs.FAILED - e.printStackTrace( log ); - throw new StatusException( "Couldn't create document", e ); + throw new StatusException("Couldn't create document", e); } XInterface oObj = null; @@ -111,9 +109,7 @@ public class Desktop extends TestCase { oObj = (XInterface)Param.getMSF().createInstance( "com.sun.star.comp.framework.Desktop"); } catch(com.sun.star.uno.Exception e) { - e.printStackTrace(log); - throw new StatusException( - Status.failed("Couldn't create instance")); + throw new StatusException(e, Status.failed("Couldn't create instance")); } TestEnvironment tEnv = new TestEnvironment( oObj ); diff --git a/qadevOOo/tests/java/mod/_fwk/DispatchRecorderSupplier.java b/qadevOOo/tests/java/mod/_fwk/DispatchRecorderSupplier.java index 07df37d050cb..40fe1540eaec 100644 --- a/qadevOOo/tests/java/mod/_fwk/DispatchRecorderSupplier.java +++ b/qadevOOo/tests/java/mod/_fwk/DispatchRecorderSupplier.java @@ -53,9 +53,7 @@ public class DispatchRecorderSupplier extends TestCase { oObj = (XInterface)Param.getMSF().createInstance( "com.sun.star.comp.framework.DispatchRecorderSupplier"); } catch(com.sun.star.uno.Exception e) { - e.printStackTrace(log); - throw new StatusException( - Status.failed("Couldn't create instance")); + throw new StatusException(e, Status.failed("Couldn't create instance")); } TestEnvironment tEnv = new TestEnvironment( oObj ); diff --git a/qadevOOo/tests/java/mod/_fwk/JobExecutor.java b/qadevOOo/tests/java/mod/_fwk/JobExecutor.java index f33c31fffa9b..8cf372db98c2 100644 --- a/qadevOOo/tests/java/mod/_fwk/JobExecutor.java +++ b/qadevOOo/tests/java/mod/_fwk/JobExecutor.java @@ -209,9 +209,7 @@ public class JobExecutor extends TestCase { "com.sun.star.comp.framework.JobExecutor"); job = Param.getMSF().createInstance("test.Job"); } catch(com.sun.star.uno.Exception e) { - e.printStackTrace(log); - throw new StatusException( - Status.failed("Couldn't create instance")); + throw new StatusException(e, Status.failed("Couldn't create instance")); } xNamed = UnoRuntime.queryInterface(XNamed.class, job); diff --git a/qadevOOo/tests/java/mod/_fwk/JobHandler.java b/qadevOOo/tests/java/mod/_fwk/JobHandler.java index d17958fd4877..61f6c9e6a102 100644 --- a/qadevOOo/tests/java/mod/_fwk/JobHandler.java +++ b/qadevOOo/tests/java/mod/_fwk/JobHandler.java @@ -68,9 +68,7 @@ public class JobHandler extends TestCase { oObj = (XInterface)Param.getMSF().createInstance( "com.sun.star.comp.framework.jobs.JobDispatch"); } catch(com.sun.star.uno.Exception e) { - e.printStackTrace(log); - throw new StatusException( - Status.failed("Couldn't create instance")); + throw new StatusException(e, Status.failed("Couldn't create instance")); } TestEnvironment tEnv = new TestEnvironment( oObj ); diff --git a/qadevOOo/tests/java/mod/_fwk/MailToDispatcher.java b/qadevOOo/tests/java/mod/_fwk/MailToDispatcher.java index 9b5546406e99..98f817d118a9 100644 --- a/qadevOOo/tests/java/mod/_fwk/MailToDispatcher.java +++ b/qadevOOo/tests/java/mod/_fwk/MailToDispatcher.java @@ -55,9 +55,7 @@ public class MailToDispatcher extends TestCase { oObj = (XInterface)Param.getMSF().createInstance( "com.sun.star.comp.framework.MailToDispatcher"); } catch(com.sun.star.uno.Exception e) { - e.printStackTrace(log); - throw new StatusException( - Status.failed("Couldn't create instance")); + throw new StatusException(e, Status.failed("Couldn't create instance")); } TestEnvironment tEnv = new TestEnvironment( oObj ); diff --git a/qadevOOo/tests/java/mod/_fwk/ModuleManager.java b/qadevOOo/tests/java/mod/_fwk/ModuleManager.java index c88e549d3a17..014379d2239f 100644 --- a/qadevOOo/tests/java/mod/_fwk/ModuleManager.java +++ b/qadevOOo/tests/java/mod/_fwk/ModuleManager.java @@ -74,9 +74,7 @@ public class ModuleManager extends TestCase { oObj = (XInterface)Param.getMSF().createInstance( "com.sun.star.comp.framework.ModuleManager"); } catch(Exception e) { - e.printStackTrace(log); - throw new StatusException( - Status.failed("Couldn't create instance")); + throw new StatusException(e, Status.failed("Couldn't create instance")); } // get a soffice factory object SOfficeFactory SOF = SOfficeFactory.getFactory( diff --git a/qadevOOo/tests/java/mod/_fwk/ServiceHandler.java b/qadevOOo/tests/java/mod/_fwk/ServiceHandler.java index 0bf0512562e3..44aa29a1ecd4 100644 --- a/qadevOOo/tests/java/mod/_fwk/ServiceHandler.java +++ b/qadevOOo/tests/java/mod/_fwk/ServiceHandler.java @@ -55,9 +55,7 @@ public class ServiceHandler extends TestCase { oObj = (XInterface)Param.getMSF().createInstance( "com.sun.star.comp.framework.ServiceHandler"); } catch(com.sun.star.uno.Exception e) { - e.printStackTrace(log); - throw new StatusException( - Status.failed("Couldn't create instance")); + throw new StatusException(e, Status.failed("Couldn't create instance")); } TestEnvironment tEnv = new TestEnvironment( oObj ); diff --git a/qadevOOo/tests/java/mod/_fwk/SoundHandler.java b/qadevOOo/tests/java/mod/_fwk/SoundHandler.java index d0c550ad6929..d563645e2762 100644 --- a/qadevOOo/tests/java/mod/_fwk/SoundHandler.java +++ b/qadevOOo/tests/java/mod/_fwk/SoundHandler.java @@ -55,9 +55,7 @@ public class SoundHandler extends TestCase { oObj = (XInterface)Param.getMSF().createInstance( "com.sun.star.frame.ContentHandler"); } catch(com.sun.star.uno.Exception e) { - e.printStackTrace(log); - throw new StatusException( - Status.failed("Couldn't create instance")); + throw new StatusException(e, Status.failed("Couldn't create instance")); } TestEnvironment tEnv = new TestEnvironment( oObj ); diff --git a/qadevOOo/tests/java/mod/_fwk/URLTransformer.java b/qadevOOo/tests/java/mod/_fwk/URLTransformer.java index 6a304687699a..b8d9d512f7c3 100644 --- a/qadevOOo/tests/java/mod/_fwk/URLTransformer.java +++ b/qadevOOo/tests/java/mod/_fwk/URLTransformer.java @@ -51,9 +51,7 @@ public class URLTransformer extends TestCase { oObj = (XInterface)Param.getMSF().createInstance( "com.sun.star.comp.framework.URLTransformer"); } catch(com.sun.star.uno.Exception e) { - e.printStackTrace(log); - throw new StatusException( - Status.failed("Couldn't create instance")); + throw new StatusException(e, Status.failed("Couldn't create instance")); } TestEnvironment tEnv = new TestEnvironment( oObj ); diff --git a/qadevOOo/tests/java/mod/_fwl/FilterFactory.java b/qadevOOo/tests/java/mod/_fwl/FilterFactory.java index 9fc1bd8275b5..b2eff4cf14d4 100644 --- a/qadevOOo/tests/java/mod/_fwl/FilterFactory.java +++ b/qadevOOo/tests/java/mod/_fwl/FilterFactory.java @@ -103,11 +103,9 @@ public class FilterFactory extends TestCase { getPropertyValue (((PropertyValue[]) instance), "FilterService"); } catch (com.sun.star.container.NoSuchElementException e){ - throw new StatusException( - Status.failed("Couldn't get elements from object")); + throw new StatusException(e, Status.failed("Couldn't get elements from object")); } catch (com.sun.star.lang.WrappedTargetException e){ - throw new StatusException( - Status.failed("Couldn't get elements from object")); + throw new StatusException(e, Status.failed("Couldn't get elements from object")); } log.println("adding INSTANCE 1 as obj relation to environment"); diff --git a/qadevOOo/tests/java/mod/_fwl/TypeDetection.java b/qadevOOo/tests/java/mod/_fwl/TypeDetection.java index dfa8f98175fc..f64f20b9a534 100644 --- a/qadevOOo/tests/java/mod/_fwl/TypeDetection.java +++ b/qadevOOo/tests/java/mod/_fwl/TypeDetection.java @@ -119,11 +119,9 @@ public class TypeDetection extends TestCase { try{ instance = (Object[]) xNA.getByName(elementName); } catch (com.sun.star.container.NoSuchElementException e){ - throw new StatusException( - Status.failed("Couldn't get elements from object")); + throw new StatusException(e, Status.failed("Couldn't get elements from object")); } catch (com.sun.star.lang.WrappedTargetException e){ - throw new StatusException( - Status.failed("Couldn't get elements from object")); + throw new StatusException(e, Status.failed("Couldn't get elements from object")); } log.println("adding INSTANCE 1 as obj relation to environment"); diff --git a/qadevOOo/tests/java/mod/_jdbc/JDBCDriver.java b/qadevOOo/tests/java/mod/_jdbc/JDBCDriver.java index e5c215d268ab..291ceb00d51b 100644 --- a/qadevOOo/tests/java/mod/_jdbc/JDBCDriver.java +++ b/qadevOOo/tests/java/mod/_jdbc/JDBCDriver.java @@ -65,8 +65,7 @@ public class JDBCDriver extends TestCase { oObj = (XInterface)Param.getMSF().createInstance( "com.sun.star.comp.sdbc.JDBCDriver"); } catch (com.sun.star.uno.Exception e) { - e.printStackTrace(log); - throw new StatusException(Status.failed("Couldn't create object")); + throw new StatusException(e, Status.failed("Couldn't create object")); } log.println("creating a new environment for JDBCDriver object"); diff --git a/qadevOOo/tests/java/mod/_mozab/MozabDriver.java b/qadevOOo/tests/java/mod/_mozab/MozabDriver.java index f52895372116..aa316979136f 100644 --- a/qadevOOo/tests/java/mod/_mozab/MozabDriver.java +++ b/qadevOOo/tests/java/mod/_mozab/MozabDriver.java @@ -66,7 +66,7 @@ public class MozabDriver extends TestCase { oObj = (XInterface)Param.getMSF(). createInstance("com.sun.star.comp.sdbc.MozabDriver"); } catch (com.sun.star.uno.Exception e) { - throw new StatusException(Status.failed("Couldn't create object")); + throw new StatusException(e, Status.failed("Couldn't create object")); } log.println("creating a new environment for object"); diff --git a/qadevOOo/tests/java/mod/_odbc/ODBCDriver.java b/qadevOOo/tests/java/mod/_odbc/ODBCDriver.java index 5ba1eaa97a69..6e6cd83039f4 100644 --- a/qadevOOo/tests/java/mod/_odbc/ODBCDriver.java +++ b/qadevOOo/tests/java/mod/_odbc/ODBCDriver.java @@ -62,8 +62,7 @@ public class ODBCDriver extends TestCase { oObj = (XInterface)Param.getMSF().createInstance( "com.sun.star.comp.sdbc.ODBCDriver"); } catch (com.sun.star.uno.Exception e) { - e.printStackTrace(log); - throw new StatusException(Status.failed("Couldn't create object")); + throw new StatusException(e, Status.failed("Couldn't create object")); } log.println("creating a new environment for ODBCDriver object"); diff --git a/qadevOOo/tests/java/mod/_sc/AccessibleEditableTextPara_PreviewCell.java b/qadevOOo/tests/java/mod/_sc/AccessibleEditableTextPara_PreviewCell.java index e0f9a2e8581b..360970b88a75 100644 --- a/qadevOOo/tests/java/mod/_sc/AccessibleEditableTextPara_PreviewCell.java +++ b/qadevOOo/tests/java/mod/_sc/AccessibleEditableTextPara_PreviewCell.java @@ -134,7 +134,7 @@ public class AccessibleEditableTextPara_PreviewCell extends TestCase { xDispatcher.dispatch( aURL, null ); } catch (com.sun.star.uno.Exception e) { log.println("Couldn't change mode"); - throw new StatusException(Status.failed("Couldn't change mode")); + throw new StatusException(e, Status.failed("Couldn't change mode")); } XAccessibleContext oObj = null; diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessibleDocumentPagePreview.java b/qadevOOo/tests/java/mod/_sc/ScAccessibleDocumentPagePreview.java index 8e1e05ac40f7..fb6995dbc028 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessibleDocumentPagePreview.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessibleDocumentPagePreview.java @@ -146,8 +146,7 @@ public class ScAccessibleDocumentPagePreview extends TestCase { if(xDispatcher != null) xDispatcher.dispatch( aURL, null ); } catch (com.sun.star.uno.Exception e) { - log.println("Couldn't change mode"); - throw new StatusException(Status.failed("Couldn't change mode")); + throw new StatusException(e, Status.failed("Couldn't change mode")); } try { diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeader.java b/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeader.java index 552c7c0536d7..318e29dfe99b 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeader.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeader.java @@ -132,8 +132,7 @@ public class ScAccessiblePageHeader extends TestCase { if(xDispatcher != null) xDispatcher.dispatch( aURL, null ); } catch (com.sun.star.uno.Exception e) { - log.println("Couldn't change mode"); - throw new StatusException(Status.failed("Couldn't change mode")); + throw new StatusException(e, Status.failed("Couldn't change mode")); } XInterface oObj = null; diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeaderArea.java b/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeaderArea.java index e05f4da4f220..f63df1bbf2db 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeaderArea.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeaderArea.java @@ -128,8 +128,7 @@ public class ScAccessiblePageHeaderArea extends TestCase { if(xDispatcher != null) xDispatcher.dispatch( aURL, null ); } catch (com.sun.star.uno.Exception e) { - log.println("Couldn't change mode"); - throw new StatusException(Status.failed("Couldn't change mode")); + throw new StatusException(e, Status.failed("Couldn't change mode")); } try { diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewCell.java b/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewCell.java index bb6c5e2e5450..b67fbf657ab5 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewCell.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewCell.java @@ -156,8 +156,7 @@ public class ScAccessiblePreviewCell extends TestCase { if(xDispatcher != null) xDispatcher.dispatch( aURL, null ); } catch (com.sun.star.uno.Exception e) { - log.println("Couldn't change mode"); - throw new StatusException(Status.failed("Couldn't change mode")); + throw new StatusException(e, Status.failed("Couldn't change mode")); } XInterface oObj = null; diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewHeaderCell.java b/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewHeaderCell.java index 4f83e467aad9..388249d8c7d4 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewHeaderCell.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewHeaderCell.java @@ -189,30 +189,24 @@ public class ScAccessiblePreviewHeaderCell extends TestCase { xPropSet = UnoRuntime.queryInterface( XPropertySet.class, oDefStyle); } catch (com.sun.star.lang.WrappedTargetException e) { - e.printStackTrace(log); - throw new StatusException(Status.failed("Couldn't get element")); + throw new StatusException(e, Status.failed("Couldn't get element")); } catch (com.sun.star.container.NoSuchElementException e) { - e.printStackTrace(log); - throw new StatusException(Status.failed("Couldn't get element")); + throw new StatusException(e, Status.failed("Couldn't get element")); } try { xPropSet.setPropertyValue("PrintHeaders", Boolean.TRUE); } catch (com.sun.star.lang.WrappedTargetException e) { - e.printStackTrace(log); - throw new StatusException(Status.failed( + throw new StatusException(e, Status.failed( "Couldn't set property 'PrintHeaders'")); } catch (com.sun.star.lang.IllegalArgumentException e) { - e.printStackTrace(log); - throw new StatusException(Status.failed( + throw new StatusException(e, Status.failed( "Couldn't set property 'PrintHeaders'")); } catch (com.sun.star.beans.PropertyVetoException e) { - e.printStackTrace(log); - throw new StatusException(Status.failed( + throw new StatusException(e, Status.failed( "Couldn't set property 'PrintHeaders'")); } catch (com.sun.star.beans.UnknownPropertyException e) { - e.printStackTrace(log); - throw new StatusException(Status.failed( + throw new StatusException(e, Status.failed( "Couldn't set property 'PrintHeaders'")); } @@ -237,8 +231,7 @@ public class ScAccessiblePreviewHeaderCell extends TestCase { xDispatcher.dispatch(aURL, null); } } catch (com.sun.star.uno.Exception e) { - log.println("Couldn't change mode"); - throw new StatusException(Status.failed("Couldn't change mode")); + throw new StatusException(e, Status.failed("Couldn't change mode")); } XInterface oObj = null; diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewTable.java b/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewTable.java index 7f5ecd269f84..f2e963f36722 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewTable.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewTable.java @@ -159,8 +159,7 @@ public class ScAccessiblePreviewTable extends TestCase { if(xDispatcher != null) xDispatcher.dispatch( aURL, null ); } catch (com.sun.star.uno.Exception e) { - log.println("Couldn't change mode"); - throw new StatusException(Status.failed("Couldn't change mode")); + throw new StatusException(e, Status.failed("Couldn't change mode")); } XAccessible xRoot; diff --git a/qadevOOo/tests/java/mod/_sd/DrawController_DrawView.java b/qadevOOo/tests/java/mod/_sd/DrawController_DrawView.java index 9aed41fc284b..ed00ca1445cd 100644 --- a/qadevOOo/tests/java/mod/_sd/DrawController_DrawView.java +++ b/qadevOOo/tests/java/mod/_sd/DrawController_DrawView.java @@ -207,8 +207,7 @@ public class DrawController_DrawView extends TestCase { oShapeCol2 = Param.getMSF(). createInstance("com.sun.star.drawing.ShapeCollection"); } catch(com.sun.star.uno.Exception e) { - e.printStackTrace(log); - throw new StatusException(Status.failed("Couldn't create instance")); + throw new StatusException(e, Status.failed("Couldn't create instance")); } XShapes xShapes1 = UnoRuntime.queryInterface(XShapes.class, oShapeCol1); diff --git a/qadevOOo/tests/java/mod/_sd/DrawController_HandoutView.java b/qadevOOo/tests/java/mod/_sd/DrawController_HandoutView.java index 1703c95d4a5d..9c7462098a9d 100644 --- a/qadevOOo/tests/java/mod/_sd/DrawController_HandoutView.java +++ b/qadevOOo/tests/java/mod/_sd/DrawController_HandoutView.java @@ -240,8 +240,7 @@ public class DrawController_HandoutView extends TestCase { oShapeCol2 = xMSF. createInstance("com.sun.star.drawing.ShapeCollection"); } catch(com.sun.star.uno.Exception e) { - e.printStackTrace(log); - throw new StatusException(Status.failed("Couldn't create instance")); + throw new StatusException(e, Status.failed("Couldn't create instance")); } XShapes xShapes1 = UnoRuntime.queryInterface(XShapes.class, oShapeCol1); diff --git a/qadevOOo/tests/java/mod/_sd/DrawController_NotesView.java b/qadevOOo/tests/java/mod/_sd/DrawController_NotesView.java index 65a641d1ddba..a16b052ea4ae 100644 --- a/qadevOOo/tests/java/mod/_sd/DrawController_NotesView.java +++ b/qadevOOo/tests/java/mod/_sd/DrawController_NotesView.java @@ -237,8 +237,7 @@ public class DrawController_NotesView extends TestCase { oShapeCol2 = xMSF. createInstance("com.sun.star.drawing.ShapeCollection"); } catch(com.sun.star.uno.Exception e) { - e.printStackTrace(log); - throw new StatusException(Status.failed("Couldn't create instance")); + throw new StatusException(e, Status.failed("Couldn't create instance")); } XShapes xShapes1 = UnoRuntime.queryInterface(XShapes.class, oShapeCol1); diff --git a/qadevOOo/tests/java/mod/_sd/DrawController_OutlineView.java b/qadevOOo/tests/java/mod/_sd/DrawController_OutlineView.java index afb690acd572..8a6d21e72a14 100644 --- a/qadevOOo/tests/java/mod/_sd/DrawController_OutlineView.java +++ b/qadevOOo/tests/java/mod/_sd/DrawController_OutlineView.java @@ -237,8 +237,7 @@ public class DrawController_OutlineView extends TestCase { oShapeCol2 = xMSF. createInstance("com.sun.star.drawing.ShapeCollection"); } catch(com.sun.star.uno.Exception e) { - e.printStackTrace(log); - throw new StatusException(Status.failed("Couldn't create instance")); + throw new StatusException(e, Status.failed("Couldn't create instance")); } XShapes xShapes1 = UnoRuntime.queryInterface(XShapes.class, oShapeCol1); diff --git a/qadevOOo/tests/java/mod/_sd/DrawController_PresentationView.java b/qadevOOo/tests/java/mod/_sd/DrawController_PresentationView.java index 5163c4f576a4..cd59131d9670 100644 --- a/qadevOOo/tests/java/mod/_sd/DrawController_PresentationView.java +++ b/qadevOOo/tests/java/mod/_sd/DrawController_PresentationView.java @@ -237,8 +237,7 @@ public class DrawController_PresentationView extends TestCase { oShapeCol2 = xMSF. createInstance("com.sun.star.drawing.ShapeCollection"); } catch(com.sun.star.uno.Exception e) { - e.printStackTrace(log); - throw new StatusException(Status.failed("Couldn't create instance")); + throw new StatusException(e, Status.failed("Couldn't create instance")); } XShapes xShapes1 = UnoRuntime.queryInterface(XShapes.class, oShapeCol1); diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentPageView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentPageView.java index 854cb2f218a8..9fcd67c144e4 100644 --- a/qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentPageView.java +++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentPageView.java @@ -110,8 +110,7 @@ public class SwAccessibleDocumentPageView extends TestCase { if(xDispatcher != null) xDispatcher.dispatch( aURL, null ); } catch (com.sun.star.uno.Exception e) { - log.println("Couldn't change mode"); - throw new StatusException(Status.failed("Couldn't change mode")); + throw new StatusException(e, Status.failed("Couldn't change mode")); } shortWait(); diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessiblePageView.java b/qadevOOo/tests/java/mod/_sw/SwAccessiblePageView.java index 77e5d7181c75..9137f9dfc49a 100644 --- a/qadevOOo/tests/java/mod/_sw/SwAccessiblePageView.java +++ b/qadevOOo/tests/java/mod/_sw/SwAccessiblePageView.java @@ -165,8 +165,7 @@ public class SwAccessiblePageView extends TestCase { if(xDispatcher != null) xDispatcher.dispatch( aURL, null ); } catch (com.sun.star.uno.Exception e) { - log.println("Couldn't change mode"); - throw new StatusException(Status.failed("Couldn't change mode")); + throw new StatusException(e, Status.failed("Couldn't change mode")); } shortWait(); diff --git a/qadevOOo/tests/java/mod/_toolkit/MutableTreeNode.java b/qadevOOo/tests/java/mod/_toolkit/MutableTreeNode.java index ea0d8b1368b4..7b469901f8f7 100644 --- a/qadevOOo/tests/java/mod/_toolkit/MutableTreeNode.java +++ b/qadevOOo/tests/java/mod/_toolkit/MutableTreeNode.java @@ -70,7 +70,7 @@ public class MutableTreeNode extends TestCase { mXTreeDataModel = UnoRuntime.queryInterface(XMutableTreeDataModel.class, mxMSF.createInstance("com.sun.star.awt.tree.MutableTreeDataModel")); } catch (com.sun.star.uno.Exception ex) { - throw new StatusException(Status.failed("ERROR: could not create instance of" + + throw new StatusException(ex, Status.failed("ERROR: could not create instance of" + " 'com.sun.star.awt.tree.MutableTreeDataModel'")); } |