diff options
Diffstat (limited to 'qadevOOo/tests/java/ifc/beans/_XPropertyAccess.java')
-rw-r--r-- | qadevOOo/tests/java/ifc/beans/_XPropertyAccess.java | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/qadevOOo/tests/java/ifc/beans/_XPropertyAccess.java b/qadevOOo/tests/java/ifc/beans/_XPropertyAccess.java index 37b835431b8d..3a6de40053cc 100644 --- a/qadevOOo/tests/java/ifc/beans/_XPropertyAccess.java +++ b/qadevOOo/tests/java/ifc/beans/_XPropertyAccess.java @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -46,12 +46,12 @@ import lib.StatusException; * @see com.sun.star.beans.XPropertyAccess */ public class _XPropertyAccess extends MultiMethodTest { - + /** * oObj filled by MultiMethodTest */ public XPropertyAccess oObj = null;// oObj filled by MultiMethodTest - + /** * object relation X<CODE>PropertyAccess.propertyToChange</CODE><br> * This relation must be filled from the module. It contains a property which must @@ -59,7 +59,7 @@ public class _XPropertyAccess extends MultiMethodTest { * <CODE>setPropertyValues()</CODE> */ public PropertyValue propertyToChange = null; - + /** * checks if the object relation <CODE>XPropertyAccess.propertyToChange</CODE> * is available @@ -70,18 +70,18 @@ public class _XPropertyAccess extends MultiMethodTest { throw new StatusException(Status.failed("Object raltion 'XPropertyAccess.propertyToChange' is null")); } } - + /** * Test calls the method and checks if the returned sequenze contanis a propterty which is named * in the object relation <code>XPropertyAccess.propertyToChange</code>. */ public void _getPropertyValues() { PropertyValue[] properties = oObj.getPropertyValues(); - + boolean ok = true; - + if (properties != null){ - + boolean found = false; for (int i=0; i < properties.length; i++){ if (properties[i].Name.equals(propertyToChange.Name)) found = true; @@ -90,16 +90,16 @@ public class _XPropertyAccess extends MultiMethodTest { log.println("ERROR: could not find desired property '"+ propertyToChange.Name+"'"); ok=false; } - + } else { log.println("ERROR: the method returned NULL"); ok =false; } - + tRes.tested("getPropertyValues()", ok ); return; } - + /** * Test calls the method and checks if: * <ul> @@ -112,18 +112,18 @@ public class _XPropertyAccess extends MultiMethodTest { * </ul> */ public void _setPropertyValues(){ - + boolean ok = true; boolean test = true; boolean exp = false; - + try { PropertyValue[] newProps = new PropertyValue[1]; newProps[0] = propertyToChange; - + log.println("try to set property vlaues given by object relation 'XPropertyAccess.propertyToChange'..."); oObj.setPropertyValues(newProps); - + } catch (UnknownPropertyException ex) { log.println("ERROR: Exception was thrown while trying to set property value: " + ex.toString()); @@ -141,11 +141,11 @@ public class _XPropertyAccess extends MultiMethodTest { ex.toString()); test = false; } - + if ( test){ log.println("... OK"); } - + ok &= test; test = false; exp = false; @@ -176,29 +176,29 @@ public class _XPropertyAccess extends MultiMethodTest { ex.toString()); exp = true; } - + if (! exp){ log.println("FAILED: expected exception 'UnknownPropertyException' was not thrown"); } else { if (test) log.println("... OK"); } - + ok &= test; test = false; exp = false; try { - + log.println("try to set values with invalid property name. " + "Expect 'com.sun.star.beans.UnknownPropertyException'..."); - + PropertyValue[] newProps = new PropertyValue[1]; PropertyValue newProp = new PropertyValue(); newProp.Name = "XPropertyAccess.InvalidPropertyName"; newProp.Value = "invalid property"; newProps[0] = newProp; - + oObj.setPropertyValues(newProps); - + } catch (WrappedTargetException ex) { log.println("ERROR: unexptected exception was thrown while trying to set invalid value: " + ex.toString()); @@ -217,20 +217,20 @@ public class _XPropertyAccess extends MultiMethodTest { exp = true; test = true; } - + ok &= test; - + if (! exp){ log.println("FAILED: expected exception 'UnknownPropertyException' was not thrown"); } else { if (test) log.println("... OK"); } - + tRes.tested("setPropertyValues()", ok); return; - + } - + } /// finish class XPropertyAccess |