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 .
21 import lib
.MultiMethodTest
;
23 import com
.sun
.star
.container
.XEnumeration
;
24 import com
.sun
.star
.sheet
.XSheetCellRanges
;
25 import com
.sun
.star
.table
.CellRangeAddress
;
28 * Testing <code>com.sun.star.sheet.XSheetCellRanges</code>
31 * <li><code> getCells()</code></li>
32 * <li><code> getRangeAddressesAsString()</code></li>
33 * <li><code> getRangeAddresses()</code></li>
35 * @see com.sun.star.sheet.XSheetCellRanges
37 public class _XSheetCellRanges
extends MultiMethodTest
{
39 public XSheetCellRanges oObj
= null;
42 * Test calls the method, creates enumeration of returned value
43 * and checks that the enumeration has elements. <p>
44 * Has <b> OK </b> status if gained enumeration has elements. <p>
46 public void _getCells() {
47 log
.println("Testing getCells ...");
49 XEnumeration oEnum
= oObj
.getCells().createEnumeration();
50 boolean res
= oEnum
.hasMoreElements();
53 "The Enumeration gained via getCells() has no Elements");
55 tRes
.tested("getCells()", res
);
59 * Test calls the method and checks length of returned array. <p>
60 * Has <b> OK </b> status if length of returned array is greater than 2.<p>
62 public void _getRangeAddresses() {
63 log
.println("Testing getRangeAddresses ...");
64 CellRangeAddress
[] oRanges
= oObj
.getRangeAddresses();
65 int howmuch
= oRanges
.length
;
66 tRes
.tested("getRangeAddresses()", (howmuch
> 2) );
70 * Test calls the method and checks returned string. <p>
71 * Has <b> OK </b> status if returned string starts from 'Sheet'.<p>
73 public void _getRangeAddressesAsString() {
74 log
.println("Testing getRangeAddressesAsString ...");
75 String oRanges
= oObj
.getRangeAddressesAsString();
76 tRes
.tested("getRangeAddressesAsString()",oRanges
.indexOf("C1:D4")>0);
79 } // finished class _XSheetCellRanges