summaryrefslogtreecommitdiff
path: root/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeaderArea.java
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-06-09 08:52:12 +0200
committerNoel Grandin <noel@peralex.com>2015-06-09 11:34:31 +0200
commit2a0dda3dfb37f0cb69842f7d569c253d82f53713 (patch)
tree7a762c2fa22651cefb68021250a3fad8811e0f06 /qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeaderArea.java
parent60f8dd78fa3f19e8bed867f7f5926fcf9a8d8e67 (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/_sc/ScAccessiblePageHeaderArea.java')
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeaderArea.java47
1 files changed, 19 insertions, 28 deletions
diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeaderArea.java b/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeaderArea.java
index 2118c7ad1d78..1fcc985cacd2 100644
--- a/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeaderArea.java
+++ b/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeaderArea.java
@@ -20,7 +20,6 @@ package mod._sc;
import java.io.PrintWriter;
-import lib.Status;
import lib.StatusException;
import lib.TestCase;
import lib.TestEnvironment;
@@ -85,7 +84,7 @@ public class ScAccessiblePageHeaderArea extends TestCase {
*/
@Override
protected TestEnvironment createTestEnvironment(
- TestParameters Param, PrintWriter log) {
+ TestParameters Param, PrintWriter log) throws Exception {
XInterface oObj = null;
@@ -114,38 +113,30 @@ public class ScAccessiblePageHeaderArea extends TestCase {
XController xController = aModel.getCurrentController();
// switching to 'Page Preview' mode
- try {
- XDispatchProvider xDispProv = UnoRuntime.queryInterface(XDispatchProvider.class, xController);
- XURLTransformer xParser = UnoRuntime.queryInterface(XURLTransformer.class,
- 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();
- aParseURL[0].Complete = ".uno:PrintPreview";
- xParser.parseStrict(aParseURL);
- URL aURL = aParseURL[0];
- XDispatch xDispatcher = xDispProv.queryDispatch(aURL, "", 0);
- if(xDispatcher != null)
- xDispatcher.dispatch( aURL, null );
- } catch (com.sun.star.uno.Exception e) {
- throw new StatusException(e, Status.failed("Couldn't change mode"));
- }
+ XDispatchProvider xDispProv = UnoRuntime.queryInterface(XDispatchProvider.class, xController);
+ XURLTransformer xParser = UnoRuntime.queryInterface(XURLTransformer.class,
+ 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();
+ aParseURL[0].Complete = ".uno:PrintPreview";
+ xParser.parseStrict(aParseURL);
+ URL aURL = aParseURL[0];
+ XDispatch xDispatcher = xDispProv.queryDispatch(aURL, "", 0);
+ if(xDispatcher != null)
+ xDispatcher.dispatch( aURL, null );
util.utils.pause(500);
XWindow xWindow = AccessibilityTools.getCurrentContainerWindow(aModel);
XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow);
- try {
- oObj = AccessibilityTools.getAccessibleObjectForRole
- (xRoot, AccessibleRole.HEADER, "").getAccessibleChild(0);
- XAccessibleContext cont = UnoRuntime.queryInterface(XAccessibleContext.class, oObj);
- XAccessibleStateSet StateSet = cont.getAccessibleStateSet();
- if (StateSet.contains((short)27)) {
- log.println("Object is transient");
- }
- } catch (com.sun.star.lang.IndexOutOfBoundsException iabe) {
- throw new StatusException("Couldn't find needed Child",iabe);
+ oObj = AccessibilityTools.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.HEADER, "").getAccessibleChild(0);
+ XAccessibleContext cont = UnoRuntime.queryInterface(XAccessibleContext.class, oObj);
+ XAccessibleStateSet StateSet = cont.getAccessibleStateSet();
+ if (StateSet.contains((short)27)) {
+ log.println("Object is transient");
}
log.println("ImplementationName " + utils.getImplName(oObj));