Kaydet (Commit) de8dd580 authored tarafından Oliver Bolte's avatar Oliver Bolte

INTEGRATION: CWS qadev16 (1.2.22); FILE MERGED

2004/01/13 12:14:40 sw 1.2.22.1: #114829#
üst 34c9894f
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: _XNamed.java,v $ * $RCSfile: _XNamed.java,v $
* *
* $Revision: 1.2 $ * $Revision: 1.3 $
* *
* last change:$Date: 2003-09-08 10:23:58 $ * last change:$Date: 2004-03-19 14:32:57 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -58,13 +58,14 @@ ...@@ -58,13 +58,14 @@
* *
* *
************************************************************************/ ************************************************************************/
package ifc.container; package ifc.container;
import com.sun.star.container.XNamed;
import lib.MultiMethodTest; import lib.MultiMethodTest;
import util.utils; import util.utils;
import com.sun.star.container.XNamed;
/** /**
* Testing <code>com.sun.star.container.XNamed</code> * Testing <code>com.sun.star.container.XNamed</code>
...@@ -84,7 +85,6 @@ import com.sun.star.container.XNamed; ...@@ -84,7 +85,6 @@ import com.sun.star.container.XNamed;
* @see com.sun.star.container.XNamed * @see com.sun.star.container.XNamed
*/ */
public class _XNamed extends MultiMethodTest { public class _XNamed extends MultiMethodTest {
public XNamed oObj = null; // oObj filled by MultiMethodTest public XNamed oObj = null; // oObj filled by MultiMethodTest
/** /**
...@@ -94,9 +94,8 @@ public class _XNamed extends MultiMethodTest { ...@@ -94,9 +94,8 @@ public class _XNamed extends MultiMethodTest {
* and no exceptions were thrown. <p> * and no exceptions were thrown. <p>
*/ */
public void _getName() { public void _getName() {
// write to log what we try next // write to log what we try next
log.println( "test for getName()" ); log.println("test for getName()");
boolean result = true; boolean result = true;
boolean loc_result = true; boolean loc_result = true;
...@@ -105,8 +104,12 @@ public class _XNamed extends MultiMethodTest { ...@@ -105,8 +104,12 @@ public class _XNamed extends MultiMethodTest {
loc_result = ((name = oObj.getName()) != null); loc_result = ((name = oObj.getName()) != null);
log.println("getting the name \"" + name + "\""); log.println("getting the name \"" + name + "\"");
if (loc_result) log.println("... getName() - OK"); if (loc_result) {
else log.println("... getName() - FAILED"); log.println("... getName() - OK");
} else {
log.println("... getName() - FAILED");
}
result &= loc_result; result &= loc_result;
tRes.tested("getName()", result); tRes.tested("getName()", result);
} }
...@@ -127,25 +130,30 @@ public class _XNamed extends MultiMethodTest { ...@@ -127,25 +130,30 @@ public class _XNamed extends MultiMethodTest {
* <li> <code> getName() </code> : to be sure the method works</li> * <li> <code> getName() </code> : to be sure the method works</li>
* </ul> * </ul>
*/ */
public void _setName(){ public void _setName() {
String Oname = tEnv.getTestCase().getObjectName(); String Oname = tEnv.getTestCase().getObjectName();
String nsn = (String) tEnv.getObjRelation("NoSetName"); String nsn = (String) tEnv.getObjRelation("NoSetName");
if (nsn != null) { if (nsn != null) {
Oname = nsn; Oname = nsn;
} }
if (Oname.indexOf("Exporter")>0 || nsn != null) {
log.println("With "+Oname+" setName() doesn't work"); if ((Oname.indexOf("Exporter") > 0) || (nsn != null)) {
log.println("With " + Oname + " setName() doesn't work");
log.println("see idl-file for further information"); log.println("see idl-file for further information");
tRes.tested("setName()",true); tRes.tested("setName()", true);
return; return;
} }
requiredMethod("getName()"); requiredMethod("getName()");
log.println("testing setName() ... "); log.println("testing setName() ... ");
String oldName = oObj.getName(); String oldName = oObj.getName();
String NewName = oldName == null ? "XNamed" : oldName + "X" ; String NewName = (oldName == null) ? "XNamed" : oldName + "X";
String testobjname = tEnv.getTestCase().getObjectName(); String testobjname = tEnv.getTestCase().getObjectName();
if (testobjname.equals("ScSheetLinkObj")) { if (testobjname.equals("ScSheetLinkObj")) {
// special case, here name is equals to links URL. // special case, here name is equals to links URL.
NewName = "file:///c:/somename/from/XNamed"; NewName = "file:///c:/somename/from/XNamed";
...@@ -160,6 +168,7 @@ public class _XNamed extends MultiMethodTest { ...@@ -160,6 +168,7 @@ public class _XNamed extends MultiMethodTest {
boolean result = true; boolean result = true;
boolean loc_result = true; boolean loc_result = true;
Boolean sName = (Boolean) tEnv.getObjRelation("setName"); Boolean sName = (Boolean) tEnv.getObjRelation("setName");
if (sName == null) { if (sName == null) {
log.println("set the name of object to \"" + NewName + "\""); log.println("set the name of object to \"" + NewName + "\"");
oObj.setName(NewName); oObj.setName(NewName);
...@@ -169,29 +178,22 @@ public class _XNamed extends MultiMethodTest { ...@@ -169,29 +178,22 @@ public class _XNamed extends MultiMethodTest {
log.println("getting the name \"" + name + "\""); log.println("getting the name \"" + name + "\"");
loc_result = name.equals(NewName); loc_result = name.equals(NewName);
if (loc_result) log.println("... setName() - OK"); if (loc_result) {
else log.println("... setName() - FAILED"); log.println("... setName() - OK");
result &= loc_result; } else {
log.println("... setName() - FAILED");
} }
else {
log.println("The names for the object '"+testobjname+ result &= loc_result;
oObj.setName(oldName);
} else {
log.println("The names for the object '" + testobjname +
"' are fixed."); "' are fixed.");
log.println("It is not possible to rename."); log.println("It is not possible to rename.");
log.println("So 'setName()' is always OK"); log.println("So 'setName()' is always OK");
result = sName.booleanValue(); result = sName.booleanValue();
} }
tRes.tested("setName()", result);
oObj.setName(oldName);
return;
}
/** tRes.tested("setName()", result);
* Does nothing.
*/
protected void after() {
//disposeEnvironment();
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment