Version 3.6.0.4, tag libreoffice-3.6.0.4
[LibreOffice.git] / qadevOOo / tests / java / ifc / beans / _XExactName.java
blob805510ca93e061e5af719845e9f89a761ebb028d
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 package ifc.beans;
30 import lib.MultiMethodTest;
31 import lib.Status;
32 import lib.StatusException;
34 import com.sun.star.beans.XExactName;
37 public class _XExactName extends MultiMethodTest {
38 protected String expectedName = "";
39 public XExactName oObj = null;
41 public void _getExactName() {
42 String nameFor = expectedName.toLowerCase();
44 log.println("Getting exact name for " + nameFor);
46 String getting = oObj.getExactName(nameFor);
48 boolean res = true;
50 if (getting == null) {
51 res = false;
52 } else {
53 res = getting.equals(expectedName);
56 if (!res) {
57 log.println("didn't get the expected Name:");
58 log.println("getting: " + getting);
59 log.println("Expected: " + expectedName);
62 nameFor = expectedName.toUpperCase();
64 log.println("Getting exact name for " + nameFor);
65 getting = oObj.getExactName(nameFor);
67 if (getting == null) {
68 res = false;
69 } else {
70 res &= getting.equals(expectedName);
73 if (!getting.equals(expectedName)) {
74 log.println("didn't get the expected Name:");
75 log.println("getting: " + getting);
76 log.println("Expected: " + expectedName);
79 tRes.tested("getExactName()", res);
82 /**
83 * Checking if the Object relation expectedName is given
84 * throw a StatusException if not.
86 protected void before() {
87 expectedName = (String) tEnv.getObjRelation("expectedName");
89 if (expectedName == null) {
90 throw new StatusException(Status.failed(
91 "Object relation expectedName is missing"));