1*c37bcbf4SLi Feng Wang /************************************************************** 2*c37bcbf4SLi Feng Wang * 3*c37bcbf4SLi Feng Wang * Licensed to the Apache Software Foundation (ASF) under one 4*c37bcbf4SLi Feng Wang * or more contributor license agreements. See the NOTICE file 5*c37bcbf4SLi Feng Wang * distributed with this work for additional information 6*c37bcbf4SLi Feng Wang * regarding copyright ownership. The ASF licenses this file 7*c37bcbf4SLi Feng Wang * to you under the Apache License, Version 2.0 (the 8*c37bcbf4SLi Feng Wang * "License"); you may not use this file except in compliance 9*c37bcbf4SLi Feng Wang * with the License. You may obtain a copy of the License at 10*c37bcbf4SLi Feng Wang * 11*c37bcbf4SLi Feng Wang * http://www.apache.org/licenses/LICENSE-2.0 12*c37bcbf4SLi Feng Wang * 13*c37bcbf4SLi Feng Wang * Unless required by applicable law or agreed to in writing, 14*c37bcbf4SLi Feng Wang * software distributed under the License is distributed on an 15*c37bcbf4SLi Feng Wang * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*c37bcbf4SLi Feng Wang * KIND, either express or implied. See the License for the 17*c37bcbf4SLi Feng Wang * specific language governing permissions and limitations 18*c37bcbf4SLi Feng Wang * under the License. 19*c37bcbf4SLi Feng Wang * 20*c37bcbf4SLi Feng Wang *************************************************************/ 21*c37bcbf4SLi Feng Wang 22*c37bcbf4SLi Feng Wang package fvt.gui.sd.table; 23*c37bcbf4SLi Feng Wang 24*c37bcbf4SLi Feng Wang import static org.junit.Assert.*; 25*c37bcbf4SLi Feng Wang import static testlib.gui.UIMap.*; 26*c37bcbf4SLi Feng Wang 27*c37bcbf4SLi Feng Wang import org.junit.After; 28*c37bcbf4SLi Feng Wang import org.junit.Before; 29*c37bcbf4SLi Feng Wang import org.junit.Rule; 30*c37bcbf4SLi Feng Wang import org.junit.Test; 31*c37bcbf4SLi Feng Wang import org.openoffice.test.common.Logger; 32*c37bcbf4SLi Feng Wang 33*c37bcbf4SLi Feng Wang import testlib.gui.AppTool; 34*c37bcbf4SLi Feng Wang 35*c37bcbf4SLi Feng Wang public class TableBackgroundProperty { 36*c37bcbf4SLi Feng Wang 37*c37bcbf4SLi Feng Wang @Before 38*c37bcbf4SLi Feng Wang public void setUp() throws Exception { 39*c37bcbf4SLi Feng Wang app.start(); 40*c37bcbf4SLi Feng Wang } 41*c37bcbf4SLi Feng Wang 42*c37bcbf4SLi Feng Wang @After 43*c37bcbf4SLi Feng Wang public void tearDown() throws Exception { 44*c37bcbf4SLi Feng Wang app.stop(); 45*c37bcbf4SLi Feng Wang } 46*c37bcbf4SLi Feng Wang 47*c37bcbf4SLi Feng Wang /** 48*c37bcbf4SLi Feng Wang * Test the Table Background property dialog in Presentation 49*c37bcbf4SLi Feng Wang * 50*c37bcbf4SLi Feng Wang * @throws Exception 51*c37bcbf4SLi Feng Wang */ 52*c37bcbf4SLi Feng Wang 53*c37bcbf4SLi Feng Wang @Test 54*c37bcbf4SLi Feng Wang public void testTableBackgroundPropertyDialog() throws Exception { 55*c37bcbf4SLi Feng Wang AppTool.newPresentation(); 56*c37bcbf4SLi Feng Wang 57*c37bcbf4SLi Feng Wang // Insert a table 58*c37bcbf4SLi Feng Wang app.dispatch(".uno:InsertTable", 3); 59*c37bcbf4SLi Feng Wang insertTable.ok(); 60*c37bcbf4SLi Feng Wang 61*c37bcbf4SLi Feng Wang // Verify if the table toolbar is active 62*c37bcbf4SLi Feng Wang assertTrue(tableToolbar.exists(3)); 63*c37bcbf4SLi Feng Wang 64*c37bcbf4SLi Feng Wang // open Table Properties Dialog 65*c37bcbf4SLi Feng Wang app.dispatch(".uno:TableDialog", 3); 66*c37bcbf4SLi Feng Wang areaAreapage.select(); 67*c37bcbf4SLi Feng Wang // select Color 68*c37bcbf4SLi Feng Wang areaFillType.select(1); 69*c37bcbf4SLi Feng Wang assertEquals("Area_Fill_Type is not Color", areaFillType.getSelText(), areaFillType.getItemText(1)); 70*c37bcbf4SLi Feng Wang areaFillColor.select(2); 71*c37bcbf4SLi Feng Wang // Area_Fill_Color.getItemCount(); 72*c37bcbf4SLi Feng Wang assertEquals("Area_Fill_Color is not the second item", areaFillColor.getSelText(), areaFillColor.getItemText(2)); 73*c37bcbf4SLi Feng Wang areaAreapage.ok(); 74*c37bcbf4SLi Feng Wang 75*c37bcbf4SLi Feng Wang // open Table Properties Dialog 76*c37bcbf4SLi Feng Wang app.dispatch(".uno:TableDialog", 3); 77*c37bcbf4SLi Feng Wang areaAreapage.select(); 78*c37bcbf4SLi Feng Wang // select Gradient 79*c37bcbf4SLi Feng Wang areaFillType.select(2); 80*c37bcbf4SLi Feng Wang assertEquals("Area_Fill_Type is not Gradient", areaFillType.getSelText(), areaFillType.getItemText(2)); 81*c37bcbf4SLi Feng Wang areaFillGradient.select(2); 82*c37bcbf4SLi Feng Wang assertEquals("Area_Fill_Gradient is not the second item", areaFillGradient.getSelText(), areaFillGradient.getItemText(2)); 83*c37bcbf4SLi Feng Wang areaAreapage.ok(); 84*c37bcbf4SLi Feng Wang 85*c37bcbf4SLi Feng Wang // open Table Properties Dialog 86*c37bcbf4SLi Feng Wang app.dispatch(".uno:TableDialog", 3); 87*c37bcbf4SLi Feng Wang areaAreapage.select(); 88*c37bcbf4SLi Feng Wang // select Hatching 89*c37bcbf4SLi Feng Wang areaFillType.select(3); 90*c37bcbf4SLi Feng Wang assertEquals("Area_Fill_Type is not Hatching", areaFillType.getSelText(), areaFillType.getItemText(3)); 91*c37bcbf4SLi Feng Wang areaFillHatching.select(2); 92*c37bcbf4SLi Feng Wang assertEquals("Area_Fill_Hatching is not the second item", areaFillHatching.getSelText(), areaFillHatching.getItemText(2)); 93*c37bcbf4SLi Feng Wang areaAreapage.ok(); 94*c37bcbf4SLi Feng Wang 95*c37bcbf4SLi Feng Wang // open Table Properties Dialog 96*c37bcbf4SLi Feng Wang app.dispatch(".uno:TableDialog", 3); 97*c37bcbf4SLi Feng Wang areaAreapage.select(); 98*c37bcbf4SLi Feng Wang // select Bitmap 99*c37bcbf4SLi Feng Wang areaFillType.select(4); 100*c37bcbf4SLi Feng Wang assertEquals("Area_Fill_Type is not Bitmap", areaFillType.getSelText(), areaFillType.getItemText(4)); 101*c37bcbf4SLi Feng Wang areaFillBitmap.select(2); 102*c37bcbf4SLi Feng Wang assertEquals("Area_Fill_Bitmap is not the second item", areaFillBitmap.getSelText(), areaFillBitmap.getItemText(2)); 103*c37bcbf4SLi Feng Wang areaAreapage.ok(); 104*c37bcbf4SLi Feng Wang 105*c37bcbf4SLi Feng Wang } 106*c37bcbf4SLi Feng Wang 107*c37bcbf4SLi Feng Wang } 108