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/_sd/SdUnoOutlineView.java | |
parent | 60f8dd78fa3f19e8bed867f7f5926fcf9a8d8e67 (diff) |
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/_sd/SdUnoOutlineView.java')
-rw-r--r-- | qadevOOo/tests/java/mod/_sd/SdUnoOutlineView.java | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/qadevOOo/tests/java/mod/_sd/SdUnoOutlineView.java b/qadevOOo/tests/java/mod/_sd/SdUnoOutlineView.java index 69fb8b7ea7c1..c155b123bbb5 100644 --- a/qadevOOo/tests/java/mod/_sd/SdUnoOutlineView.java +++ b/qadevOOo/tests/java/mod/_sd/SdUnoOutlineView.java @@ -20,7 +20,6 @@ package mod._sd; import java.io.PrintWriter; -import lib.StatusException; import lib.TestCase; import lib.TestEnvironment; import lib.TestParameters; @@ -127,21 +126,16 @@ public class SdUnoOutlineView extends TestCase { */ @Override protected synchronized TestEnvironment createTestEnvironment - (TestParameters Param, PrintWriter log) { + (TestParameters Param, PrintWriter log) throws Exception { log.println( "creating a test environment" ); // get a soffice factory object SOfficeFactory SOF = SOfficeFactory.getFactory( Param.getMSF()); - try { - log.println( "creating a impress document" ); - xImpressDoc = SOF.createImpressDoc(null); - util.utils.pause(5000); - } catch (com.sun.star.uno.Exception e) { - e.printStackTrace( log ); - throw new StatusException("Couldn't create document", e); - } + log.println( "creating a impress document" ); + xImpressDoc = SOF.createImpressDoc(null); + util.utils.pause(5000); XDrawPagesSupplier oDPS = UnoRuntime.queryInterface(XDrawPagesSupplier.class, xImpressDoc); XDrawPages the_pages = oDPS.getDrawPages(); @@ -156,7 +150,7 @@ public class SdUnoOutlineView extends TestCase { String aSlotID = "slot:27010"; XDispatchProvider xDispProv = UnoRuntime.queryInterface( XDispatchProvider.class, oObj ); XURLTransformer xParser = UnoRuntime.queryInterface(XURLTransformer.class, - Param.getMSF().createInstance("com.sun.star.util.URLTransformer")); + Param.getMSF().createInstance("com.sun.star.util.URLTransformer")); // Because it's an in/out parameter we must use an array of URL objects. URL[] aParseURL = new URL[1]; aParseURL[0] = new URL(); @@ -170,14 +164,9 @@ public class SdUnoOutlineView extends TestCase { log.println("Couldn't change mode"); } - try { - log.println( "creating a second impress document" ); - xSecondDrawDoc = SOF.createImpressDoc(null); - util.utils.pause(5000); - } catch (com.sun.star.uno.Exception e) { - e.printStackTrace( log ); - throw new StatusException("Couldn't create document", e); - } + log.println( "creating a second impress document" ); + xSecondDrawDoc = SOF.createImpressDoc(null); + util.utils.pause(5000); XModel aModel2 = UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc); |