bump product version to 4.2.0.1
[LibreOffice.git] / qadevOOo / tests / java / ifc / beans / _XPropertyWithState.java
blobf7cf1114fdf9717ead99e8b3323f2797f3a87b39
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.beans;
21 import com.sun.star.beans.PropertyState;
22 import lib.MultiMethodTest;
24 import com.sun.star.beans.XPropertyWithState;
25 import lib.Status;
26 import lib.StatusException;
28 /**
29 * Testing <code>com.sun.star.beans.XPropertyWithState</code>
30 * interface methods :
31 * <ul>
32 * <li><code> getDefaultAsProperty()</code></li>
33 * <li><code> getStateAsProperty()</code></li>
34 * <li><code> setToDefaultAsProperty()</code></li>
35 * </ul> <p>
36 * @see com.sun.star.beans.XPropertyWithState
39 public class _XPropertyWithState extends MultiMethodTest {
41 /**
42 * the test object
44 public XPropertyWithState oObj;
47 /**
48 * Test calls the method.
49 * Test has ok status if no
50 * <CODE>com.sun.star.lang.WrappedTargetException</CODE>
51 * was thrown
53 public void _getDefaultAsProperty() {
54 try{
56 oObj.getDefaultAsProperty();
58 } catch (com.sun.star.lang.WrappedTargetException e){
59 e.printStackTrace(log);
60 throw new StatusException(Status.failed("'com.sun.star.lang.WrappedTargetException' was thrown"));
63 tRes.tested("getDefaultAsProperty()", true);
66 /**
67 * Test is ok if <CODE>getStateAsProperty()</CODE> returns
68 * as <CODE>PropertyState</CODE> which is not <CODE>null</CODE>
70 public void _getStateAsProperty() {
72 boolean res = true;
74 PropertyState propState = oObj.getStateAsProperty();
76 if (propState == null) {
77 log.println("the returned PropertyState is null -> FALSE");
78 res = false;
81 tRes.tested("getStateAsProperty()", res);
84 /**
85 * Test calls the method.
86 * Test has ok status if no
87 * <CODE>com.sun.star.lang.WrappedTargetException</CODE>
88 * was thrown
90 public void _setToDefaultAsProperty() {
91 try{
93 oObj.setToDefaultAsProperty();
95 } catch (com.sun.star.lang.WrappedTargetException e){
96 e.printStackTrace(log);
97 throw new StatusException(Status.failed("'com.sun.star.lang.WrappedTargetException' was thrown"));
100 tRes.tested("setToDefaultAsProperty()", true);