Branch libreoffice-5-0-4
[LibreOffice.git] / qadevOOo / tests / java / ifc / sheet / _XDDELink.java
blob5e87e3999e4abfb25c320cf05c54408387e36f13
1 /*
2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 package ifc.sheet;
21 import lib.MultiMethodTest;
22 import lib.Status;
23 import lib.StatusException;
25 import com.sun.star.sheet.XDDELink;
27 /**
28 * Testing <code>com.sun.star.sheet.XDDELink</code>
29 * interface methods :
30 * <ul>
31 * <li><code> getApplication()</code></li>
32 * <li><code> getTopic()</code></li>
33 * <li><code> getItem()</code></li>
34 * </ul> <p>
35 * This test needs the following object relations :
36 * <ul>
37 * <li> <code>'APPLICATION'</code> (of type <code>String</code>):
38 * to have application name </li>
39 * <li> <code>'ITEM'</code> (of type <code>String</code>):
40 * to have DDE item </li>
41 * <li> <code>'TOPIC'</code> (of type <code>String</code>):
42 * to have DDE topic </li>
43 * <ul> <p>
44 * @see com.sun.star.sheet.XDDELink
46 public class _XDDELink extends MultiMethodTest {
47 public XDDELink oObj = null;
49 /**
50 * Test calls the method and compares returned value to value obtained by
51 * relation <code>'APPLICATION'</code>. <p>
52 * Has <b> OK </b> status if values are equal. <p>
54 public void _getApplication(){
55 log.println("testing getApplication()");
56 boolean bResult = false;
58 String oAppl = (String)tEnv.getObjRelation("APPLICATION");
59 if (oAppl == null) throw new StatusException(Status.failed
60 ("Relation 'APPLICATION' not found"));
62 bResult = oAppl.equals(oObj.getApplication());
63 tRes.tested("getApplication()", bResult) ;
66 /**
67 * Test calls the method and compares returned value to value obtained by
68 * relation <code>'ITEM'</code>. <p>
69 * Has <b> OK </b> status if values are equal. <p>
71 public void _getItem(){
72 log.println("testing getItem()");
73 boolean bResult = false;
74 String sItem = oObj.getItem();
76 String oItem = (String)tEnv.getObjRelation("ITEM");
77 if (oItem == null) throw new StatusException(Status.failed
78 ("Relation 'ITEM' not found"));
80 bResult = oItem.equals(sItem);
81 tRes.tested("getItem()", bResult) ;
84 /**
85 * Test calls the method and compares returned value to value obtained by
86 * relation <code>'TOPIC'</code>. <p>
87 * Has <b> OK </b> status if values are equal. <p>
89 public void _getTopic(){
90 log.println("testing getTopic()");
91 boolean bResult = false;
92 String sTopic = oObj.getTopic();
94 String oTopic = (String)tEnv.getObjRelation("TOPIC");
95 if (oTopic == null) throw new StatusException(Status.failed
96 ("Relation 'TOPIC' not found"));
98 bResult = oTopic.equals(sTopic);
99 tRes.tested("getTopic()", bResult) ;