CheckCharacterStyle.java (07d7dbdc) | CheckCharacterStyle.java (28725c19) |
---|---|
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 --- 20 unchanged lines hidden (view full) --- 29 * 7. set the font size to 12 30 * 8. save, close, reopen, then check the font size 31 * 9. set font style to Bold, Italic 32 * 10. save, close, reopen, then check the font style 33 */ 34package fvt.uno.sd.character; 35 36import static org.junit.Assert.*; | 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 --- 20 unchanged lines hidden (view full) --- 29 * 7. set the font size to 12 30 * 8. save, close, reopen, then check the font size 31 * 9. set font style to Bold, Italic 32 * 10. save, close, reopen, then check the font style 33 */ 34package fvt.uno.sd.character; 35 36import static org.junit.Assert.*; |
37import static testlib.uno.SDUtil.saveFileAs; |
|
37 38import java.io.File; 39import org.junit.After; 40import org.junit.AfterClass; 41import org.junit.Before; 42import org.junit.BeforeClass; 43import org.junit.Test; 44import org.openoffice.test.common.FileUtil; --- 35 unchanged lines hidden (view full) --- 80 app.start(); 81 File temp = new File(Testspace.getPath("temp")); 82 temp.mkdirs(); 83 } 84 85 @AfterClass 86 public static void tearDownConnection() throws Exception { 87 app.close(); | 38 39import java.io.File; 40import org.junit.After; 41import org.junit.AfterClass; 42import org.junit.Before; 43import org.junit.BeforeClass; 44import org.junit.Test; 45import org.openoffice.test.common.FileUtil; --- 35 unchanged lines hidden (view full) --- 81 app.start(); 82 File temp = new File(Testspace.getPath("temp")); 83 temp.mkdirs(); 84 } 85 86 @AfterClass 87 public static void tearDownConnection() throws Exception { 88 app.close(); |
88 //remove the temp file 89 FileUtil.deleteFile(Testspace.getPath("temp")); | 89 |
90 } 91 92 /** 93 * @throws java.lang.Exception 94 */ 95 @Before 96 public void setUp() throws Exception { | 90 } 91 92 /** 93 * @throws java.lang.Exception 94 */ 95 @Before 96 public void setUp() throws Exception { |
97 filePath = Testspace.getPath("temp/CheckCharacterStyle.odt"); | 97 filePath = Testspace.getPath("temp/CheckCharacterStyle.odp"); |
98 if(FileUtil.fileExists(filePath)) 99 { //load 100 m_xSDComponent = (XComponent) UnoRuntime.queryInterface(XComponent.class, 101 app.loadDocument(filePath)); 102 xShapeText = getFirstTextbox(); 103 } 104 else{ 105 //create a sd --- 13 unchanged lines hidden (view full) --- 119 120 /** 121 * @throws java.lang.Exception 122 */ 123 @After 124 public void tearDown() throws Exception { 125 //close odp after each test 126 m_xSDComponent.dispose(); | 98 if(FileUtil.fileExists(filePath)) 99 { //load 100 m_xSDComponent = (XComponent) UnoRuntime.queryInterface(XComponent.class, 101 app.loadDocument(filePath)); 102 xShapeText = getFirstTextbox(); 103 } 104 else{ 105 //create a sd --- 13 unchanged lines hidden (view full) --- 119 120 /** 121 * @throws java.lang.Exception 122 */ 123 @After 124 public void tearDown() throws Exception { 125 //close odp after each test 126 m_xSDComponent.dispose(); |
127 128 //remove the temp file 129 FileUtil.deleteFile(Testspace.getPath("temp")); |
|
127 } 128 129 @Test 130 public void testFontColor() throws Exception{ 131 //set font color to red 132 xtextProps.setPropertyValue("CharColor", 0xFF0000); | 130 } 131 132 @Test 133 public void testFontColor() throws Exception{ 134 //set font color to red 135 xtextProps.setPropertyValue("CharColor", 0xFF0000); |
136// saveFileAs(m_xSDComponent, filePath, ".odp"); |
|
133 app.saveDocument(m_xSDComponent, filePath); 134 m_xSDComponent.dispose(); 135 //reopen 136 m_xSDComponent = (XComponent) UnoRuntime.queryInterface(XComponent.class, 137 app.loadDocument(filePath)); 138 xShapeText = getFirstTextbox(); 139 xtextProps = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, xShapeText); 140 //check character styles --- 60 unchanged lines hidden --- | 137 app.saveDocument(m_xSDComponent, filePath); 138 m_xSDComponent.dispose(); 139 //reopen 140 m_xSDComponent = (XComponent) UnoRuntime.queryInterface(XComponent.class, 141 app.loadDocument(filePath)); 142 xShapeText = getFirstTextbox(); 143 xtextProps = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, xShapeText); 144 //check character styles --- 60 unchanged lines hidden --- |