summaryrefslogtreecommitdiff
path: root/qadevOOo/tests/java/mod/_dtrans
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/_dtrans
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/_dtrans')
-rw-r--r--qadevOOo/tests/java/mod/_dtrans/generic.java27
1 files changed, 9 insertions, 18 deletions
diff --git a/qadevOOo/tests/java/mod/_dtrans/generic.java b/qadevOOo/tests/java/mod/_dtrans/generic.java
index 1d5d26bf190c..a14d3a04acc8 100644
--- a/qadevOOo/tests/java/mod/_dtrans/generic.java
+++ b/qadevOOo/tests/java/mod/_dtrans/generic.java
@@ -20,7 +20,6 @@ package mod._dtrans;
import java.io.PrintWriter;
-import lib.StatusException;
import lib.TestCase;
import lib.TestEnvironment;
import lib.TestParameters;
@@ -30,7 +29,8 @@ import com.sun.star.uno.XInterface;
/**
* Test for object which is represented by service
- * <code>com.sun.star.comp.datatransfer.generic</code>. <p>
+ * <code>com.sun.star.comp.datatransfer.generic</code>.
+ * <p>
*/
public class generic extends TestCase {
@@ -40,30 +40,21 @@ public class generic extends TestCase {
* <code>com.sun.star.comp.datatransfer.generic</code>.
*/
@Override
- protected synchronized TestEnvironment createTestEnvironment
- (TestParameters Param, PrintWriter log) {
+ protected synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws Exception {
XMultiServiceFactory xMSF = Param.getMSF();
- XInterface oObj = null;
-
- try {
- oObj = (XInterface) xMSF.createInstance
- ("com.sun.star.datatransfer.clipboard.GenericClipboard");
- } catch (com.sun.star.uno.Exception e) {
- e.printStackTrace(log);
- throw new StatusException("Unexpected exception", e);
- }
+ XInterface oObj = (XInterface) xMSF
+ .createInstance("com.sun.star.datatransfer.clipboard.GenericClipboard");
if (oObj == null) {
- log.println("[ERROR!] System type is *nix, unable to create object...");
- }
+ log.println("[ERROR!] System type is *nix, unable to create object...");
+ }
String Iname = util.utils.getImplName(oObj);
- log.println("Implementation Name: "+Iname);
+ log.println("Implementation Name: " + Iname);
TestEnvironment tEnv = new TestEnvironment(oObj);
return tEnv;
}
-
}
-