Branch libreoffice-5-0-4
[LibreOffice.git] / qadevOOo / tests / java / ifc / sheet / _XScenario.java
blob4860a7a2dba4272d4d03dc7c388c24e88be5b5cd
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 .
18 package ifc.sheet;
20 import com.sun.star.sheet.XScenario;
21 import com.sun.star.table.CellRangeAddress;
22 import lib.MultiMethodTest;
23 import lib.Status;
25 /**
28 public class _XScenario extends MultiMethodTest {
29 public XScenario oObj = null;
30 CellRangeAddress address = null;
31 String comment = null;
32 boolean skipTest = false;
34 @Override
35 public void before() {
36 // testing a scenario containing the whole sheet does not make sense.
37 // test is skipped until this interface is implemented somewhere else
38 skipTest = true;
41 public void _addRanges() {
42 if (skipTest) {
43 tRes.tested("addRanges()",Status.skipped(true));
44 return;
46 oObj.addRanges(new CellRangeAddress[] {address});
47 tRes.tested("addRanges()", true);
50 public void _apply() {
51 requiredMethod("addRanges()");
52 if (skipTest) {
53 tRes.tested("apply()",Status.skipped(true));
54 return;
56 oObj.apply();
57 tRes.tested("apply()", true);
60 public void _getIsScenario() {
61 requiredMethod("apply()");
62 if (skipTest) {
63 tRes.tested("getIsScenario()",Status.skipped(true));
64 return;
66 boolean getIs = oObj.getIsScenario();
67 tRes.tested("getIsScenario()", getIs);
70 public void _getScenarioComment() {
71 if (skipTest) {
72 tRes.tested("getScenarioComment()",Status.skipped(true));
73 return;
75 comment = oObj.getScenarioComment();
76 tRes.tested("getScenarioComment()", true);
79 public void _setScenarioComment() {
80 requiredMethod("getScenarioComment()");
81 if (skipTest) {
82 tRes.tested("setScenarioComment()",Status.skipped(true));
83 return;
85 boolean res = false;
86 oObj.setScenarioComment("MyComment");
87 String c = oObj.getScenarioComment();
88 res = c.equals("MyComment");
89 oObj.setScenarioComment(comment);
90 tRes.tested("setScenarioComment()", res);