diff options
author | Noel Grandin <noel@peralex.com> | 2015-06-09 08:52:12 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-06-09 11:34:31 +0200 |
commit | 2a0dda3dfb37f0cb69842f7d569c253d82f53713 (patch) | |
tree | 7a762c2fa22651cefb68021250a3fad8811e0f06 /qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetLinksEnumeration.java | |
parent | Resolves: more crash on export of ooo47778-3.sxw to docx (diff) | |
download | core-2a0dda3dfb37f0cb69842f7d569c253d82f53713.tar.gz core-2a0dda3dfb37f0cb69842f7d569c253d82f53713.zip |
remove some unnecessary exception wrapping in the Java tests
Modify createTestEnvironment so that it throws Exception. This
is appropriate for unit testing.
The wrapping adds no value and the calling method already has
a catch(Exception) to handle anything.
Change-Id: I430a414f63d2cbfc3b65ecfde0285509265e5192
Diffstat (limited to 'qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetLinksEnumeration.java')
-rw-r--r-- | qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetLinksEnumeration.java | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetLinksEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetLinksEnumeration.java index 14cdd0d913d9..1b9e690fcc9b 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetLinksEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetLinksEnumeration.java @@ -70,7 +70,7 @@ public class ScIndexEnumeration_SheetLinksEnumeration extends TestCase { } @Override - protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) { + protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) throws Exception { XInterface oObj = null; @@ -82,19 +82,8 @@ public class ScIndexEnumeration_SheetLinksEnumeration extends TestCase { log.println("Getting test object ") ; XSpreadsheets oSheets = xSheetDoc.getSheets() ; XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); - try { - oSheet = (XSpreadsheet) AnyConverter.toObject( - new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0)); - } catch (com.sun.star.lang.WrappedTargetException e) { - e.printStackTrace(log); - throw new StatusException( "Couldn't get a spreadsheet", e); - } catch (com.sun.star.lang.IndexOutOfBoundsException e) { - e.printStackTrace(log); - throw new StatusException( "Couldn't get a spreadsheet", e); - } catch (com.sun.star.lang.IllegalArgumentException e) { - e.printStackTrace(log); - throw new StatusException( "Couldn't get a spreadsheet", e); - } + oSheet = (XSpreadsheet) AnyConverter.toObject( + new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0)); XSheetLinkable SL = UnoRuntime.queryInterface(XSheetLinkable.class, oSheet); @@ -106,16 +95,7 @@ public class ScIndexEnumeration_SheetLinksEnumeration extends TestCase { // Getting links. XPropertySet docProps = UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); - Object links = null; - try { - links = docProps.getPropertyValue("SheetLinks"); - } catch(com.sun.star.lang.WrappedTargetException e){ - e.printStackTrace(log); - throw new StatusException("Couldn't get SheetLinks", e); - } catch(com.sun.star.beans.UnknownPropertyException e){ - e.printStackTrace(log); - throw new StatusException("Couldn't get SheetLinks", e); - } + Object links = docProps.getPropertyValue("SheetLinks"); oObj = UnoRuntime.queryInterface(XInterface.class, links); |