Branch libreoffice-5-0-4
[LibreOffice.git] / qadevOOo / tests / java / ifc / awt / _XTextLayoutConstrains.java
blobc15b5d0936224074f4217cf69a497ff8e8837fa8
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.awt;
21 import lib.MultiMethodTest;
23 import com.sun.star.awt.Size;
24 import com.sun.star.awt.XTextLayoutConstrains;
26 /**
27 * Testing <code>com.sun.star.awt.XTextLayoutConstrains</code>
28 * interface methods:
29 * <ul>
30 * <li><code> getMinimumSize() </code></li>
31 * <li><code> getColumnsAndLines() </code></li>
32 * </ul><p>
33 * Test is <b> NOT </b> multithread compliant. <p>
34 * @see com.sun.star.awt.XTextLayoutConstrains
36 public class _XTextLayoutConstrains extends MultiMethodTest {
37 public XTextLayoutConstrains oObj = null;
39 /**
40 * Test calls the method. <p>
41 * Has <b> OK </b> status if both returned size fields are not equal to zero.
43 public void _getMinimumSize() {
44 short nCols = 0;
45 short nLines = 0;
46 Size mSize = oObj.getMinimumSize(nCols,nLines);
47 boolean res = ( (mSize.Height != 0) && (mSize.Width != 0) );
48 if (!res) {
49 log.println("mSize.height: " + mSize.Height);
50 log.println("mSize.width: " + mSize.Width);
52 tRes.tested("getMinimumSize()", res);
55 /**
56 * Test calls the method. <p>
57 * Has <b> OK </b> status if both returned values are not equal to zero.
59 public void _getColumnsAndLines() {
60 short[] nCols = new short[1];
61 short[] nLines = new short[1];
62 oObj.getColumnsAndLines(nCols,nLines);
63 boolean res = ( (nCols[0] != 0) && (nLines[0] != 0) );
64 if (!res) {
65 log.println("nCols: " + nCols[0]);
66 log.println("nLines: " + nLines[0]);
68 tRes.tested("getColumnsAndLines()",res);