summaryrefslogtreecommitdiff
path: root/qadevOOo/tests/java/ifc/document
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2006-11-21 13:12:03 +0000
committerVladimir Glazounov <vg@openoffice.org>2006-11-21 13:12:03 +0000
commit6ea662201fa09e16d1e3570a363c88de9442c6e8 (patch)
treee1e7fb986138596e42c1f3931e82c5a6b78c4076 /qadevOOo/tests/java/ifc/document
parentb9ce9b56bed126075d8d1b3bdb2ea4251f510901 (diff)
INTEGRATION: CWS qadev27 (1.3.20); FILE MERGED
2006/07/07 12:41:09 cn 1.3.20.1: #i67115# enhance test to check for invalid URLs
Diffstat (limited to 'qadevOOo/tests/java/ifc/document')
-rw-r--r--qadevOOo/tests/java/ifc/document/_XDocumentInsertable.java25
1 files changed, 21 insertions, 4 deletions
diff --git a/qadevOOo/tests/java/ifc/document/_XDocumentInsertable.java b/qadevOOo/tests/java/ifc/document/_XDocumentInsertable.java
index eff5858ad978..218a3f07369d 100644
--- a/qadevOOo/tests/java/ifc/document/_XDocumentInsertable.java
+++ b/qadevOOo/tests/java/ifc/document/_XDocumentInsertable.java
@@ -4,9 +4,9 @@
*
* $RCSfile: _XDocumentInsertable.java,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: rt $ $Date: 2005-09-08 23:27:39 $
+ * last change: $Author: vg $ $Date: 2006-11-21 14:12:03 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -35,6 +35,7 @@
package ifc.document;
+import com.sun.star.io.IOException;
import lib.MultiMethodTest;
import lib.Status;
import lib.StatusException;
@@ -140,9 +141,10 @@ public class _XDocumentInsertable extends MultiMethodTest {
* checked for existance of loaded document content. In case
* if relation was found, then its <code>isInserted</code>
* method is used to check insertion.<p>
+ * A Second test uses an invalid URL and checks for correct exceptions.
*
- * Has <b> OK </b> status if insertion was completed successfully
- * and no exceptions were thrown. <p>
+ * Has <b> OK </b> status if at first insertion was completed successfully
+ * and no exceptions were thrown and as second a expected excption was thrown. <p>
*/
public void _insertDocumentFromURL() {
boolean result = true ;
@@ -176,6 +178,21 @@ public class _XDocumentInsertable extends MultiMethodTest {
result = false ;
}
+ try {
+ PropertyValue [] szEmptyArgs = new PropertyValue [0];
+ String docURL = "file:///c:/ThisIsAnInvaldURL";
+ log.println("Inserting document from URL '" + docURL + "'");
+ oObj.insertDocumentFromURL(docURL, szEmptyArgs);
+
+ result=false;
+
+ } catch (IOException ex) {
+ log.println("expected exception was thrown -> ok");
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ log.println("expected exception was thrown -> ok");
+ }
+
+
tRes.tested("insertDocumentFromURL()", result);
}