[Libreoffice-commits] core.git: 2 commits - qadevOOo/tests

Michael Meeks michael.meeks at collabora.com
Mon Sep 30 07:25:14 PDT 2013


 qadevOOo/tests/java/ifc/accessibility/_XAccessibleComponent.java |   20 ++++++----
 qadevOOo/tests/java/mod/_sc/ScAccessibleCell.java                |   10 ++---
 qadevOOo/tests/java/mod/_sc/ScAccessibleDocumentPagePreview.java |    4 +-
 qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeader.java          |    4 +-
 qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeaderArea.java      |    6 +--
 qadevOOo/tests/java/mod/_sc/ScAccessibleSpreadsheet.java         |    6 +--
 6 files changed, 28 insertions(+), 22 deletions(-)

New commits:
commit 32e0f451d69b68d69a4aa91c271b81ea6264d3c1
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Mon Sep 30 15:28:17 2013 +0100

    junit: add 'r' to creating, and better exception descriptions.

diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessibleCell.java b/qadevOOo/tests/java/mod/_sc/ScAccessibleCell.java
index 62d6acb..09cb12e 100644
--- a/qadevOOo/tests/java/mod/_sc/ScAccessibleCell.java
+++ b/qadevOOo/tests/java/mod/_sc/ScAccessibleCell.java
@@ -136,19 +136,19 @@ public class ScAccessibleCell extends TestCase {
                                 XPropertySet.class,oIndexAccess.getByIndex(1));
             column.setPropertyValue("OptimalWidth", new Boolean(true));
         } catch(com.sun.star.lang.WrappedTargetException e) {
-            log.println("Exception ceating relation :");
+            log.println("Exception creating relation :");
             e.printStackTrace(log);
         } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
-            log.println("Exception ceating relation :");
+            log.println("Exception creating relation :");
             e.printStackTrace(log);
         } catch(com.sun.star.beans.UnknownPropertyException e) {
-            log.println("Exception ceating relation :");
+            log.println("Exception creating relation :");
             e.printStackTrace(log);
         } catch(com.sun.star.beans.PropertyVetoException e) {
-            log.println("Exception ceating relation :");
+            log.println("Exception creating relation :");
             e.printStackTrace(log);
         } catch(com.sun.star.lang.IllegalArgumentException e) {
-            log.println("Exception ceating relation :");
+            log.println("Exception creating relation :");
             e.printStackTrace(log);
         }
 
diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessibleDocumentPagePreview.java b/qadevOOo/tests/java/mod/_sc/ScAccessibleDocumentPagePreview.java
index 2b29031..ab2bf0d 100644
--- a/qadevOOo/tests/java/mod/_sc/ScAccessibleDocumentPagePreview.java
+++ b/qadevOOo/tests/java/mod/_sc/ScAccessibleDocumentPagePreview.java
@@ -120,10 +120,10 @@ public class ScAccessibleDocumentPagePreview extends TestCase {
             xCell = oSheet.getCellByPosition(0, 0) ;
             xCell.setFormula("ScAccessibleDocumentPagePreview");
         } catch(com.sun.star.lang.WrappedTargetException e) {
-            log.println("Exception ceating relation :");
+            log.println("Exception creating document page preview :");
             e.printStackTrace(log);
         } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
-            log.println("Exception ceating relation :");
+            log.println("Exception creating document page preview :");
             e.printStackTrace(log);
         }
 
diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeader.java b/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeader.java
index 5c595c1..97764dd 100644
--- a/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeader.java
+++ b/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeader.java
@@ -105,10 +105,10 @@ public class ScAccessiblePageHeader extends TestCase {
             xCell = oSheet.getCellByPosition(0, 0) ;
             xCell.setFormula("ScAccessiblePageHeader");
         } catch(com.sun.star.lang.WrappedTargetException e) {
-            log.println("Exception ceating relation :");
+            log.println("Exception creating page header :");
             e.printStackTrace(log);
         } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
-            log.println("Exception ceating relation :");
+            log.println("Exception creating page header :");
             e.printStackTrace(log);
         }
 
diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeaderArea.java b/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeaderArea.java
index dacfad8..558143a 100644
--- a/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeaderArea.java
+++ b/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeaderArea.java
@@ -99,13 +99,13 @@ public class ScAccessiblePageHeaderArea extends TestCase {
             xCell = oSheet.getCellByPosition(0, 0) ;
             xCell.setFormula("ScAccessiblePageHeaderArea");
         } catch(com.sun.star.lang.WrappedTargetException e) {
-            log.println("Exception ceating relation :");
+            log.println("Exception creating page header area :");
             e.printStackTrace(log);
         } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
-            log.println("Exception ceating relation :");
+            log.println("Exception creating page header area :");
             e.printStackTrace(log);
         } catch(com.sun.star.lang.IllegalArgumentException e) {
-            log.println("Exception ceating relation :");
+            log.println("Exception creating page header area :");
             e.printStackTrace(log);
         }
 
diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessibleSpreadsheet.java b/qadevOOo/tests/java/mod/_sc/ScAccessibleSpreadsheet.java
index 255230c..ab30d7c 100644
--- a/qadevOOo/tests/java/mod/_sc/ScAccessibleSpreadsheet.java
+++ b/qadevOOo/tests/java/mod/_sc/ScAccessibleSpreadsheet.java
@@ -129,13 +129,13 @@ public class ScAccessibleSpreadsheet extends TestCase {
             xCell = oSheet.getCellByPosition(5, 5) ;
             xCell.setFormula(text);
         } catch(com.sun.star.lang.WrappedTargetException e) {
-            log.println("Exception ceating relation :");
+            log.println("Exception creating accessible text :");
             e.printStackTrace(log);
         } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
-            log.println("Exception ceating relation :");
+            log.println("Exception creating accessible text :");
             e.printStackTrace(log);
         } catch(com.sun.star.lang.IllegalArgumentException e) {
-            log.println("Exception ceating relation :");
+            log.println("Exception creating accessible text :");
             e.printStackTrace(log);
         }
 
commit a9cf50c24dd10a20e1288828e2a59c193bb582cb
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Mon Sep 30 15:28:02 2013 +0100

    junit: make tests robust by compensating for intermittent sizing race.

diff --git a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleComponent.java b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleComponent.java
index fd8833b..0695206 100644
--- a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleComponent.java
+++ b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleComponent.java
@@ -477,15 +477,21 @@ public class _XAccessibleComponent extends MultiMethodTest {
     public void _getSize() {
         requiredMethod("getBounds()");
 
-        boolean result = true;
+        boolean result = false;
         Size size = oObj.getSize();
 
-        result &= (size.Width == bounds.Width);
-        result &= (size.Height == bounds.Height);
-        if (!result) {
-            log.println(
-                "bounds " + bounds.Width + "x" + bounds.Height + " vs. size "
-                + size.Width + "x" + size.Height);
+	for (int i = 0; i < 2 && !result; i++)
+	{
+	    result = true;
+	    result &= (size.Width == bounds.Width);
+	    result &= (size.Height == bounds.Height);
+	    if (!result) {
+		log.println( "potential race bounds " + bounds.Width + "x" + bounds.Height +
+			     " vs. size " + size.Width + "x" + size.Height);
+		// Possibily we hit a race condition and it re-sized (?) ...
+		bounds = oObj.getBounds();
+		size = oObj.getSize();
+	    }
         }
 
         tRes.tested("getSize()", result);


More information about the Libreoffice-commits mailing list