1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 package ifc.awt; 25 26 import lib.MultiMethodTest; 27 28 import com.sun.star.awt.Size; 29 import com.sun.star.awt.XTextLayoutConstrains; 30 31 /** 32 * Testing <code>com.sun.star.awt.XTextLayoutConstrains</code> 33 * interface methods: 34 * <ul> 35 * <li><code> getMinimumSize() </code></li> 36 * <li><code> getColumnsAndLines() </code></li> 37 * </ul><p> 38 * Test is <b> NOT </b> multithread compilant. <p> 39 * @see com.sun.star.awt.XTextLayoutConstrains 40 */ 41 public class _XTextLayoutConstrains extends MultiMethodTest { 42 public XTextLayoutConstrains oObj = null; 43 44 /** 45 * Test calls the method. <p> 46 * Has <b> OK </b> status if both returned size fields are not equal to zero. 47 */ _getMinimumSize()48 public void _getMinimumSize() { 49 short nCols = 0; 50 short nLines = 0; 51 Size mSize = oObj.getMinimumSize(nCols,nLines); 52 boolean res = ( (mSize.Height != 0) && (mSize.Width != 0) ); 53 if (res == false) { 54 log.println("mSize.height: " + mSize.Height); 55 log.println("mSize.width: " + mSize.Width); 56 } 57 tRes.tested("getMinimumSize()", res); 58 } 59 60 /** 61 * Test calls the method. <p> 62 * Has <b> OK </b> status if both returned values are not equal to zero. 63 */ _getColumnsAndLines()64 public void _getColumnsAndLines() { 65 short[] nCols = new short[1]; 66 short[] nLines = new short[1]; 67 oObj.getColumnsAndLines(nCols,nLines); 68 boolean res = ( (nCols[0] != 0) && (nLines[0] != 0) ); 69 if (res == false) { 70 log.println("nCols: " + nCols[0]); 71 log.println("nLines: " + nLines[0]); 72 } 73 tRes.tested("getColumnsAndLines()",res); 74 } 75 } 76 77