/offapi/com/sun/star/form/submission/

/a>
LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
path: root/qadevOOo/tests/java/mod/_sw
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/_sw
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/_sw')
-rw-r--r--qadevOOo/tests/java/mod/_sw/CharacterStyle.java86
-rw-r--r--qadevOOo/tests/java/mod/_sw/ConditionalParagraphStyle.java88
-rw-r--r--qadevOOo/tests/java/mod/_sw/PageStyle.java91
-rw-r--r--qadevOOo/tests/java/mod/_sw/ParagraphStyle.java90
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentPageView.java65
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentView.java34
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwAccessibleEndnoteView.java39
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwAccessibleFooterView.java55
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwAccessibleFootnoteView.java39
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwAccessibleHeaderView.java39
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwAccessiblePageView.java112
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwAccessibleTableCellView.java9
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwAccessibleTableView.java9
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwAccessibleTextFrameView.java30
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwAccessibleTextGraphicObject.java8
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXAutoTextContainer.java18
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXAutoTextEntry.java23
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXAutoTextGroup.java37
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXCellRange.java20
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXDocumentIndex.java19
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXDocumentIndexMark.java8
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXDocumentIndexes.java19
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXEndnoteProperties.java18
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXFieldEnumeration.java9
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXFootnote.java20
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXFootnoteProperties.java18
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXFootnoteText.java18
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXFootnotes.java18
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXFrames.java22
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXHeadFootText.java49
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXMailMerge.java129
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXModule.java24
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXParagraph.java81
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXPrintSettings.java12
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXPropertySet.java12
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXPropertySetInfo.java12
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXReferenceMark.java22
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXReferenceMarks.java34
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXStyle.java88
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXStyleFamily.java17
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTableCellText.java8
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTableColumns.java8
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTableRows.java8
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextDefaults.java10
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextDocument.java275
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextEmbeddedObject.java20
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextFrame.java66
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextFrameText.java87
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextGraphicObject.java222
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextGraphicObjects.java121
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextPortion.java108
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextPortionEnumeration.java98
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextSection.java12
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextSections.java30
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextTable.java8
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextTables.java31
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextView.java65
-rw-r--r--qadevOOo/tests/java/mod/_sw/XMLContentExporter.java29
-rw-r--r--qadevOOo/tests/java/mod/_sw/XMLContentImporter.java11
-rw-r--r--qadevOOo/tests/java/mod/_sw/XMLExporter.java25
-rw-r--r--qadevOOo/tests/java/mod/_sw/XMLImporter.java17
-rw-r--r--qadevOOo/tests/java/mod/_sw/XMLMetaExporter.java31
-rw-r--r--qadevOOo/tests/java/mod/_sw/XMLMetaImporter.java11
-rw-r--r--qadevOOo/tests/java/mod/_sw/XMLSettingsExporter.java34
-rw-r--r--qadevOOo/tests/java/mod/_sw/XMLSettingsImporter.java13
-rw-r--r--qadevOOo/tests/java/mod/_sw/XMLStylesExporter.java26
-rw-r--r--qadevOOo/tests/java/mod/_sw/XMLStylesImporter.java12
67 files changed, 963 insertions, 1964 deletions
diff --git a/qadevOOo/tests/java/mod/_sw/CharacterStyle.java b/qadevOOo/tests/java/mod/_sw/CharacterStyle.java
index d74b2d0e62e8..34271e7b2b1c 100644
--- a/qadevOOo/tests/java/mod/_sw/CharacterStyle.java
+++ b/qadevOOo/tests/java/mod/_sw/CharacterStyle.java
@@ -31,7 +31,9 @@ import com.sun.star.text.XTextCursor;
import com.sun.star.text.XTextDocument;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XInterface;
+
import java.io.PrintWriter;
+
import lib.StatusException;
import lib.TestCase;
import lib.TestEnvironment;
@@ -92,7 +94,7 @@ public class CharacterStyle extends TestCase {
* </ul>
*/
@Override
- protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) throws Exception {
TestEnvironment tEnv = null;
XNameAccess oSFNA = null;
@@ -101,38 +103,22 @@ public class CharacterStyle extends TestCase {
log.println("creating a test environment");
- try {
- log.println("getting style");
- XStyleFamiliesSupplier oSFS = UnoRuntime.queryInterface(XStyleFamiliesSupplier.class,
- xTextDoc);
- XNameAccess oSF = oSFS.getStyleFamilies();
- XIndexAccess oSFsIA = UnoRuntime.queryInterface(XIndexAccess.class, oSF);
- oSFNA = UnoRuntime.queryInterface(
- XNameAccess.class,oSFsIA.getByIndex(0));
- XIndexAccess oSFIA = UnoRuntime.queryInterface(XIndexAccess.class, oSFNA);
- oStyle = UnoRuntime.queryInterface(
- XStyle.class,oSFIA.getByIndex(0));
- } catch ( com.sun.star.lang.WrappedTargetException e ) {
- log.println("Error: exception occurred.");
- e.printStackTrace(log);
- throw new StatusException( "Couldn't create environment ", e );
- } catch ( com.sun.star.lang.IndexOutOfBoundsException e ) {
- log.println("Error: exception occurred.");
- e.printStackTrace(log);
- throw new StatusException( "Couldn't create environment ", e );
- }
+ log.println("getting style");
+ XStyleFamiliesSupplier oSFS = UnoRuntime.queryInterface(XStyleFamiliesSupplier.class,
+ xTextDoc);
+ XNameAccess oSF = oSFS.getStyleFamilies();
+ XIndexAccess oSFsIA = UnoRuntime.queryInterface(XIndexAccess.class, oSF);
+ oSFNA = UnoRuntime.queryInterface(
+ XNameAccess.class,oSFsIA.getByIndex(0));
+ XIndexAccess oSFIA = UnoRuntime.queryInterface(XIndexAccess.class, oSFNA);
+ oStyle = UnoRuntime.queryInterface(
+ XStyle.class,oSFIA.getByIndex(0));
- try {
- log.print("Creating a user-defined style... ");
- XMultiServiceFactory oMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc);
- XInterface oInt = (XInterface)
- oMSF.createInstance("com.sun.star.style.CharacterStyle");
- oMyStyle = UnoRuntime.queryInterface(XStyle.class, oInt);
- } catch ( com.sun.star.uno.Exception e ) {
- log.println("Error: exception occurred.");
- e.printStackTrace(log);
- throw new StatusException( "Couldn't create environment ", e );
- }
+ log.print("Creating a user-defined style... ");
+ XMultiServiceFactory oMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc);
+ XInterface oInt = (XInterface)
+ oMSF.createInstance("com.sun.star.style.CharacterStyle");
+ oMyStyle = UnoRuntime.queryInterface(XStyle.class, oInt);
if (oMyStyle == null)
@@ -141,43 +127,15 @@ public class CharacterStyle extends TestCase {
log.println("OK");
XNameContainer oSFNC = UnoRuntime.queryInterface(XNameContainer.class, oSFNA);
- try {
- if ( oSFNC.hasByName("My Style") )
- oSFNC.removeByName("My Style");
- oSFNC.insertByName("My Style", oMyStyle);
- } catch ( com.sun.star.lang.WrappedTargetException e ) {
- e.printStackTrace(log);
- throw new StatusException( "Couldn't create environment ", e );
- } catch ( com.sun.star.lang.IllegalArgumentException e ) {
- e.printStackTrace(log);
- throw new StatusException( "Couldn't create environment ", e );
- } catch ( com.sun.star.container.NoSuchElementException e ) {
- e.printStackTrace(log);
- throw new StatusException( "Couldn't create environment ", e );
- } catch ( com.sun.star.container.ElementExistException e ) {
- e.printStackTrace(log);
- throw new StatusException( "Couldn't create environment ", e );
- }
+ if ( oSFNC.hasByName("My Style") )
+ oSFNC.removeByName("My Style");
+ oSFNC.insertByName("My Style", oMyStyle);
XText oText = xTextDoc.getText();
XTextCursor oCursor = oText.createTextCursor();
XPropertySet xProp = UnoRuntime.queryInterface(XPropertySet.class, oCursor);
- try {
- xProp.setPropertyValue("CharStyleName", oMyStyle.getName());
- } catch ( com.sun.star.lang.WrappedTargetException e ) {
- e.printStackTrace( log );
- throw new StatusException( "Couldn't create environment ", e );
- } catch ( com.sun.star.lang.IllegalArgumentException e ) {
- e.printStackTrace( log );
- throw new StatusException( "Couldn't create environment ", e );
- } catch ( com.sun.star.beans.PropertyVetoException e ) {
- e.printStackTrace( log );
- throw new StatusException( "Couldn't create environment ", e );
- } catch ( com.sun.star.beans.UnknownPropertyException e ) {
- e.printStackTrace( log );
- throw new StatusException( "Couldn't create environment ", e );
- }
+ xProp.setPropertyValue("CharStyleName", oMyStyle.getName());
log.println("creating a new environment for object");
tEnv = new TestEnvironment(oMyStyle);
diff --git a/qadevOOo/tests/java/mod/_sw/ConditionalParagraphStyle.java b/qadevOOo/tests/java/mod/_sw/ConditionalParagraphStyle.java
index ee7f2f4e4d27..6c98dfd16f8c 100644
--- a/qadevOOo/tests/java/mod/_sw/ConditionalParagraphStyle.java
+++ b/qadevOOo/tests/java/mod/_sw/ConditionalParagraphStyle.java
@@ -30,7 +30,9 @@ import com.sun.star.text.XTextCursor;
import com.sun.star.text.XTextDocument;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XInterface;
+
import java.io.PrintWriter;
+
import lib.Status;
import lib.StatusException;
import lib.TestCase;
@@ -82,7 +84,7 @@ public class ConditionalParagraphStyle extends TestCase {
* @param log The log writer.
*/
@Override
- protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) throws Exception {
TestEnvironment tEnv = null;
XNameAccess oSFNA = null;
XStyle oStyle = null;
@@ -90,41 +92,21 @@ public class ConditionalParagraphStyle extends TestCase {
log.println("creating a test environment");
- try {
- log.println("getting style");
- XStyleFamiliesSupplier oSFS = UnoRuntime.queryInterface(XStyleFamiliesSupplier.class,
- xTextDoc);
- XNameAccess oSF = oSFS.getStyleFamilies();
- oSFNA = UnoRuntime.queryInterface(
- XNameAccess.class,oSF.getByName("ParagraphStyles"));
- XIndexAccess oSFIA = UnoRuntime.queryInterface(XIndexAccess.class, oSFNA);
- oStyle = UnoRuntime.queryInterface(
- XStyle.class,oSFIA.getByIndex(1));
- } catch ( com.sun.star.lang.WrappedTargetException e ) {
- log.println("Error: exception occurred.");
- e.printStackTrace(log);
- throw new StatusException( "Couldn't create environment ", e );
- } catch ( com.sun.star.lang.IndexOutOfBoundsException e ) {
- log.println("Error: exception occurred.");
- e.printStackTrace(log);
- throw new StatusException( "Couldn't create environment ", e );
- } catch ( com.sun.star.container.NoSuchElementException e ) {
- log.println("Error: exception occurred.");
- e.printStackTrace(log);
- throw new StatusException( "Couldn't create environment ", e );
- }
+ log.println("getting style");
+ XStyleFamiliesSupplier oSFS = UnoRuntime.queryInterface(XStyleFamiliesSupplier.class,
+ xTextDoc);
+ XNameAccess oSF = oSFS.getStyleFamilies();
+ oSFNA = UnoRuntime.queryInterface(
+ XNameAccess.class,oSF.getByName("ParagraphStyles"));
+ XIndexAccess oSFIA = UnoRuntime.queryInterface(XIndexAccess.class, oSFNA);
+ oStyle = UnoRuntime.queryInterface(
+ XStyle.class,oSFIA.getByIndex(1));
- try {
- log.print("Creating a user-defined style... ");
- XMultiServiceFactory oMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc);
- XInterface oInt = (XInterface)
- oMSF.createInstance("com.sun.star.style.ConditionalParagraphStyle");
- oMyStyle = UnoRuntime.queryInterface(XStyle.class, oInt);
- } catch ( com.sun.star.uno.Exception e ) {
- log.println("Error: exception occurred.");
- e.printStackTrace(log);
- throw new StatusException( "Couldn't create environment ", e );
- }
+ log.print("Creating a user-defined style... ");
+ XMultiServiceFactory oMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc);
+ XInterface oInt = (XInterface)
+ oMSF.createInstance("com.sun.star.style.ConditionalParagraphStyle");
+ oMyStyle = UnoRuntime.queryInterface(XStyle.class, oInt);
if (oMyStyle == null) {
@@ -137,42 +119,14 @@ public class ConditionalParagraphStyle extends TestCase {
XNameContainer oSFNC = UnoRuntime.queryInterface(XNameContainer.class, oSFNA);
- try {
- if ( oSFNC.hasByName("My Style") )
- oSFNC.removeByName("My Style");
- oSFNC.insertByName("My Style", oMyStyle);
- } catch ( com.sun.star.lang.WrappedTargetException e ) {
- e.printStackTrace(log);
- throw new StatusException( "Couldn't create environment ", e );
- } catch ( com.sun.star.lang.IllegalArgumentException e ) {
- e.printStackTrace(log);
- throw new StatusException( "Couldn't create environment ", e );
- } catch ( com.sun.star.container.NoSuchElementException e ) {
- e.printStackTrace(log);
- throw new StatusException( "Couldn't create environment ", e );
- } catch ( com.sun.star.container.ElementExistException e ) {
- e.printStackTrace(log);
- throw new StatusException( "Couldn't create environment ", e );
- }
+ if ( oSFNC.hasByName("My Style") )
+ oSFNC.removeByName("My Style");
+ oSFNC.insertByName("My Style", oMyStyle);
XText oText = xTextDoc.getText();
XTextCursor oCursor = oText.createTextCursor();
XPropertySet xProp = UnoRuntime.queryInterface(XPropertySet.class, oCursor);
- try {
- xProp.setPropertyValue("ParaStyleName", oMyStyle.getName());
- } catch ( com.sun.star.lang.WrappedTargetException e ) {
- e.printStackTrace( log );
- throw new StatusException( "Couldn't create environment ", e );
- } catch ( com.sun.star.lang.IllegalArgumentException e ) {
- e.printStackTrace( log );
- throw new StatusException( "Couldn't create environment ", e );
- } catch ( com.sun.star.beans.PropertyVetoException e ) {
- e.printStackTrace( log );
- throw new StatusException( "Couldn't create environment ", e );
- } catch ( com.sun.star.beans.UnknownPropertyException e ) {
- e.printStackTrace( log );
- throw new StatusException( "Couldn't create environment ", e );
- }
+ xProp.setPropertyValue("ParaStyleName", oMyStyle.getName());
log.println("creating a new environment for object");
tEnv = new TestEnvironment(oMyStyle);
diff --git a/qadevOOo/tests/java/mod/_sw/PageStyle.java b/qadevOOo/tests/java/mod/_sw/PageStyle.java
index 1e989ecf5cbd..30b12f03baaf 100644
--- a/qadevOOo/tests/java/mod/_sw/PageStyle.java
+++ b/qadevOOo/tests/java/mod/_sw/PageStyle.java
@@ -31,7 +31,9 @@ import com.sun.star.text.XTextCursor;
import com.sun.star.text.XTextDocument;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XInterface;
+
import java.io.PrintWriter;
+
import lib.StatusException;
import lib.TestCase;
import lib.TestEnvironment;
@@ -75,7 +77,7 @@ public class PageStyle extends TestCase {
}
@Override
- protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) throws Exception {
TestEnvironment tEnv = null;
XNameAccess oSFNA = null;
XStyle oStyle = null;
@@ -83,43 +85,22 @@ public class PageStyle extends TestCase {
log.println("creating a test environment");
- try {
- log.println("getting style");
- XStyleFamiliesSupplier oSFS = UnoRuntime.queryInterface(XStyleFamiliesSupplier.class,
- xTextDoc);
- XNameAccess oSF = oSFS.getStyleFamilies();
- oSFNA = UnoRuntime.queryInterface(
- XNameAccess.class,oSF.getByName("PageStyles")); // get the page style
- XIndexAccess oSFIA = UnoRuntime.queryInterface(XIndexAccess.class, oSFNA);
- oStyle = UnoRuntime.queryInterface(
- XStyle.class,oSFIA.getByIndex(0));
- log.println("Chosen pool style: "+oStyle.getName());
-
- } catch ( com.sun.star.lang.WrappedTargetException e ) {
- log.println("Error: exception occurred.");
- e.printStackTrace(log);
- throw new StatusException( "Couldn't create environment ", e );
- } catch ( com.sun.star.lang.IndexOutOfBoundsException e ) {
- log.println("Error: exception occurred.");
- e.printStackTrace(log);
- throw new StatusException( "Couldn't create environment ", e );
- } catch ( com.sun.star.container.NoSuchElementException e ) {
- log.println("Error: exception occurred.");
- e.printStackTrace(log);
- throw new StatusException( "Couldn't create environment ", e );
- }
+ log.println("getting style");
+ XStyleFamiliesSupplier oSFS = UnoRuntime.queryInterface(XStyleFamiliesSupplier.class,
+ xTextDoc);
+ XNameAccess oSF = oSFS.getStyleFamilies();
+ oSFNA = UnoRuntime.queryInterface(
+ XNameAccess.class,oSF.getByName("PageStyles")); // get the page style
+ XIndexAccess oSFIA = UnoRuntime.queryInterface(XIndexAccess.class, oSFNA);
+ oStyle = UnoRuntime.queryInterface(
+ XStyle.class,oSFIA.getByIndex(0));
+ log.println("Chosen pool style: "+oStyle.getName());
- try {
- log.print("Creating a user-defined style... ");
- XMultiServiceFactory oMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc);
- XInterface oInt = (XInterface)
- oMSF.createInstance("com.sun.star.style.PageStyle");
- oMyStyle = UnoRuntime.queryInterface(XStyle.class, oInt);
- } catch ( com.sun.star.uno.Exception e ) {
- log.println("Error: exception occurred.");
- e.printStackTrace(log);
- throw new StatusException( "Couldn't create environment ", e );
- }
+ log.print("Creating a user-defined style... ");
+ XMultiServiceFactory oMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc);
+ XInterface oInt = (XInterface)
+ oMSF.createInstance("com.sun.star.style.PageStyle");
+ oMyStyle = UnoRuntime.queryInterface(XStyle.class, oInt);
if (oMyStyle == null)
@@ -130,23 +111,9 @@ public class PageStyle extends TestCase {
XNameContainer oSFNC = UnoRuntime.queryInterface(XNameContainer.class, oSFNA);
- try {
- if ( oSFNC.hasByName("My Style") )
- oSFNC.removeByName("My Style");
- oSFNC.insertByName("My Style", oMyStyle);
- } catch ( com.sun.star.lang.WrappedTargetException e ) {
- e.printStackTrace(log);
- throw new StatusException( "Couldn't create environment ", e );
- } catch ( com.sun.star.lang.IllegalArgumentException e ) {
- e.printStackTrace(log);
- throw new StatusException( "Couldn't create environment ", e );
- } catch ( com.sun.star.container.NoSuchElementException e ) {
- e.printStackTrace(log);
- throw new StatusException( "Couldn't create environment ", e );
- } catch ( com.sun.star.container.ElementExistException e ) {
- e.printStackTrace(log);
- throw new StatusException( "Couldn't create environment ", e );
- }
+ if ( oSFNC.hasByName("My Style") )
+ oSFNC.removeByName("My Style");
+ oSFNC.insertByName("My Style", oMyStyle);
XText oText = xTextDoc.getText();
XTextCursor oCursor = oText.createTextCursor();
@@ -154,21 +121,7 @@ public class PageStyle extends TestCase {
Property[] props = xProp.getPropertySetInfo().getProperties();
for (int i=0; i<props.length; i++)
System.out.println("# Property: " + props[i].Name + " val: " + props[i].Type.toString() + " attr: " + props[i].Attributes);
- try {
- xProp.setPropertyValue("PageDescName", oMyStyle.getName());
- } catch ( com.sun.star.lang.WrappedTargetException e ) {
- e.printStackTrace( log );
- throw new StatusException( "Couldn't create environment ", e );
- } catch ( com.sun.star.lang.IllegalArgumentException e ) {
- e.printStackTrace( log );
- throw new StatusException( "Couldn't create environment ", e );
- } catch ( com.sun.star.beans.PropertyVetoException e ) {
- e.printStackTrace( log );
- throw new StatusException( "Couldn't create environment ", e );
- } catch ( com.sun.star.beans.UnknownPropertyException e ) {
- e.printStackTrace( log );
- throw new StatusException( "Couldn't create environment ", e );
- }
+ xProp.setPropertyValue("PageDescName", oMyStyle.getName());
// oMyStyle = oStyle;
log.println("creating a new environment for object");
diff --git a/qadevOOo/tests/java/mod/_sw/ParagraphStyle.java b/qadevOOo/tests/java/mod/_sw/ParagraphStyle.java
index aad213a58d2c..5c4ca3b200cf 100644
--- a/qadevOOo/tests/java/mod/_sw/ParagraphStyle.java
+++ b/qadevOOo/tests/java/mod/_sw/ParagraphStyle.java
@@ -30,7 +30,9 @@ import com.sun.star.text.XTextCursor;
import com.sun.star.text.XTextDocument;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XInterface;
+
import java.io.PrintWriter;
+
import lib.StatusException;
import lib.TestCase;
import lib.TestEnvironment;
@@ -75,7 +77,7 @@ public class ParagraphStyle extends TestCase {
}
@Override
- protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) throws Exception {
TestEnvironment tEnv = null;
XNameAccess oSFNA = null;
XStyle oStyle = null;
@@ -83,42 +85,22 @@ public class ParagraphStyle extends TestCase {
log.println("creating a test environment");
- try {
- log.println("getting style");
- XStyleFamiliesSupplier oSFS = UnoRuntime.queryInterface(XStyleFamiliesSupplier.class,
- xTextDoc);
- XNameAccess oSF = oSFS.getStyleFamilies();
- oSFNA = UnoRuntime.queryInterface(
- XNameAccess.class,oSF.getByName("ParagraphStyles"));
- XIndexAccess oSFIA = UnoRuntime.queryInterface(XIndexAccess.class, oSFNA);
- oSFNA.getElementNames();
- oStyle = UnoRuntime.queryInterface(
- XStyle.class,oSFIA.getByIndex(1));
- } catch ( com.sun.star.lang.WrappedTargetException e ) {
- log.println("Error: exception occurred.");
- e.printStackTrace(log);
- throw new StatusException( "Couldn't create environment ", e );
- } catch ( com.sun.star.lang.IndexOutOfBoundsException e ) {
- log.println("Error: exception occurred.");
- e.printStackTrace(log);
- throw new StatusException( "Couldn't create environment ", e );
- } catch ( com.sun.star.container.NoSuchElementException e ) {
- log.println("Error: exception occurred.");
- e.printStackTrace(log);
- throw new StatusException( "Couldn't create environment ", e );
- }
+ log.println("getting style");
+ XStyleFamiliesSupplier oSFS = UnoRuntime.queryInterface(XStyleFamiliesSupplier.class,
+ xTextDoc);
+ XNameAccess oSF = oSFS.getStyleFamilies();
+ oSFNA = UnoRuntime.queryInterface(
+ XNameAccess.class,oSF.getByName("ParagraphStyles"));
+ XIndexAccess oSFIA = UnoRuntime.queryInterface(XIndexAccess.class, oSFNA);
+ oSFNA.getElementNames();
+ oStyle = UnoRuntime.queryInterface(
+ XStyle.class,oSFIA.getByIndex(1));
- try {
- log.print("Creating a user-defined style... ");
- XMultiServiceFactory oMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc);
- XInterface oInt = (XInterface)
- oMSF.createInstance("com.sun.star.style.ParagraphStyle");
- oMyStyle = UnoRuntime.queryInterface(XStyle.class, oInt);
- } catch ( com.sun.star.uno.Exception e ) {
- log.println("Error: exception occurred.");
- e.printStackTrace(log);
- throw new StatusException( "Couldn't create environment ", e );
- }
+ log.print("Creating a user-defined style... ");
+ XMultiServiceFactory oMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc);
+ XInterface oInt = (XInterface)
+ oMSF.createInstance("com.sun.star.style.ParagraphStyle");
+ oMyStyle = UnoRuntime.queryInterface(XStyle.class, oInt);
if (oMyStyle == null)
@@ -127,43 +109,15 @@ public class ParagraphStyle extends TestCase {
log.println("OK");
XNameContainer oSFNC = UnoRuntime.queryInterface(XNameContainer.class, oSFNA);
- try {
- if ( oSFNC.hasByName("My Style") )
- oSFNC.removeByName("My Style");
- oSFNC.insertByName("My Style", oMyStyle);
- } catch ( com.sun.star.lang.WrappedTargetException e ) {
- e.printStackTrace(log);
- throw new StatusException( "Couldn't create environment ", e );
- } catch ( com.sun.star.lang.IllegalArgumentException e ) {
- e.printStackTrace(log);
- throw new StatusException( "Couldn't create environment ", e );
- } catch ( com.sun.star.container.NoSuchElementException e ) {
- e.printStackTrace(log);
- throw new StatusException( "Couldn't create environment ", e );
- } catch ( com.sun.star.container.ElementExistException e ) {
- e.printStackTrace(log);
- throw new StatusException( "Couldn't create environment ", e );
- }
+ if ( oSFNC.hasByName("My Style") )
+ oSFNC.removeByName("My Style");
+ oSFNC.insertByName("My Style", oMyStyle);
XText oText = xTextDoc.getText();
XTextCursor oCursor = oText.createTextCursor();
XPropertySet xProp = UnoRuntime.queryInterface(XPropertySet.class, oCursor);
- try {
- xProp.setPropertyValue("ParaStyleName", oMyStyle.getName());
- } catch ( com.sun.star.lang.WrappedTargetException e ) {
- e.printStackTrace( log );
- throw new StatusException( "Couldn't create environment ", e );
- } catch ( com.sun.star.lang.IllegalArgumentException e ) {
- e.printStackTrace( log );
- throw new StatusException( "Couldn't create environment ", e );
- } catch ( com.sun.star.beans.PropertyVetoException e ) {
- e.printStackTrace( log );
- throw new StatusException( "Couldn't create environment ", e );
- } catch ( com.sun.star.beans.UnknownPropertyException e ) {
- e.printStackTrace( log );
- throw new StatusException( "Couldn't create environment ", e );
- }
+ xProp.setPropertyValue("ParaStyleName", oMyStyle.getName());
log.println("creating a new environment for object");
tEnv = new TestEnvironment(oMyStyle);
diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentPageView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentPageView.java
index 9348e86f041b..64c1dc7913d1 100644
--- a/qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentPageView.java
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentPageView.java
@@ -19,8 +19,6 @@ package mod._sw;
import java.io.PrintWriter;
-import lib.Status;
-import lib.StatusException;
import lib.TestCase;
import lib.TestEnvironment;
import lib.TestParameters;
@@ -62,7 +60,7 @@ public class SwAccessibleDocumentPageView extends TestCase {
*/
@Override
protected TestEnvironment createTestEnvironment(
- TestParameters Param, PrintWriter log) {
+ TestParameters Param, PrintWriter log) throws Exception{
XInterface oObj = null;
@@ -70,25 +68,20 @@ public class SwAccessibleDocumentPageView extends TestCase {
XTextCursor oCursor = oText.createTextCursor();
log.println( "inserting some lines" );
- try {
- for (int i=0; i<25; i++){
- oText.insertString( oCursor,"Paragraph Number: " + i, false);
- oText.insertString( oCursor,
- " The quick brown fox jumps over the lazy Dog: SwAccessibleDocumentPageView",
- false);
- oText.insertControlCharacter(
- oCursor, ControlCharacter.PARAGRAPH_BREAK, false );
- oText.insertString( oCursor,
- "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG: SwAccessibleDocumentPageView",
- false);
- oText.insertControlCharacter(oCursor,
- ControlCharacter.PARAGRAPH_BREAK, false );
- oText.insertControlCharacter(
- oCursor, ControlCharacter.LINE_BREAK, false );
- }
- } catch ( com.sun.star.lang.IllegalArgumentException e ){
- e.printStackTrace(log);
- throw new StatusException( "Couldn't insert lines", e );
+ for (int i=0; i<25; i++){
+ oText.insertString( oCursor,"Paragraph Number: " + i, false);
+ oText.insertString( oCursor,
+ " The quick brown fox jumps over the lazy Dog: SwAccessibleDocumentPageView",
+ false);
+ oText.insertControlCharacter(
+ oCursor, ControlCharacter.PARAGRAPH_BREAK, false );
+ oText.insertString( oCursor,
+ "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG: SwAccessibleDocumentPageView",
+ false);
+ oText.insertControlCharacter(oCursor,
+ ControlCharacter.PARAGRAPH_BREAK, false );
+ oText.insertControlCharacter(
+ oCursor, ControlCharacter.LINE_BREAK, false );
}
XController xController = xTextDoc.getCurrentController();
@@ -96,22 +89,18 @@ public class SwAccessibleDocumentPageView extends TestCase {
XModel aModel = UnoRuntime.queryInterface(XModel.class, xTextDoc);
//switch to 'Print 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(2000);
diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentView.java
index dcc6fc889427..5d62551fc91d 100644
--- a/qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentView.java
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentView.java
@@ -19,7 +19,6 @@ package mod._sw;
import java.io.PrintWriter;
-import lib.StatusException;
import lib.TestCase;
import lib.TestEnvironment;
import lib.TestParameters;
@@ -74,25 +73,20 @@ public class SwAccessibleDocumentView extends TestCase {
XTextCursor oCursor = oText.createTextCursor();
log.println( "inserting some lines" );
- try {
- for (int i=0; i<5; i++){
- oText.insertString( oCursor,"Paragraph Number: " + i, false);
- oText.insertString( oCursor,
- " The quick brown fox jumps over the lazy Dog: SwXParagraph",
- false);
- oText.insertControlCharacter(
- oCursor, ControlCharacter.PARAGRAPH_BREAK, false );
- oText.insertString( oCursor,
- "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG: SwXParagraph",
- false);
- oText.insertControlCharacter(oCursor,
- ControlCharacter.PARAGRAPH_BREAK, false );
- oText.insertControlCharacter(
- oCursor, ControlCharacter.LINE_BREAK, false );
- }
- } catch ( com.sun.star.lang.IllegalArgumentException e ){
- e.printStackTrace(log);
- throw new StatusException( "Couldn't insert lines", e );
+ for (int i=0; i<5; i++){
+ oText.insertString( oCursor,"Paragraph Number: " + i, false);
+ oText.insertString( oCursor,
+ " The quick brown fox jumps over the lazy Dog: SwXParagraph",
+ false);
+ oText.insertControlCharacter(
+ oCursor, ControlCharacter.PARAGRAPH_BREAK, false );
+ oText.insertString( oCursor,
+ "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG: SwXParagraph",
+ false);
+ oText.insertControlCharacter(oCursor,
+ ControlCharacter.PARAGRAPH_BREAK, false );
+ oText.insertControlCharacter(
+ oCursor, ControlCharacter.LINE_BREAK, false );
}
XModel aModel = UnoRuntime.queryInterface(XModel.class, xTextDoc);
diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleEndnoteView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleEndnoteView.java
index a1858786eb74..9b47147f4983 100644
--- a/qadevOOo/tests/java/mod/_sw/SwAccessibleEndnoteView.java
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleEndnoteView.java
@@ -19,7 +19,6 @@ package mod._sw;
import java.io.PrintWriter;
-import lib.StatusException;
import lib.TestCase;
import lib.TestEnvironment;
import lib.TestParameters;
@@ -61,7 +60,7 @@ public class SwAccessibleEndnoteView extends TestCase {
*/
@Override
protected TestEnvironment createTestEnvironment(
- TestParameters Param, PrintWriter log) {
+ TestParameters Param, PrintWriter log) throws Exception {
XInterface oObj = null;
XInterface oEndnote = null;
@@ -69,48 +68,24 @@ public class SwAccessibleEndnoteView extends TestCase {
log.println( "Creating a test environment" );
XMultiServiceFactory msf = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc);
log.println("creating a endnote");
- try {
- oEndnote = UnoRuntime.queryInterface(XInterface.class,
- msf.createInstance("com.sun.star.text.Endnote"));
- } catch (com.sun.star.uno.Exception e) {
- e.printStackTrace(log);
- throw new StatusException("Couldn't create endnote", e);
- }
+ oEndnote = UnoRuntime.queryInterface(XInterface.class,
+ msf.createInstance("com.sun.star.text.Endnote"));
XText oText = xTextDoc.getText();
XTextCursor oCursor = oText.createTextCursor();
log.println("inserting the footnote into text document");
XTextContent xTC = UnoRuntime.queryInterface(XTextContent.class, oEndnote);
- try {
- oText.insertTextContent(oCursor, xTC, false);
- } catch (com.sun.star.lang.IllegalArgumentException e) {
- e.printStackTrace(log);
- throw new StatusException("Couldn't insert the endnote", e);
- }
+ oText.insertTextContent(oCursor, xTC, false);
XController xController = xTextDoc.getCurrentController();
XViewSettingsSupplier xViewSetSup = UnoRuntime.queryInterface(XViewSettingsSupplier.class,
xController);
XPropertySet xPropSet = xViewSetSup.getViewSettings();
- try {
- //change zoom value to 10%
- //footer should be in the vissible area of the document
- xPropSet.setPropertyValue("ZoomValue", Short.valueOf("10"));
- } catch ( com.sun.star.lang.WrappedTargetException e ) {
- e.printStackTrace(log);
- throw new StatusException("Couldn't set propertyValue...", e);
- } catch ( com.sun.star.lang.IllegalArgumentException e ) {
- e.printStackTrace(log);
- throw new StatusException("Couldn't set propertyValue...", e);
- } catch ( com.sun.star.beans.PropertyVetoException e ) {
- e.printStackTrace(log);
- throw new StatusException("Couldn't set propertyValue...", e);
- } catch ( com.sun.star.beans.UnknownPropertyException e ) {
- e.printStackTrace(log);
- throw new StatusException("Couldn't set propertyValue...", e);
- }
+ //change zoom value to 10%
+ //footer should be in the vissible area of the document
+ xPropSet.setPropertyValue("ZoomValue", Short.valueOf("10"));
XModel aModel = UnoRuntime.queryInterface(XModel.class, xTextDoc);
diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleFooterView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleFooterView.java
index d48ea8c730b8..2e6e52d9efdf 100644
--- a/qadevOOo/tests/java/mod/_sw/SwAccessibleFooterView.java
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleFooterView.java
@@ -71,7 +71,7 @@ public class SwAccessibleFooterView extends TestCase {
*/
@Override
protected TestEnvironment createTestEnvironment(
- TestParameters Param, PrintWriter log) {
+ TestParameters Param, PrintWriter log) throws Exception {
XInterface oObj = null;
XNameAccess PageStyles = null;
@@ -81,49 +81,24 @@ public class SwAccessibleFooterView extends TestCase {
XNameAccess StyleFamNames = StyleFam.getStyleFamilies();
// obtains style 'Standard' from style family 'PageStyles'
- try {
- PageStyles = (XNameAccess) AnyConverter.toObject(
- new Type(XNameAccess.class),StyleFamNames.getByName("PageStyles"));
- StdStyle = (XStyle) AnyConverter.toObject(
- new Type(XStyle.class),PageStyles.getByName("Standard"));
- } catch ( com.sun.star.lang.WrappedTargetException e ) {
- e.printStackTrace(log);
- throw new StatusException("Error getting style by name!", e);
- } catch ( com.sun.star.container.NoSuchElementException e ) {
- e.printStackTrace(log);
- throw new StatusException("Error, no such style name! ", e);
- } catch ( com.sun.star.lang.IllegalArgumentException e ) {
- e.printStackTrace(log);
- throw new StatusException("Error getting style by name!", e);
- }
+ PageStyles = (XNameAccess) AnyConverter.toObject(
+ new Type(XNameAccess.class),StyleFamNames.getByName("PageStyles"));
+ StdStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),PageStyles.getByName("Standard"));
final XPropertySet PropSet = UnoRuntime.queryInterface( XPropertySet.class, StdStyle);
// changing/getting some properties
- try {
- log.println( "Switching on footer" );
- PropSet.setPropertyValue("FooterIsOn", Boolean.TRUE);
-
- //change zoom value to 10%
- //footer should be in the vissible area of the document
- XController xController = xTextDoc.getCurrentController();
- XViewSettingsSupplier xViewSetSup = UnoRuntime.queryInterface(XViewSettingsSupplier.class,
- xController);
- XPropertySet xPropSet = xViewSetSup.getViewSettings();
- xPropSet.setPropertyValue("ZoomValue", Short.valueOf("20"));
- } catch ( com.sun.star.lang.WrappedTargetException e ) {
- e.printStackTrace(log);
- throw new StatusException("Couldn't set propertyValue...", e);
- } catch ( com.sun.star.lang.IllegalArgumentException e ) {
- e.printStackTrace(log);
- throw new StatusException("Couldn't set propertyValue...", e);
- } catch ( com.sun.star.beans.PropertyVetoException e ) {
- e.printStackTrace(log);
- throw new StatusException("Couldn't set propertyValue...", e);
- } catch ( com.sun.star.beans.UnknownPropertyException e ) {
- e.printStackTrace(log);
- throw new StatusException("Couldn't set propertyValue...", e);
- }
+ log.println( "Switching on footer" );
+ PropSet.setPropertyValue("FooterIsOn", Boolean.TRUE);
+
+ //change zoom value to 10%
+ //footer should be in the vissible area of the document
+ XController xController = xTextDoc.getCurrentController();
+ XViewSettingsSupplier xViewSetSup = UnoRuntime.queryInterface(XViewSettingsSupplier.class,
+ xController);
+ XPropertySet xPropSet = xViewSetSup.getViewSettings();
+ xPropSet.setPropertyValue("ZoomValue", Short.valueOf("20"));
XModel aModel = UnoRuntime.queryInterface(XModel.class, xTextDoc);
diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleFootnoteView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleFootnoteView.java
index b487b62d196e..6a0319b11330 100644
--- a/qadevOOo/tests/java/mod/_sw/SwAccessibleFootnoteView.java
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleFootnoteView.java
@@ -19,7 +19,6 @@ package mod._sw;
import java.io.PrintWriter;
-import lib.StatusException;
import lib.TestCase;
import lib.TestEnvironment;
import lib.TestParameters;
@@ -61,7 +60,7 @@ public class SwAccessibleFootnoteView extends TestCase {
*/
@Override
protected TestEnvironment createTestEnvironment(
- TestParameters Param, PrintWriter log) {
+ TestParameters Param, PrintWriter log) throws Exception {
XInterface oObj = null;
XFootnote oFootnote = null;
@@ -71,47 +70,23 @@ public class SwAccessibleFootnoteView extends TestCase {
XMultiServiceFactory msf = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc);
log.println("creating a footnote");
- try {
- oFootnote = UnoRuntime.queryInterface(XFootnote.class,
- msf.createInstance("com.sun.star.text.Footnote"));
- } catch (com.sun.star.uno.Exception e) {
- e.printStackTrace(log);
- throw new StatusException("Couldn't create footnote", e);
- }
+ oFootnote = UnoRuntime.queryInterface(XFootnote.class,
+ msf.createInstance("com.sun.star.text.Footnote"));
XText oText = xTextDoc.getText();
XTextCursor oCursor = oText.createTextCursor();
log.println("inserting the footnote into text document");
- try {
- oText.insertTextContent(oCursor, oFootnote, false);
- } catch (com.sun.star.lang.IllegalArgumentException e) {
- e.printStackTrace(log);
- throw new StatusException("Couldn't insert the footnote", e);
- }
+ oText.insertTextContent(oCursor, oFootnote, false);
XController xController = xTextDoc.getCurrentController();
XViewSettingsSupplier xViewSetSup = UnoRuntime.queryInterface(XViewSettingsSupplier.class,
xController);
XPropertySet xPropSet = xViewSetSup.getViewSettings();
- try {
- //change zoom value to 10%
- //footer should be in the vissible area of the document
- xPropSet.setPropertyValue("ZoomValue", Short.valueOf("10"));
- } catch ( com.sun.star.lang.WrappedTargetException e ) {
- e.printStackTrace(log);
- throw new StatusException("Couldn't set propertyValue...", e);
- } catch ( com.sun.star.lang.IllegalArgumentException e ) {
- e.printStackTrace(log);
- throw new StatusException("Couldn't set propertyValue...", e);
- } catch ( com.sun.star.beans.PropertyVetoException e ) {
- e.printStackTrace(log);
- throw new StatusException("Couldn't set propertyValue...", e);
- } catch ( com.sun.star.beans.UnknownPropertyException e ) {
- e.printStackTrace(log);
- throw new StatusException("Couldn't set propertyValue...", e);
- }
+ //change zoom value to 10%
+ //footer should be in the vissible area of the document
+ xPropSet.setPropertyValue("ZoomValue", Short.valueOf("10"));
XModel aModel = UnoRuntime.queryInterface(XModel.class, xTextDoc);
diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleHeaderView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleHeaderView.java
index b3a8297a4172..7353251f3881 100644
--- a/qadevOOo/tests/java/mod/_sw/SwAccessibleHeaderView.java
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleHeaderView.java
@@ -69,7 +69,7 @@ public class SwAccessibleHeaderView extends TestCase {
*/
@Override
protected TestEnvironment createTestEnvironment(
- TestParameters Param, PrintWriter log) {
+ TestParameters Param, PrintWriter log) throws Exception {
XInterface oObj = null;
XNameAccess PageStyles = null;
@@ -79,41 +79,16 @@ public class SwAccessibleHeaderView extends TestCase {
XNameAccess StyleFamNames = StyleFam.getStyleFamilies();
// obtains style 'Standatd' from style family 'PageStyles'
- try {
- PageStyles = (XNameAccess) AnyConverter.toObject(
- new Type(XNameAccess.class),StyleFamNames.getByName("PageStyles"));
- StdStyle = (XStyle) AnyConverter.toObject(
- new Type(XStyle.class),PageStyles.getByName("Standard"));
- } catch ( com.sun.star.lang.WrappedTargetException e ) {
- e.printStackTrace(log);
- throw new StatusException("Error getting style by name!", e);
- } catch ( com.sun.star.container.NoSuchElementException e ) {
- e.printStackTrace(log);
- throw new StatusException("Error, no such style name! ", e);
- } catch ( com.sun.star.lang.IllegalArgumentException e ) {
- e.printStackTrace(log);
- throw new StatusException("Error getting style by name!", e);
- }
+ PageStyles = (XNameAccess) AnyConverter.toObject(
+ new Type(XNameAccess.class),StyleFamNames.getByName("PageStyles"));
+ StdStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),PageStyles.getByName("Standard"));
final XPropertySet PropSet = UnoRuntime.queryInterface( XPropertySet.class, StdStyle);
// changing/getting some properties
- try {
- log.println( "Switching on header" );
- PropSet.setPropertyValue("HeaderIsOn", Boolean.TRUE);
- } catch ( com.sun.star.lang.WrappedTargetException e ) {
- e.printStackTrace(log);
- throw new StatusException("Couldn't set propertyValue...", e);
- } catch ( com.sun.star.lang.IllegalArgumentException e ) {
- e.printStackTrace(log);
- throw new StatusException("Couldn't set propertyValue...", e);
- } catch ( com.sun.star.beans.PropertyVetoException e ) {
- e.printStackTrace(log);
- throw new StatusException("Couldn't set propertyValue...", e);
- } catch ( com.sun.star.beans.UnknownPropertyException e ) {
- e.printStackTrace(log);
- throw new StatusException("Couldn't set propertyValue...", e);
- }
+ log.println( "Switching on header" );
+ PropSet.setPropertyValue("HeaderIsOn", Boolean.TRUE);
XModel aModel = UnoRuntime.queryInterface(XModel.class, xTextDoc);
diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessiblePageView.java b/qadevOOo/tests/java/mod/_sw/SwAccessiblePageView.java
index 84fa8139cf68..b15621045c19 100644
--- a/qadevOOo/tests/java/mod/_sw/SwAccessiblePageView.java
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessiblePageView.java
@@ -19,8 +19,6 @@ package mod._sw;
import java.io.PrintWriter;
-import lib.Status;
-import lib.StatusException;
import lib.TestCase;
import lib.TestEnvironment;
import lib.TestParameters;
@@ -69,7 +67,7 @@ public class SwAccessiblePageView extends TestCase {
*/
@Override
protected TestEnvironment createTestEnvironment(
- TestParameters Param, PrintWriter log) {
+ TestParameters Param, PrintWriter log) throws Exception {
XInterface oObj = null;
XInterface port = null;
@@ -79,70 +77,36 @@ public class SwAccessiblePageView extends TestCase {
XTextCursor oCursor = oText.createTextCursor();
log.println( "inserting some lines" );
- try {
- for (int i=0; i<2; i++){
- oText.insertString( oCursor,"Paragraph Number: " + i, false);
- oText.insertString( oCursor,
- " The quick brown fox jumps over the lazy Dog: SwXParagraph",
- false);
- oText.insertControlCharacter(
- oCursor, ControlCharacter.PARAGRAPH_BREAK, false );
- oText.insertString( oCursor,
- "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG: SwXParagraph",
- false);
- oText.insertControlCharacter(oCursor,
- ControlCharacter.PARAGRAPH_BREAK, false );
- oText.insertControlCharacter(
- oCursor, ControlCharacter.LINE_BREAK, false );
- }
- } catch ( com.sun.star.lang.IllegalArgumentException e ){
- e.printStackTrace(log);
- throw new StatusException( "Couldn't insert lines", e );
+ for (int i=0; i<2; i++){
+ oText.insertString( oCursor,"Paragraph Number: " + i, false);
+ oText.insertString( oCursor,
+ " The quick brown fox jumps over the lazy Dog: SwXParagraph",
+ false);
+ oText.insertControlCharacter(
+ oCursor, ControlCharacter.PARAGRAPH_BREAK, false );
+ oText.insertString( oCursor,
+ "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG: SwXParagraph",
+ false);
+ oText.insertControlCharacter(oCursor,
+ ControlCharacter.PARAGRAPH_BREAK, false );
+ oText.insertControlCharacter(
+ oCursor, ControlCharacter.LINE_BREAK, false );
}
// Enumeration
XEnumerationAccess oEnumA = UnoRuntime.queryInterface(XEnumerationAccess.class, oText );
XEnumeration oEnum = oEnumA.createEnumeration();
- try {
- para = (XInterface) AnyConverter.toObject(
- new Type(XInterface.class),oEnum.nextElement());
- XEnumerationAccess oEnumB = UnoRuntime.queryInterface( XEnumerationAccess.class, para );
- XEnumeration oEnum2 = oEnumB.createEnumeration();
- port = (XInterface) AnyConverter.toObject(
- new Type(XInterface.class),oEnum2.nextElement());
- } catch ( com.sun.star.lang.WrappedTargetException e ) {
- e.printStackTrace(log);
- log.println("Error: exception occurred...");
- } catch ( com.sun.star.container.NoSuchElementException e ) {
- e.printStackTrace(log);
- log.println("Error: exception occurred...");
- } catch ( com.sun.star.lang.IllegalArgumentException e ) {
- e.printStackTrace(log);
- log.println("Error: exception occurred...");
- }
+ para = (XInterface) AnyConverter.toObject(
+ new Type(XInterface.class),oEnum.nextElement());
+ XEnumerationAccess oEnumB = UnoRuntime.queryInterface( XEnumerationAccess.class, para );
+ XEnumeration oEnum2 = oEnumB.createEnumeration();
+ port = (XInterface) AnyConverter.toObject(
+ new Type(XInterface.class),oEnum2.nextElement());
- try {
- UnoRuntime.queryInterface(XPropertySet.class, port);
- paraP = UnoRuntime.queryInterface(XPropertySet.class, para);
- paraP.setPropertyValue("BreakType",com.sun.star.style.BreakType.PAGE_AFTER);
- } catch ( com.sun.star.lang.WrappedTargetException e ) {
- log.println("Error, exception occurred...");
- e.printStackTrace(log);
- throw new StatusException( "Couldn't get Paragraph", e );
- } catch ( com.sun.star.lang.IllegalArgumentException e ) {
- log.println("Error, exception occurred...");
- e.printStackTrace(log);
- throw new StatusException( "Couldn't get Paragraph", e );
- } catch ( com.sun.star.beans.UnknownPropertyException e ) {
- log.println("Error, exception occurred...");
- e.printStackTrace(log);
- throw new StatusException( "Couldn't get Paragraph", e );
- } catch ( com.sun.star.beans.PropertyVetoException e ) {
- log.println("Error, exception occurred...");
- e.printStackTrace(log);
- throw new StatusException( "Couldn't get Paragraph", e );
- }
+ UnoRuntime.queryInterface(XPropertySet.class, port);
+ paraP = UnoRuntime.queryInterface(XPropertySet.class, para);
+ paraP.setPropertyValue("BreakType",com.sun.star.style.BreakType.PAGE_AFTER);
util.utils.pause(500);
@@ -151,22 +115,18 @@ public class SwAccessiblePageView extends TestCase {
XModel aModel = UnoRuntime.queryInterface(XModel.class, xTextDoc);
//switch to 'Print 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);
diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleTableCellView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleTableCellView.java
index 337d0d60a1f4..fac1a8659753 100644
--- a/qadevOOo/tests/java/mod/_sw/SwAccessibleTableCellView.java
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleTableCellView.java
@@ -19,7 +19,6 @@ package mod._sw;
import java.io.PrintWriter;
-import lib.StatusException;
import lib.TestCase;
import lib.TestEnvironment;
import lib.TestParameters;
@@ -72,13 +71,7 @@ public class SwAccessibleTableCellView extends TestCase {
oTable = SOfficeFactory.createTextTable(xTextDoc);
- try {
- SOfficeFactory.insertTextContent(xTextDoc, oTable);
- } catch (com.sun.star.lang.IllegalArgumentException e) {
- e.printStackTrace(log);
- throw new StatusException("Couldn't insert text content :" +
- e.getMessage(), e);
- }
+ SOfficeFactory.insertTextContent(xTextDoc, oTable);
XModel aModel = UnoRuntime.queryInterface(XModel.class,
xTextDoc);
diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleTableView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleTableView.java
index 9a51003d6501..f8aa53ca8be1 100644
--- a/qadevOOo/tests/java/mod/_sw/SwAccessibleTableView.java
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleTableView.java
@@ -19,7 +19,6 @@ package mod._sw;
import java.io.PrintWriter;
-import lib.StatusException;
import lib.TestCase;
import lib.TestEnvironment;
import lib.TestParameters;
@@ -74,13 +73,7 @@ public class SwAccessibleTableView extends TestCase {
SOfficeFactory.getFactory(Param.getMSF());
oTable = SOfficeFactory.createTextTable( xTextDoc );
- try {
- SOfficeFactory.insertTextContent(xTextDoc, oTable );
- } catch ( com.sun.star.lang.IllegalArgumentException e ) {
- e.printStackTrace( log );
- throw new StatusException("Couldn't insert text content :"
- + e.getMessage(), e);
- }
+ SOfficeFactory.insertTextContent(xTextDoc, oTable );
XModel aModel = UnoRuntime.queryInterface(XModel.class, xTextDoc);
diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleTextFrameView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleTextFrameView.java
index 4692fa0e13d1..72498e32506f 100644
--- a/qadevOOo/tests/java/mod/_sw/SwAccessibleTextFrameView.java
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleTextFrameView.java
@@ -19,7 +19,6 @@ package mod._sw;
import java.io.PrintWriter;
-import lib.StatusException;
import lib.TestCase;
import lib.TestEnvironment;
import lib.TestParameters;
@@ -70,7 +69,7 @@ public class SwAccessibleTextFrameView extends TestCase {
*/
@Override
protected TestEnvironment createTestEnvironment(
- TestParameters Param, PrintWriter log) {
+ TestParameters Param, PrintWriter log) throws Exception {
XInterface oObj = null;
XTextFrame oFrame1 = null;
@@ -82,22 +81,17 @@ public class SwAccessibleTextFrameView extends TestCase {
SOfficeFactory.getFactory( Param.getMSF() );
// creating Frames
log.println( "creating Frames" );
- try {
- oFrame1 = SOfficeFactory.createTextFrame(xTextDoc, 500, 500);
- oPropSet = UnoRuntime.queryInterface(
- XPropertySet.class, oFrame1 );
- oPropSet.setPropertyValue("AnchorType",
- TextContentAnchorType.AS_CHARACTER);
- oText = xTextDoc.getText();
- oCursor = oText.createTextCursor();
-
- log.println( "inserting Frame1" );
- XTextContent the_content = UnoRuntime.queryInterface(XTextContent.class, oFrame1);
- oText.insertTextContent(oCursor, the_content, true);
- } catch (Exception e) {
- e.printStackTrace(log);
- throw new StatusException("Couldn't insert TextFrame", e);
- }
+ oFrame1 = SOfficeFactory.createTextFrame(xTextDoc, 500, 500);
+ oPropSet = UnoRuntime.queryInterface(
+ XPropertySet.class, oFrame1 );
+ oPropSet.setPropertyValue("AnchorType",
+ TextContentAnchorType.AS_CHARACTER);
+ oText = xTextDoc.getText();
+ oCursor = oText.createTextCursor();
+
+ log.println( "inserting Frame1" );
+ XTextContent the_content = UnoRuntime.queryInterface(XTextContent.class, oFrame1);
+ oText.insertTextContent(oCursor, the_content, true);
XModel aModel = UnoRuntime.queryInterface(XModel.class, xTextDoc);
diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleTextGraphicObject.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleTextGraphicObject.java
index 73a53f29981e..9458e0e42b72 100644
--- a/qadevOOo/tests/java/mod/_sw/SwAccessibleTextGraphicObject.java
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleTextGraphicObject.java
@@ -19,7 +19,6 @@ package mod._sw;
import java.io.PrintWriter;
-import lib.StatusException;
import lib.TestCase;
import lib.TestEnvironment;
import lib.TestParameters;
@@ -81,12 +80,7 @@ public class SwAccessibleTextGraphicObject extends TestCase {
XTextContent the_content = UnoRuntime.queryInterface(XTextContent.class, oGraphObj);
log.println( "inserting graphic" );
- try {
- the_text.insertTextContent(the_cursor, the_content, true);
- } catch (com.sun.star.lang.IllegalArgumentException e) {
- e.printStackTrace();
- throw new StatusException("Couldn't insert Content", e);
- }
+ the_text.insertTextContent(the_cursor, the_content, true);
XModel aModel = UnoRuntime.queryInterface(XModel.class, xTextDoc);
diff --git a/qadevOOo/tests/java/mod/_sw/SwXAutoTextContainer.java b/qadevOOo/tests/java/mod/_sw/SwXAutoTextContainer.java
index 8744d79c518e..b529133f6538 100644
--- a/qadevOOo/tests/java/mod/_sw/SwXAutoTextContainer.java
+++ b/qadevOOo/tests/java/mod/_sw/SwXAutoTextContainer.java
@@ -20,7 +20,6 @@ package mod._sw;
import java.io.PrintWriter;
-import lib.StatusException;
import lib.TestCase;
import lib.TestEnvironment;
import lib.TestParameters;
@@ -55,22 +54,17 @@ public class SwXAutoTextContainer extends TestCase {
*/
@Override
public synchronized TestEnvironment createTestEnvironment(
- TestParameters Param, PrintWriter log ) throws StatusException {
+ TestParameters Param, PrintWriter log ) throws Exception {
XAutoTextContainer oContainer = null;
// creation of testobject here
// first we write what we are intend to do to log file
log.println("creating a AutoTextContainer");
- try {
- XMultiServiceFactory myMSF = Param.getMSF();
- Object oInst = myMSF.createInstance
- ("com.sun.star.text.AutoTextContainer");
- oContainer = UnoRuntime.queryInterface
- (XAutoTextContainer.class,oInst);
- } catch (com.sun.star.uno.Exception e) {
- e.printStackTrace(log);
- throw new StatusException("Couldn't create AutoTextContainer", e);
- }
+ XMultiServiceFactory myMSF = Param.getMSF();
+ Object oInst = myMSF.createInstance
+ ("com.sun.star.text.AutoTextContainer");
+ oContainer = UnoRuntime.queryInterface
+ (XAutoTextContainer.class,oInst);
TestEnvironment tEnv = new TestEnvironment(oContainer);
diff --git a/qadevOOo/tests/java/mod/_sw/SwXAutoTextEntry.java b/qadevOOo/tests/java/mod/_sw/SwXAutoTextEntry.java
index 676ec4560098..c53a7a8cd91f 100644
--- a/qadevOOo/tests/java/mod/_sw/SwXAutoTextEntry.java
+++ b/qadevOOo/tests/java/mod/_sw/SwXAutoTextEntry.java
@@ -27,6 +27,7 @@ import lib.TestParameters;
import util.DefaultDsc;
import util.InstCreator;
import util.SOfficeFactory;
+
import com.sun.star.container.XNameAccess;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.text.XAutoTextContainer;
@@ -120,21 +121,16 @@ public class SwXAutoTextEntry extends TestCase {
*/
@Override
protected synchronized TestEnvironment createTestEnvironment
- (TestParameters Param, PrintWriter log) {
+ (TestParameters Param, PrintWriter log) throws Exception {
XAutoTextEntry oEntry = null;
XAutoTextContainer oContainer;
XInterface oObj = null;
log.println( "creating a test environment" );
- try {
- XMultiServiceFactory myMSF = Param.getMSF();
- Object oInst = myMSF.createInstance
- ("com.sun.star.text.AutoTextContainer");
- oContainer = UnoRuntime.queryInterface(XAutoTextContainer.class,oInst);
- } catch (com.sun.star.uno.Exception e) {
- e.printStackTrace(log);
- throw new StatusException("Couldn't create AutoTextContainer", e);
- }
+ XMultiServiceFactory myMSF = Param.getMSF();
+ Object oInst = myMSF.createInstance
+ ("com.sun.star.text.AutoTextContainer");
+ oContainer = UnoRuntime.queryInterface(XAutoTextContainer.class,oInst);
XNameAccess oContNames = UnoRuntime.queryInterface(XNameAccess.class, oContainer);
@@ -143,12 +139,7 @@ public class SwXAutoTextEntry extends TestCase {
log.println("ContainerNames[ "+ i + "]: " + contNames[i]);
}
- try{
- oObj = (XInterface) AnyConverter.toObject(new Type(XInterface.class),oContNames.getByName("mytexts"));
- } catch (com.sun.star.uno.Exception e) {
- e.printStackTrace(log);
- throw new StatusException("Couldn't get AutoTextGroup", e);
- }
+ oObj = (XInterface) AnyConverter.toObject(new Type(XInterface.class),oContNames.getByName("mytexts"));
oGroup = UnoRuntime.queryInterface
(XAutoTextGroup.class, oObj);
diff --git a/qadevOOo/tests/java/mod/_sw/SwXAutoTextGroup.java b/qadevOOo/tests/java/mod/_sw/SwXAutoTextGroup.java
index 8410cf7c5468..be70947a8e4e 100644
--- a/qadevOOo/tests/java/mod/_sw/SwXAutoTextGroup.java
+++ b/qadevOOo/tests/java/mod/_sw/SwXAutoTextGroup.java
@@ -18,8 +18,8 @@
package mod._sw;
-import com.sun.star.container.ElementExistException;
import com.sun.star.container.XNameAccess;
+
import java.io.PrintWriter;
import lib.StatusException;
@@ -27,6 +27,7 @@ import lib.TestCase;
import lib.TestEnvironment;
import lib.TestParameters;
import util.SOfficeFactory;
+
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.text.XAutoTextContainer;
import com.sun.star.text.XText;
@@ -35,6 +36,7 @@ import com.sun.star.uno.AnyConverter;
import com.sun.star.uno.Type;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XInterface;
+
import util.utils;
@@ -102,20 +104,15 @@ public class SwXAutoTextGroup extends TestCase {
* </ul>
*/
@Override
- protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) throws Exception {
XInterface oObj = null;
XAutoTextContainer oContainer;
log.println( "creating a test environment" );
- try {
- XMultiServiceFactory myMSF = Param.getMSF();
- Object oInst = myMSF.createInstance("com.sun.star.text.AutoTextContainer");
- oContainer = UnoRuntime.queryInterface(XAutoTextContainer.class,oInst);
- } catch (com.sun.star.uno.Exception e) {
- e.printStackTrace(log);
- throw new StatusException("Couldn't create AutoTextContainer", e);
- }
+ XMultiServiceFactory myMSF = Param.getMSF();
+ Object oInst = myMSF.createInstance("com.sun.star.text.AutoTextContainer");
+ oContainer = UnoRuntime.queryInterface(XAutoTextContainer.class,oInst);
String myGroupName="myNewGroup2*1";
XAutoTextContainer xATC = UnoRuntime.queryInterface(XAutoTextContainer.class, oContainer);
@@ -126,17 +123,8 @@ public class SwXAutoTextGroup extends TestCase {
} catch (com.sun.star.container.NoSuchElementException e) {
}
- try {
- log.println("adding element with name '" + myGroupName + "'");
- xATC.insertNewByName(myGroupName);
- } catch (ElementExistException ex) {
- ex.printStackTrace(log);
- throw new StatusException("could not insert '"+myGroupName+"' into container",ex);
- } catch (com.sun.star.lang.IllegalArgumentException ex) {
- ex.printStackTrace(log);
- throw new StatusException("could not insert '"+myGroupName+"' into container",ex);
- }
-
+ log.println("adding element with name '" + myGroupName + "'");
+ xATC.insertNewByName(myGroupName);
XNameAccess oContNames = UnoRuntime.queryInterface(XNameAccess.class, oContainer);
@@ -147,12 +135,7 @@ public class SwXAutoTextGroup extends TestCase {
}
}
- try{
- oObj = (XInterface) AnyConverter.toObject(new Type(XInterface.class),oContNames.getByName(myGroupName));
- } catch (com.sun.star.uno.Exception e) {
- e.printStackTrace(log);
- throw new StatusException("Couldn't get AutoTextGroup '"+myGroupName + "'", e);
- }
+ oObj = (XInterface) AnyConverter.toObject(new Type(XInterface.class),oContNames.getByName(myGroupName));
log.println("ImplementationName " + utils.getImplName(oObj));
diff --git a/qadevOOo/tests/java/mod/_sw/SwXCellRange.java b/qadevOOo/tests/java/mod/_sw/SwXCellRange.java
index 235a60d29c5d..7cb5c3ad01b9 100644
--- a/qadevOOo/tests/java/mod/_sw/SwXCellRange.java
+++ b/qadevOOo/tests/java/mod/_sw/SwXCellRange.java
@@ -91,7 +91,7 @@ public class SwXCellRange extends TestCase {
*/
@Override
protected synchronized TestEnvironment createTestEnvironment
- (TestParameters tParam, PrintWriter log) {
+ (TestParameters tParam, PrintWriter log) throws Exception {
XTextTable the_table = null;
XInterface oObj = null;
@@ -99,22 +99,10 @@ public class SwXCellRange extends TestCase {
the_table.initialize(5, 5);
if( SOfficeFactory.getTableCollection( xTextDoc ).getCount() == 0 ) {
- try {
- SOfficeFactory.insertTextContent(xTextDoc, the_table );
- } catch (com.sun.star.lang.IllegalArgumentException e) {
- e.printStackTrace( log );
- throw new StatusException("Couldn't create TextTable : "
- + e.getMessage(), e);
- }
- }
- try {
- XCellRange the_Range = UnoRuntime.queryInterface(XCellRange.class, the_table);
- oObj = the_Range.getCellRangeByPosition(0, 0, 3, 4);
- } catch (com.sun.star.uno.Exception e) {
- e.printStackTrace( log );
- throw new StatusException("Couldn't get CellRange : "
- + e.getMessage(), e);
+ SOfficeFactory.insertTextContent(xTextDoc, the_table );
}
+ XCellRange the_Range = UnoRuntime.queryInterface(XCellRange.class, the_table);
+ oObj = the_Range.getCellRangeByPosition(0, 0, 3, 4);
log.println("Creating instance...");
TestEnvironment tEnv = new TestEnvironment( oObj );
diff --git a/qadevOOo/tests/java/mod/_sw/SwXDocumentIndex.java b/qadevOOo/tests/java/mod/_sw/SwXDocumentIndex.java
index 4c5624b1e051..f0022d98a547 100644
--- a/qadevOOo/tests/java/mod/_sw/SwXDocumentIndex.java
+++ b/qadevOOo/tests/java/mod/_sw/SwXDocumentIndex.java
@@ -93,31 +93,20 @@ public class SwXDocumentIndex extends TestCase {
*
*/
@Override
- protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) throws Exception {
XTextContent xTC = null;
Object instance = null;
SOfficeFactory.getFactory(tParam.getMSF());
log.println( "creating a test environment" );
- try {
- xTC = SOfficeFactory.createIndex(xTextDoc, "com.sun.star.text.DocumentIndex");
- instance = SOfficeFactory.createIndex(xTextDoc, "com.sun.star.text.DocumentIndex");
- }
- catch ( com.sun.star.uno.Exception e) {
- e.printStackTrace(log);
- throw new StatusException("Couldn't create the Index", e);
- }
+ xTC = SOfficeFactory.createIndex(xTextDoc, "com.sun.star.text.DocumentIndex");
+ instance = SOfficeFactory.createIndex(xTextDoc, "com.sun.star.text.DocumentIndex");
XText oText = xTextDoc.getText();
XTextCursor oCursor = oText.createTextCursor();
log.println("inserting the Index into text document");
- try {
- oText.insertTextContent(oCursor, xTC, false);
- } catch (com.sun.star.lang.IllegalArgumentException e) {
- e.printStackTrace(log);
- throw new StatusException("Couldn't insert the Index", e);
- }
+ oText.insertTextContent(oCursor, xTC, false);
TestEnvironment tEnv = new TestEnvironment(xTC);
diff --git a/qadevOOo/tests/java/mod/_sw/SwXDocumentIndexMark.java b/qadevOOo/tests/java/mod/_sw/SwXDocumentIndexMark.java
index 0b654905d000..8d02891be7b6 100644
--- a/qadevOOo/tests/java/mod/_sw/SwXDocumentIndexMark.java
+++ b/qadevOOo/tests/java/mod/_sw/SwXDocumentIndexMark.java
@@ -115,13 +115,7 @@ public class SwXDocumentIndexMark extends TestCase {
XDocumentIndexMark xDIM = UnoRuntime.queryInterface(XDocumentIndexMark.class, oDIM);
- try {
- oText.insertTextContent(oCursor, xDIM, false);
- } catch (com.sun.star.lang.IllegalArgumentException e) {
- e.printStackTrace(log);
- throw new StatusException
- ("Couldn't insert the DocumentIndexMark", e);
- }
+ oText.insertTextContent(oCursor, xDIM, false);
TestEnvironment tEnv = new TestEnvironment(xDIM);
diff --git a/qadevOOo/tests/java/mod/_sw/SwXDocumentIndexes.java b/qadevOOo/tests/java/mod/_sw/SwXDocumentIndexes.java
index 7ca935efd647..06079771642b 100644
--- a/qadevOOo/tests/java/mod/_sw/SwXDocumentIndexes.java
+++ b/qadevOOo/tests/java/mod/_sw/SwXDocumentIndexes.java
@@ -89,31 +89,18 @@ public class SwXDocumentIndexes extends TestCase {
*/
@Override
public TestEnvironment createTestEnvironment(
- TestParameters tParam, PrintWriter log ) throws StatusException {
+ TestParameters tParam, PrintWriter log ) throws Exception {
XInterface oObj = null;
SOfficeFactory.getFactory( tParam.getMSF() );
log.println( "creating a test environment" );
- XTextContent xTC = null;
-
- try {
- xTC = SOfficeFactory.createIndex(xTextDoc,"com.sun.star.text.ContentIndex");
- }
- catch ( com.sun.star.uno.Exception e) {
- e.printStackTrace(log);
- throw new StatusException("Couldn't create the Index", e);
- }
+ XTextContent xTC = SOfficeFactory.createIndex(xTextDoc,"com.sun.star.text.ContentIndex");
XText oText = xTextDoc.getText();
XTextCursor oCursor = oText.createTextCursor();
log.println("inserting the Index into text document");
- try {
- oText.insertTextContent(oCursor, xTC, false);
- } catch (com.sun.star.lang.IllegalArgumentException e) {
- e.printStackTrace(log);
- throw new StatusException("Couldn't insert the Index", e);
- }
+ oText.insertTextContent(oCursor, xTC, false);
XDocumentIndexesSupplier xDocInd = UnoRuntime.queryInterface(XDocumentIndexesSupplier.class,xTextDoc);
diff --git a/qadevOOo/tests/java/mod/_sw/SwXEndnoteProperties.java b/qadevOOo/tests/java/mod/_sw/SwXEndnoteProperties.java
index 240437b88e2d..bf515c183f92 100644
--- a/qadevOOo/tests/java/mod/_sw/SwXEndnoteProperties.java
+++ b/qadevOOo/tests/java/mod/_sw/SwXEndnoteProperties.java
@@ -85,7 +85,7 @@ public class SwXEndnoteProperties extends TestCase {
*/
@Override
public synchronized TestEnvironment createTestEnvironment(
- TestParameters Param, PrintWriter log ) throws StatusException {
+ TestParameters Param, PrintWriter log ) throws Exception {
XEndnotesSupplier oInterface = null;
XInterface oObj = null;
XInterface oEndnote;
@@ -93,25 +93,15 @@ public class SwXEndnoteProperties extends TestCase {
log.println( "Creating a test environment" );
XMultiServiceFactory msf = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc);
log.println("creating a endnote");
- try {
- oEndnote = UnoRuntime.queryInterface(XInterface.class,
- msf.createInstance("com.sun.star.text.Endnote"));
- } catch (com.sun.star.uno.Exception e) {
- e.printStackTrace(log);
- throw new StatusException("Couldn't create endnote", e);
- }
+ oEndnote = UnoRuntime.queryInterface(XInterface.class,
+ msf.createInstance("com.sun.star.text.Endnote"));
XText oText = xTextDoc.getText();
XTextCursor oCursor = oText.createTextCursor();
log.println("inserting the footnote into text document");
XTextContent xTC = UnoRuntime.queryInterface(XTextContent.class, oEndnote);
- try {
- oText.insertTextContent(oCursor, xTC, false);
- } catch (com.sun.star.lang.IllegalArgumentException e) {
- e.printStackTrace(log);
- throw new StatusException("Couldn't insert the endnote", e);
- }
+ oText.insertTextContent(oCursor, xTC, false);
oInterface = UnoRuntime.queryInterface(XEndnotesSupplier.class, xTextDoc);
oObj = oInterface.getEndnoteSettings();
diff --git a/qadevOOo/tests/java/mod/_sw/SwXFieldEnumeration.java b/qadevOOo/tests/java/mod/_sw/SwXFieldEnumeration.java
index 59e642253d79..4d7ace0e9651 100644
--- a/qadevOOo/tests/java/mod/_sw/SwXFieldEnumeration.java
+++ b/qadevOOo/tests/java/mod/_sw/SwXFieldEnumeration.java
@@ -141,13 +141,8 @@ public class SwXFieldEnumeration extends TestCase {
the_Cursor = the_Text.createTextCursor();
the_Field = UnoRuntime.queryInterface(XTextContent.class, oObj);
- try {
- xTF.attachTextFieldMaster(PFieldMaster);
- the_Text.insertTextContent(the_Cursor,the_Field,false);
- } catch ( com.sun.star.lang.IllegalArgumentException e ) {
- e.printStackTrace(log);
- throw new StatusException( "Couldn't create TextField", e );
- }
+ xTF.attachTextFieldMaster(PFieldMaster);
+ the_Text.insertTextContent(the_Cursor,the_Field,false);
// create testobject here
XTextFieldsSupplier oTFS = UnoRuntime.queryInterface( XTextFieldsSupplier.class, xTextDoc );
diff --git a/qadevOOo/tests/java/mod/_sw/SwXFootnote.java b/qadevOOo/tests/java/mod/_sw/SwXFootnote.java
index 911fa368e684..c675eb355f31 100644
--- a/qadevOOo/tests/java/mod/_sw/SwXFootnote.java
+++ b/qadevOOo/tests/java/mod/_sw/SwXFootnote.java
@@ -105,7 +105,7 @@ public class SwXFootnote extends TestCase {
* </ul>
*/
@Override
- protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) throws Exception {
XFootnote oFootnote;
log.println( "Creating a test environment" );
@@ -113,25 +113,15 @@ public class SwXFootnote extends TestCase {
XMultiServiceFactory msf = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc);
log.println("creating a footnote");
Object instance = null;
- try {
- oFootnote = UnoRuntime.queryInterface(XFootnote.class,
- msf.createInstance("com.sun.star.text.Footnote"));
- instance = msf.createInstance("com.sun.star.text.Footnote");
- } catch (com.sun.star.uno.Exception e) {
- e.printStackTrace(log);
- throw new StatusException("Couldn't create footnote", e);
- }
+ oFootnote = UnoRuntime.queryInterface(XFootnote.class,
+ msf.createInstance("com.sun.star.text.Footnote"));
+ instance = msf.createInstance("com.sun.star.text.Footnote");
XText oText = xTextDoc.getText();
XTextCursor oCursor = oText.createTextCursor();
log.println("inserting the footnote into text document");
- try {
- oText.insertTextContent(oCursor, oFootnote, false);
- } catch (com.sun.star.lang.IllegalArgumentException e) {
- e.printStackTrace(log);
- throw new StatusException("Couldn't insert the footnote", e);
- }
+ oText.insertTextContent(oCursor, oFootnote, false);
TestEnvironment tEnv = new TestEnvironment(oFootnote);
diff --git a/qadevOOo/tests/java/mod/_sw/SwXFootnoteProperties.java b/qadevOOo/tests/java/mod/_sw/SwXFootnoteProperties.java
index 1660cf88185b..214e06c5870b 100644
--- a/qadevOOo/tests/java/mod/_sw/SwXFootnoteProperties.java
+++ b/qadevOOo/tests/java/mod/_sw/SwXFootnoteProperties.java
@@ -84,7 +84,7 @@ public class SwXFootnoteProperties extends TestCase {
*/
@Override
public synchronized TestEnvironment createTestEnvironment(
- TestParameters Param, PrintWriter log ) throws StatusException {
+ TestParameters Param, PrintWriter log ) throws Exception {
XFootnotesSupplier oInterface = null;
XInterface oObj = null;
XFootnote oFootnote;
@@ -94,24 +94,14 @@ public class SwXFootnoteProperties extends TestCase {
XMultiServiceFactory msf = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc);
log.println("creating a footnote");
- try {
- oFootnote = UnoRuntime.queryInterface(XFootnote.class,
- msf.createInstance("com.sun.star.text.Footnote"));
- } catch (com.sun.star.uno.Exception e) {
- e.printStackTrace(log);
- throw new StatusException("Couldn't create footnote", e);
- }
+ oFootnote = UnoRuntime.queryInterface(XFootnote.class,
+ msf.createInstance("com.sun.star.text.Footnote"));
XText oText = xTextDoc.getText();
XTextCursor oCursor = oText.createTextCursor();
log.println("inserting the footnote into text document");
- try {
- oText.insertTextContent(oCursor, oFootnote, false);
- } catch (com.sun.star.lang.IllegalArgumentException e) {
- e.printStackTrace(log);
- throw new StatusException("Couldn't insert the footnote", e);
- }
+ oText.insertTextContent(oCursor, oFootnote, false);
oInterface = UnoRuntime.queryInterface(XFootnotesSupplier.class, xTextDoc);
oObj = oInterface.getFootnoteSettings();
diff --git a/qadevOOo/tests/java/mod/_sw/SwXFootnoteText.java b/qadevOOo/tests/java/mod/_sw/SwXFootnoteText.java
index 363a4485877c..5229611d780e 100644
--- a/qadevOOo/tests/java/mod/_sw/SwXFootnoteText.java
+++ b/qadevOOo/tests/java/mod/_sw/SwXFootnoteText.java
@@ -116,7 +116,7 @@ public class SwXFootnoteText extends TestCase {
*/
@Override
public synchronized TestEnvironment createTestEnvironment(
- TestParameters tParam, PrintWriter log ) throws StatusException {
+ TestParameters tParam, PrintWriter log ) throws Exception {
XInterface oObj = null;
XFootnote oFootnote;
@@ -124,24 +124,14 @@ public class SwXFootnoteText extends TestCase {
XMultiServiceFactory msf = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc);
log.println("creating a footnote");
- try {
- oFootnote = UnoRuntime.queryInterface(XFootnote.class,
- msf.createInstance("com.sun.star.text.Footnote"));
- } catch (com.sun.star.uno.Exception e) {
- e.printStackTrace(log);
- throw new StatusException("Couldn't create footnote", e);
- }
+ oFootnote = UnoRuntime.queryInterface(XFootnote.class,
+ msf.createInstance("com.sun.star.text.Footnote"));
XText oText = xTextDoc.getText();
XTextCursor oCursor = oText.createTextCursor();
log.println("inserting the footnote into text document");
- try {
- oText.insertTextContent(oCursor, oFootnote, false);
- } catch (com.sun.star.lang.IllegalArgumentException e) {
- e.printStackTrace(log);
- throw new StatusException("Couldn't insert the footnote", e);
- }
+ oText.insertTextContent(oCursor, oFootnote, false);
XSimpleText oFootText = UnoRuntime.queryInterface(XSimpleText.class, oFootnote);
oFootText.setString("SwXFootnoteText");
diff --git a/qadevOOo/tests/java/mod/_sw/SwXFootnotes.java b/qadevOOo/tests/java/mod/_sw/SwXFootnotes.java
index dbc271dc61db..7e9d25b8388a 100644
--- a/qadevOOo/tests/java/mod/_sw/SwXFootnotes.java
+++ b/qadevOOo/tests/java/mod/_sw/SwXFootnotes.java
@@ -87,7 +87,7 @@ public class SwXFootnotes extends TestCase {
*/
@Override
public synchronized TestEnvironment createTestEnvironment(
- TestParameters Param, PrintWriter log ) throws StatusException {
+ TestParameters Param, PrintWriter log ) throws Exception {
XFootnotesSupplier oInterface = null;
XInterface oObj = null;
@@ -96,24 +96,14 @@ public class SwXFootnotes extends TestCase {
log.println("creating a footnote");
XFootnote oFootnote;
- try {
- oFootnote = UnoRuntime.queryInterface(XFootnote.class,
- msf.createInstance("com.sun.star.text.Footnote"));
- } catch (com.sun.star.uno.Exception e) {
- e.printStackTrace(log);
- throw new StatusException("Couldn't create footnote", e);
- }
+ oFootnote = UnoRuntime.queryInterface(XFootnote.class,
+ msf.createInstance("com.sun.star.text.Footnote"));
XText oText = xTextDoc.getText();
XTextCursor oCursor = oText.createTextCursor();
log.println("inserting the footnote into text document");
- try {
- oText.insertTextContent(oCursor, oFootnote, false);
- } catch (com.sun.star.lang.IllegalArgumentException e) {
- e.printStackTrace(log);
- throw new StatusException("Couldn't insert the footnote", e);
- }
+ oText.insertTextContent(oCursor, oFootnote, false);
oInterface = UnoRuntime.queryInterface(XFootnotesSupplier.class, xTextDoc);
oObj = oInterface.getFootnotes();
diff --git a/qadevOOo/tests/java/mod/_sw/SwXFrames.java b/qadevOOo/tests/java/mod/_sw/SwXFrames.java
index 89966150e1ca..93349669056c 100644
--- a/qadevOOo/tests/java/mod/_sw/SwXFrames.java
+++ b/qadevOOo/tests/java/mod/_sw/SwXFrames.java
@@ -90,7 +90,7 @@ public class SwXFrames extends TestCase {
*/
@Override
public synchronized TestEnvironment createTestEnvironment(
- TestParameters Param, PrintWriter log ) throws StatusException {
+ TestParameters Param, PrintWriter log ) throws Exception {
XInterface oObj = null;
XTextFrame oFrame1 = null;
XText oText = null;
@@ -99,26 +99,14 @@ public class SwXFrames extends TestCase {
XTextFramesSupplier oInterface = null;
log.println( "creating a test environment" );
- try {
- oDocMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc);
- Object oInt = oDocMSF.createInstance("com.sun.star.text.TextFrame");
- oFrame1 = UnoRuntime.queryInterface( XTextFrame.class, oInt );
- } catch ( com.sun.star.uno.Exception e ) {
- e.printStackTrace(log);
- throw new StatusException
- ("Couldn't create instance of TextFrame", e);
- }
+ oDocMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc);
+ Object oInt = oDocMSF.createInstance("com.sun.star.text.TextFrame");
+ oFrame1 = UnoRuntime.queryInterface( XTextFrame.class, oInt );
oText = xTextDoc.getText();
oCursor = oText.createTextCursor();
- try {
- oText.insertTextContent(oCursor, oFrame1, false);
- } catch ( com.sun.star.lang.IllegalArgumentException e ) {
- e.printStackTrace(log);
- throw new StatusException
- ("Error: can't insert text content to text document", e);
- }
+ oText.insertTextContent(oCursor, oFrame1, false);
oInterface = UnoRuntime.queryInterface( XTextFramesSupplier.class, xTextDoc );
diff --git a/qadevOOo/tests/java/mod/_sw/SwXHeadFootText.java b/qadevOOo/tests/java/mod/_sw/SwXHeadFootText.java
index 6b8eab9144cf..209d959590f3 100644
--- a/qadevOOo/tests/java/mod/_sw/SwXHeadFootText.java
+++ b/qadevOOo/tests/java/mod/_sw/SwXHeadFootText.java
@@ -116,7 +116,7 @@ public class SwXHeadFootText extends TestCase {
* </ul>
*/
@Override
- protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) throws Exception {
XInterface oObj = null;
XPropertySet PropSet;
XNameAccess PageStyles = null;
@@ -127,46 +127,21 @@ public class SwXHeadFootText extends TestCase {
XNameAccess StyleFamNames = StyleFam.getStyleFamilies();
// obtains style 'Standatd' from style family 'PageStyles'
- try {
- PageStyles = (XNameAccess) AnyConverter.toObject(
- new Type(XNameAccess.class),StyleFamNames.getByName("PageStyles"));
- StdStyle = (XStyle) AnyConverter.toObject(
- new Type(XStyle.class),PageStyles.getByName("Standard"));
- } catch ( com.sun.star.lang.WrappedTargetException e ) {
- e.printStackTrace(log);
- throw new StatusException("Error getting style by name!", e);
- } catch ( com.sun.star.container.NoSuchElementException e ) {
- e.printStackTrace(log);
- throw new StatusException("Error, no such style name! ", e);
- } catch ( com.sun.star.lang.IllegalArgumentException e ) {
- e.printStackTrace(log);
- throw new StatusException("Error getting style by name!", e);
- }
+ PageStyles = (XNameAccess) AnyConverter.toObject(
+ new Type(XNameAccess.class),StyleFamNames.getByName("PageStyles"));
+ StdStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),PageStyles.getByName("Standard"));
PropSet = UnoRuntime.queryInterface( XPropertySet.class, StdStyle);
// changing/getting some properties
- try {
- log.println( "Switching on header" );
- PropSet.setPropertyValue("HeaderIsOn", Boolean.TRUE);
- log.println( "Switching on footer" );
- PropSet.setPropertyValue("FooterIsOn", Boolean.TRUE);
- log.println( "Get header text" );
- oObj = UnoRuntime.queryInterface(
- XText.class, PropSet.getPropertyValue("HeaderText"));
- } catch ( com.sun.star.lang.WrappedTargetException e ) {
- e.printStackTrace(log);
- throw new StatusException("Couldn't set/get propertyValue...", e);
- } catch ( com.sun.star.lang.IllegalArgumentException e ) {
- e.printStackTrace(log);
- throw new StatusException("Couldn't set/get propertyValue...", e);
- } catch ( com.sun.star.beans.PropertyVetoException e ) {
- e.printStackTrace(log);
- throw new StatusException("Couldn't set/get propertyValue...", e);
- } catch ( com.sun.star.beans.UnknownPropertyException e ) {
- e.printStackTrace(log);
- throw new StatusException("Couldn't set/get propertyValue...", e);
- }
+ log.println( "Switching on header" );
+ PropSet.setPropertyValue("HeaderIsOn", Boolean.TRUE);
+ log.println( "Switching on footer" );
+ PropSet.setPropertyValue("FooterIsOn", Boolean.TRUE);
+ log.println( "Get header text" );
+ oObj = UnoRuntime.queryInterface(
+ XText.class, PropSet.getPropertyValue("HeaderText"));
log.println( "creating a new environment for bodytext object" );
TestEnvironment tEnv = new TestEnvironment( oObj );
diff --git a/qadevOOo/tests/java/mod/_sw/SwXMailMerge.java b/qadevOOo/tests/java/mod/_sw/SwXMailMerge.java
index c13f6918962c..5ce0153224ac 100644
--- a/qadevOOo/tests/java/mod/_sw/SwXMailMerge.java
+++ b/qadevOOo/tests/java/mod/_sw/SwXMailMerge.java
@@ -22,8 +22,6 @@ import com.sun.star.beans.NamedValue;
import util.DBTools;
import util.utils;
-import com.sun.star.beans.PropertyVetoException;
-import com.sun.star.beans.UnknownPropertyException;
import com.sun.star.beans.XPropertySet;
import com.sun.star.container.NoSuchElementException;
import com.sun.star.container.XNameAccess;
@@ -72,19 +70,15 @@ public class SwXMailMerge extends TestCase {
* </ul>
*/
@Override
- protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) throws Exception {
XInterface oObj = null;
XInterface oRowSet = null;
XJob Job = null;
log.println(" instantiate MailMerge service");
- try {
- oObj = (XInterface) Param.getMSF().createInstance
- ("com.sun.star.text.MailMerge");
- } catch (Exception e) {
- throw new StatusException("Can't create object environment", e) ;
- }
+ oObj = (XInterface) Param.getMSF().createInstance
+ ("com.sun.star.text.MailMerge");
// <set some variables>
String cTestDoc = utils.getFullTestURL("MailMerge.sxw");
@@ -100,32 +94,14 @@ public class SwXMailMerge extends TestCase {
// <create XResultSet>
log.println("create a XResultSet");
- try {
- oRowSet = (XInterface) Param.getMSF().createInstance
- ("com.sun.star.sdb.RowSet");
- } catch (Exception e) {
- throw new StatusException("Can't create com.sun.star.sdb.RowSet", e);
- }
+ oRowSet = (XInterface) Param.getMSF().createInstance
+ ("com.sun.star.sdb.RowSet");
XPropertySet oRowSetProps = UnoRuntime.queryInterface(XPropertySet.class, oRowSet);
XRowSet xRowSet = UnoRuntime.queryInterface(XRowSet.class, oRowSet);
- try {
- oRowSetProps.setPropertyValue("DataSourceName",cDataSourceName);
- oRowSetProps.setPropertyValue("Command",cDataCommand);
- oRowSetProps.setPropertyValue("CommandType", Integer.valueOf(CommandType.TABLE));
- } catch (UnknownPropertyException e) {
- throw new StatusException("Can't set properties on oRowSet", e);
- } catch (PropertyVetoException e) {
- throw new StatusException("Can't set properties on oRowSet", e);
- } catch (IllegalArgumentException e) {
- throw new StatusException("Can't set properties on oRowSet", e);
- } catch (WrappedTargetException e) {
- throw new StatusException("Can't set properties on oRowSet", e);
- }
- try {
- xRowSet.execute();
- } catch (SQLException e) {
- throw new StatusException("Can't execute oRowSet", e);
- }
+ oRowSetProps.setPropertyValue("DataSourceName",cDataSourceName);
+ oRowSetProps.setPropertyValue("Command",cDataCommand);
+ oRowSetProps.setPropertyValue("CommandType", Integer.valueOf(CommandType.TABLE));
+ xRowSet.execute();
XResultSet oResultSet = UnoRuntime.queryInterface(XResultSet.class, oRowSet);
@@ -134,16 +110,12 @@ public class SwXMailMerge extends TestCase {
// <create Bookmarks>
log.println("create bookmarks");
- try {
- XRowLocate oRowLocate = UnoRuntime.queryInterface(
- XRowLocate.class, oResultSet);
- oResultSet.first();