Avoid potential negative array index access to cached text.
[LibreOffice.git] / qadevOOo / tests / java / ifc / drawing / _GraphicObjectShapeDescriptor.java
blob830a065d4eec522258aa9cf2ea52806b14acb3a2
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.drawing;
21 import lib.MultiPropertyTest;
23 import com.sun.star.awt.XBitmap;
25 public class _GraphicObjectShapeDescriptor extends MultiPropertyTest {
27 @Override
28 protected boolean compare(Object ob1, Object ob2) {
30 return super.compare(ob1, ob2);
34 protected PropertyTester URLTester = new PropertyTester() {
35 @Override
36 protected Object getNewValue(String propName, Object oldValue)
37 throws java.lang.IllegalArgumentException {
38 if (oldValue.equals(util.utils.getFullTestURL("space-metal.jpg")))
39 return util.utils.getFullTestURL("crazy-blue.jpg"); else
40 return util.utils.getFullTestURL("space-metal.jpg");
42 } ;
44 protected PropertyTester BitmapTester = new PropertyTester() {
45 @Override
46 protected Object getNewValue(String propName, Object oldValue)
47 throws java.lang.IllegalArgumentException {
48 XBitmap aBitmap1=(XBitmap) tEnv.getObjRelation("Bitmap1");
49 XBitmap aBitmap2=(XBitmap) tEnv.getObjRelation("Bitmap2");
50 if (oldValue.equals(aBitmap1)) return aBitmap2; else return aBitmap1;
52 } ;
54 public void _GraphicURL() {
55 log.println("Testing with custom Property tester") ;
56 testProperty("GraphicURL", URLTester) ;
59 public void _GraphicObjectFillBitmap() {
60 log.println("Testing with custom Property tester") ;
61 testProperty("GraphicObjectFillBitmap", BitmapTester) ;