diff options
author | Noel Grandin <noel@peralex.com> | 2015-06-09 10:39:00 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-06-09 13:10:42 +0200 |
commit | 0f2007b11b4a0b39bc4e67ade30961f0d533474a (patch) | |
tree | 035698ef3355f9ba17b2844b29ad592fe469dcfc /ucb/qa/complex | |
parent | cc190ef25fb31325b1d3e0dd050e32feef567543 (diff) |
more exception handling cleanup in Java unit tests
Change-Id: I8a826c1b31f99e8d1592f284094ff921ddac74ad
Diffstat (limited to 'ucb/qa/complex')
-rw-r--r-- | ucb/qa/complex/tdoc/CheckContentProvider.java | 12 | ||||
-rw-r--r-- | ucb/qa/complex/tdoc/_XCommandProcessor.java | 16 |
2 files changed, 10 insertions, 18 deletions
diff --git a/ucb/qa/complex/tdoc/CheckContentProvider.java b/ucb/qa/complex/tdoc/CheckContentProvider.java index a802d30ac81b..09a2576e5466 100644 --- a/ucb/qa/complex/tdoc/CheckContentProvider.java +++ b/ucb/qa/complex/tdoc/CheckContentProvider.java @@ -33,6 +33,7 @@ import com.sun.star.ucb.XContentIdentifier; import com.sun.star.ucb.XContentIdentifierFactory; import com.sun.star.ucb.XContentProvider; import com.sun.star.uno.UnoRuntime; + import util.WriterTools; import org.junit.After; @@ -41,6 +42,7 @@ import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import org.openoffice.test.OfficeConnection; + import static org.junit.Assert.*; /** @@ -145,7 +147,7 @@ public class CheckContentProvider { /** * Check the interfaces of the root. */ - @Test public void checkTDOCRootInterfaces() { + @Test public void checkTDOCRootInterfaces() throws Exception { checkInterfaces(false); } @@ -179,7 +181,7 @@ public class CheckContentProvider { /** * Check the interfaces on the document. */ - @Test public void checkTDOCDocumentInterfaces() { + @Test public void checkTDOCDocumentInterfaces() throws Exception { checkInterfaces(true); } @@ -214,7 +216,7 @@ public class CheckContentProvider { /** * Check the interfaces on the folder. */ - @Test public void checkTDOCFolderInterfaces() { + @Test public void checkTDOCFolderInterfaces() throws Exception { checkInterfaces(true); } @@ -249,7 +251,7 @@ public class CheckContentProvider { /** * Check the interfaces on the stream. */ - @Test public void checkTDOCStreamInterfaces() { + @Test public void checkTDOCStreamInterfaces() throws Exception { checkInterfaces(true); } @@ -272,7 +274,7 @@ public class CheckContentProvider { * @param hasParent True, if the tested content type does have a parent: * only the root has not. Used in the XChild interface test. */ - private void checkInterfaces(boolean hasParent) { + private void checkInterfaces(boolean hasParent) throws Exception { // check the XTypeProvider interface _XTypeProvider xTypeProvider = new _XTypeProvider(); _XTypeProvider.oObj = UnoRuntime.queryInterface(XTypeProvider.class, xContent); diff --git a/ucb/qa/complex/tdoc/_XCommandProcessor.java b/ucb/qa/complex/tdoc/_XCommandProcessor.java index 396822cb2342..d9425dcd9d54 100644 --- a/ucb/qa/complex/tdoc/_XCommandProcessor.java +++ b/ucb/qa/complex/tdoc/_XCommandProcessor.java @@ -108,13 +108,13 @@ public class _XCommandProcessor { /** * First executes 'geCommandInfo' command and examines returned - * command info information. Second tries to execute inproper + * command info information. Second tries to execute in proper * command. <p> * Has <b> OK </b> status if in the first case returned information * contains info about 'getCommandInfo' command and in the second * case an exception is thrown. <p> */ - public boolean _execute() { + public boolean _execute() throws Exception { String[]commands = new String[] {"getCommandInfo", "getPropertySetInfo"}; boolean returnVal = true; for (int j=0; j<commands.length; j++) { @@ -124,17 +124,7 @@ public class _XCommandProcessor { Object result; log.println("executing command " + commandName); - try { - result = oObj.execute(command, 0, null); - } catch (CommandAbortedException e) { - log.println("The command aborted " + e.getMessage()); - e.printStackTrace((java.io.PrintWriter)log); - throw new StatusException("Unexpected exception", e); - } catch (Exception e) { - log.println("Unexpected exception " + e.getMessage()); - e.printStackTrace((java.io.PrintWriter)log); - throw new StatusException("Unexpected exception", e); - } + result = oObj.execute(command, 0, null); boolean found = false; |