tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / qadevOOo / tests / java / ifc / chart / _ChartDataPointProperties.java
blobe7872378c746d7a4f3935428f4b8c354fc91640a
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.chart;
21 import lib.MultiPropertyTest;
22 import lib.Status;
23 import lib.StatusException;
24 import util.utils;
26 import com.sun.star.chart.XChartDocument;
27 import com.sun.star.chart.XDiagram;
29 /**
30 * Testing <code>com.sun.star.chart.ChartDataPointProperties</code>
31 * service properties :
32 * <ul>
33 * <li><code> DataCaption</code></li>
34 * <li><code> SymbolType</code></li>
35 * <li><code> SymbolBitmapURL</code></li>
36 * </ul> <p>
37 * The following predefined files needed to complete the test:
38 * <ul>
39 * <li> <code>space-metal.jpg</code> :
40 * for test of property 'SymbolBitmapURL' </li>
41 * <ul> <p>
42 * This test needs the following object relations :
43 * <ul>
44 * <li> <code>'CHARTDOC'</code> (of type <code>XChartDocument</code>):
45 * to have reference to chart document </li>
46 * <li> <code>'LINE'</code> (of type <code>XDiagram</code>):
47 * relation that use as parameter for method setDiagram of chart document </li>
48 * </ul> <p>
49 * @see com.sun.star.chart.ChartDataPointProperties
51 public class _ChartDataPointProperties extends MultiPropertyTest {
53 /**
54 * Retrieves object relations and prepares a chart document.
55 * @throws StatusException if one of relations not found.
57 @Override
58 protected void before() {
59 log.println("Setting Diagram type to LineDiagram");
60 XChartDocument doc = (XChartDocument) tEnv.getObjRelation("CHARTDOC");
61 if (doc == null) throw new StatusException(Status.failed
62 ("Relation 'CHARTDOC' not found"));
64 XDiagram Line = (XDiagram) tEnv.getObjRelation("LINE");
65 if (Line == null) throw new StatusException(Status.failed
66 ("Relation 'LINE' not found"));
68 doc.setDiagram(Line);
71 /**
72 * Tests property 'SymbolBitmapURL' using file <code>polibal.gif</code>.
74 public void _SymbolBitmapURL() {
75 try {
76 oObj.setPropertyValue(
77 "SymbolType",
78 Integer.valueOf(com.sun.star.chart.ChartSymbolType.BITMAPURL) );
79 } catch(com.sun.star.lang.WrappedTargetException e) {
80 log.println("Exception while set property value");
81 e.printStackTrace(log);
82 throw new StatusException("Exception while set property value", e);
83 } catch(com.sun.star.lang.IllegalArgumentException e) {
84 log.println("Exception while set property value");
85 e.printStackTrace(log);
86 throw new StatusException("Exception while set property value", e);
87 } catch(com.sun.star.beans.PropertyVetoException e) {
88 log.println("Exception while set property value");
89 e.printStackTrace(log);
90 throw new StatusException("Exception while set property value", e);
91 } catch(com.sun.star.beans.UnknownPropertyException e) {
92 log.println("Exception while set property value");
93 e.printStackTrace(log);
94 throw new StatusException("Exception while set property value", e);
97 try {
98 oObj.setPropertyValue(
99 "SymbolBitmapURL",
100 utils.getFullTestURL("space-metal.jpg") );
101 } catch(com.sun.star.lang.WrappedTargetException e) {
102 log.println("Exception while set property value");
103 e.printStackTrace(log);
104 throw new StatusException("Exception while set property value", e);
105 } catch(com.sun.star.lang.IllegalArgumentException e) {
106 log.println("Exception while set property value");
107 e.printStackTrace(log);
108 throw new StatusException("Exception while set property value", e);
109 } catch(com.sun.star.beans.PropertyVetoException e) {
110 log.println("Exception while set property value");
111 e.printStackTrace(log);
112 throw new StatusException("Exception while set property value", e);
113 } catch(com.sun.star.beans.UnknownPropertyException e) {
114 log.println("Exception while set property value");
115 e.printStackTrace(log);
116 throw new StatusException("Exception while set property value", e);