diff options
Diffstat (limited to 'qadevOOo')
-rw-r--r-- | qadevOOo/runner/complexlib/Assurance.java | 25 | ||||
-rw-r--r-- | qadevOOo/runner/stats/Summarizer.java | 2 | ||||
-rw-r--r-- | qadevOOo/tests/java/mod/_forms/GenericModelTest.java | 28 |
3 files changed, 39 insertions, 16 deletions
diff --git a/qadevOOo/runner/complexlib/Assurance.java b/qadevOOo/runner/complexlib/Assurance.java index 665980d792ab..980ede95f052 100644 --- a/qadevOOo/runner/complexlib/Assurance.java +++ b/qadevOOo/runner/complexlib/Assurance.java @@ -75,7 +75,7 @@ public class Assurance * @param actual specifies the actual boolean value */ protected void assureEquals( boolean expected, boolean actual ) { - assureEquals( "Equality test failed", new Boolean( expected ), new Boolean( actual ), false ); + assureEquals( "Equality test failed", expected, new Boolean( actual ), false ); } /** @@ -85,7 +85,7 @@ public class Assurance * @param actual specifies the actual boolean value */ protected void assureEquals( String message, boolean expected, boolean actual ) { - assureEquals( message, new Boolean( expected ), new Boolean( actual ), false ); + assureEquals( message, expected, actual, false ); } /** @@ -240,6 +240,27 @@ public class Assurance assureEquals( message, expected, actual, false ); } + /** + * assures the two given sequences are of equal length, and have equal content + */ + public <T> void assureEquals( String i_message, T[] i_expected, T[] i_actual, boolean i_continue ) + { + if ( i_expected.length != i_actual.length ) + failed( i_message + ": expected element count: " + i_expected.length + ", actual element count: " + i_actual.length ); + for ( int i=0; i<i_expected.length; ++i ) + { + assureEquals( i_message + ": mismatch at element pos " + i, i_expected[i], i_actual[i], i_continue ); + } + } + + /** + * assures the two given sequences are of equal length, and have equal content + */ + public <T> void assureEquals( String i_message, T[] i_expected, T[] i_actual ) + { + assureEquals( i_message, i_expected, i_actual, false ); + } + /** invokes a given method on a given object, and assures a certain exception is caught * @param _message is the message to print when the check fails * @param _object is the object to invoke the method on diff --git a/qadevOOo/runner/stats/Summarizer.java b/qadevOOo/runner/stats/Summarizer.java index b1fe5fe61dd3..5f4a58cc31f8 100644 --- a/qadevOOo/runner/stats/Summarizer.java +++ b/qadevOOo/runner/stats/Summarizer.java @@ -78,7 +78,7 @@ public class Summarizer { if (states.elementAt(j).equals("not part of the job")) { - state = "Not possible since not all Interfaces/Services have been checked"; + state = "PASSED(some interfaces/services not tested).OK"; } else { diff --git a/qadevOOo/tests/java/mod/_forms/GenericModelTest.java b/qadevOOo/tests/java/mod/_forms/GenericModelTest.java index dce88234885f..5ac071c38eb5 100644 --- a/qadevOOo/tests/java/mod/_forms/GenericModelTest.java +++ b/qadevOOo/tests/java/mod/_forms/GenericModelTest.java @@ -27,6 +27,7 @@ package mod._forms; import com.sun.star.beans.NamedValue; import com.sun.star.beans.PropertyValue; +import com.sun.star.container.XIndexAccess; import java.io.PrintWriter; import lib.StatusException; @@ -251,11 +252,10 @@ public class GenericModelTest extends TestCase { if (m_ConnectionColsed) return; try { + XIndexAccess forms = UnoRuntime.queryInterface( XIndexAccess.class, + FormTools.getForms( WriterTools.getDrawPage( m_xTextDoc ) ) ); XForm myForm = (XForm) AnyConverter.toObject(new Type(XForm.class), - (FormTools.getForms( - WriterTools.getDrawPage( - m_xTextDoc))) - .getByName("Standard")); + forms.getByIndex(0)); if (debug){ if (myForm == null){ @@ -269,18 +269,20 @@ public class GenericModelTest extends TestCase { } - XPropertySet xSetProp = (XPropertySet) UnoRuntime.queryInterface( - XPropertySet.class, myForm); - XConnection connection = (XConnection) AnyConverter.toObject( - new Type(XConnection.class), - xSetProp.getPropertyValue("ActiveConnection")); - if (debug && connection == null){ - log.println("ERROR: could not get property 'ActiveConnection' from the XForm"); + XPropertySet xSetProp = UnoRuntime.queryInterface( XPropertySet.class, myForm ); + XConnection connection = UnoRuntime.queryInterface( XConnection.class, xSetProp.getPropertyValue( "ActiveConnection" ) ); + if ( connection == null ) + { + if ( debug ) + log.println("ERROR: could not get property 'ActiveConnection' from the XForm"); + } + else + { + connection.close(); } - - connection.close(); } catch (Exception e) { log.println("ERROR: Can't close the connection: " + e.toString()); + e.printStackTrace( log ); } log.println("closing data source..."); |