summaryrefslogtreecommitdiff
path: root/vcl/qa
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-06-05 10:24:36 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-06-05 13:17:50 +0000
commit275f0c7b250d448a8e2658ee2f26d4010628237b (patch)
tree9537d17adfe0f098a27f84c0f0710b6ba2592aeb /vcl/qa
parent9eb1bfcbb164a8d029d7ba92947e0c9caf8e0826 (diff)
Let JUnit take care of exceptions
Inspired by commit 4dd0ac62855c5b9382cac004c7eebb9bed983a2b Change-Id: I6ca29aecde357a3cb5852acfc9b5443761052960 Reviewed-on: https://gerrit.libreoffice.org/16094 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'vcl/qa')
-rw-r--r--vcl/qa/complex/memCheck/CheckMemoryUsage.java14
-rw-r--r--vcl/qa/complex/persistent_window_states/PersistentWindowTest.java30
2 files changed, 7 insertions, 37 deletions
diff --git a/vcl/qa/complex/memCheck/CheckMemoryUsage.java b/vcl/qa/complex/memCheck/CheckMemoryUsage.java
index 4d9d56a30cc7..06d49dc89ce2 100644
--- a/vcl/qa/complex/memCheck/CheckMemoryUsage.java
+++ b/vcl/qa/complex/memCheck/CheckMemoryUsage.java
@@ -163,7 +163,7 @@ public class CheckMemoryUsage
* for each given document type.
*/
@Test
- public void loadAndSaveDocuments()
+ public void loadAndSaveDocuments() throws Exception
{
int nOk = 0;
int nRunThrough = 0;
@@ -248,7 +248,7 @@ public class CheckMemoryUsage
/**
* load and save exact one document
*/
- private void loadAndSaveNTimesDocument(String _sDocument, int _nCount, String _sStoreExtension)
+ private void loadAndSaveNTimesDocument(String _sDocument, int _nCount, String _sStoreExtension) throws Exception
{
System.out.println("Document: " + _sDocument);
XComponent xComponent = DesktopTools.loadDoc(getMSF(), _sDocument, null);
@@ -277,15 +277,7 @@ public class CheckMemoryUsage
}
// close the doc
XCloseable xCloseable = UnoRuntime.queryInterface(XCloseable.class, xStorable);
- try
- {
- xCloseable.close(true);
- }
- catch (com.sun.star.util.CloseVetoException e)
- {
- e.printStackTrace();
- fail("Cannot close document: test is futile, Office will surely use more space.");
- }
+ xCloseable.close(true);
}
else
{
diff --git a/vcl/qa/complex/persistent_window_states/PersistentWindowTest.java b/vcl/qa/complex/persistent_window_states/PersistentWindowTest.java
index 358e5620ebab..fd91beb4617d 100644
--- a/vcl/qa/complex/persistent_window_states/PersistentWindowTest.java
+++ b/vcl/qa/complex/persistent_window_states/PersistentWindowTest.java
@@ -282,37 +282,15 @@ public class PersistentWindowTest
return docHandle;
}
- private boolean connect()
+ private boolean connect() throws Exception
{
- try
- {
- connection.setUp();
- }
- catch (InterruptedException e)
- {
- fail("can't connect.");
- }
- catch (Exception e)
- {
- fail("can't connect.");
- }
+ connection.setUp();
return true;
}
- private boolean disconnect()
+ private boolean disconnect() throws Exception
{
- try
- {
- connection.tearDown();
- }
- catch (InterruptedException e)
- {
- fail("can't disconnect.");
- }
- catch (Exception e)
- {
- fail("can't disconnect.");
- }
+ connection.tearDown();
return true;
}