merge the formfield patch from ooo-build
[ooovba.git] / qadevOOo / tests / java / ifc / beans / _XExactName.java
blob6617390f7c1793493d7c674700d017633e855a6f
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: _XExactName.java,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 package ifc.beans;
33 import lib.MultiMethodTest;
34 import lib.Status;
35 import lib.StatusException;
37 import com.sun.star.beans.XExactName;
40 public class _XExactName extends MultiMethodTest {
41 protected String expectedName = "";
42 public XExactName oObj = null;
44 public void _getExactName() {
45 String nameFor = expectedName.toLowerCase();
47 log.println("Getting exact name for " + nameFor);
49 String getting = oObj.getExactName(nameFor);
51 boolean res = true;
53 if (getting == null) {
54 res = false;
55 } else {
56 res = getting.equals(expectedName);
59 if (!res) {
60 log.println("didn't get the expected Name:");
61 log.println("getting: " + getting);
62 log.println("Expected: " + expectedName);
65 nameFor = expectedName.toUpperCase();
67 log.println("Getting exact name for " + nameFor);
68 getting = oObj.getExactName(nameFor);
70 if (getting == null) {
71 res = false;
72 } else {
73 res &= getting.equals(expectedName);
76 if (!getting.equals(expectedName)) {
77 log.println("didn't get the expected Name:");
78 log.println("getting: " + getting);
79 log.println("Expected: " + expectedName);
82 tRes.tested("getExactName()", res);
85 /**
86 * Checking if the Object relation expectedName is given
87 * throw a StatusException if not.
89 protected void before() {
90 expectedName = (String) tEnv.getObjRelation("expectedName");
92 if (expectedName == null) {
93 throw new StatusException(Status.failed(
94 "Object relation expectedName is missing"));