poi/src/testcases/org/apache/poi/hssf/record/TestCFRuleRecord.java

361 lines
13 KiB
Java
Raw Normal View History

Merged revisions 638001-638784,638786-639486,639488-639601,639603-639836 via svnmerge from https://svn.apache.org/repos/asf/poi/trunk ........ r638803 | nick | 2008-03-19 11:57:38 +0000 (Wed, 19 Mar 2008) | 1 line Added test to show that bug #41546 is already fixed. Also rename a test file to be more consistent ........ r638804 | nick | 2008-03-19 12:01:32 +0000 (Wed, 19 Mar 2008) | 1 line Add test to show that bug #43251 is already fixed ........ r638812 | nick | 2008-03-19 12:28:56 +0000 (Wed, 19 Mar 2008) | 1 line Patch from Dmitriy from bug #30311 - Support for conditional formatting records ........ r638815 | nick | 2008-03-19 12:49:35 +0000 (Wed, 19 Mar 2008) | 1 line Fix bug #44627 - improve the thread safety of POILogFactory ........ r639231 | nick | 2008-03-20 10:06:59 +0000 (Thu, 20 Mar 2008) | 1 line Test relating to bug #44636 ........ r639232 | nick | 2008-03-20 10:16:15 +0000 (Thu, 20 Mar 2008) | 1 line Simple patch from Josh from bug #44636 - fix for RefVPtg and edit-in-excel oddness ........ r639242 | nick | 2008-03-20 11:02:39 +0000 (Thu, 20 Mar 2008) | 1 line Fix for readCompressedUnicode not moaning about length=0, from bug #44643 ........ r639254 | nick | 2008-03-20 11:43:14 +0000 (Thu, 20 Mar 2008) | 1 line Make junit happy ........ r639836 | nick | 2008-03-21 21:04:47 +0000 (Fri, 21 Mar 2008) | 1 line Tweak how you get dataformat strings out of cell styles, to be more logical, and in keeping with how we'll want to do things for xssf too ........ git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@642557 13f79535-47bb-0310-9956-ffa450edef68
2008-03-29 13:00:47 -04:00
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
package org.apache.poi.hssf.record;
import junit.framework.AssertionFailedError;
Merged revisions 638001-638784,638786-639486,639488-639601,639603-639836 via svnmerge from https://svn.apache.org/repos/asf/poi/trunk ........ r638803 | nick | 2008-03-19 11:57:38 +0000 (Wed, 19 Mar 2008) | 1 line Added test to show that bug #41546 is already fixed. Also rename a test file to be more consistent ........ r638804 | nick | 2008-03-19 12:01:32 +0000 (Wed, 19 Mar 2008) | 1 line Add test to show that bug #43251 is already fixed ........ r638812 | nick | 2008-03-19 12:28:56 +0000 (Wed, 19 Mar 2008) | 1 line Patch from Dmitriy from bug #30311 - Support for conditional formatting records ........ r638815 | nick | 2008-03-19 12:49:35 +0000 (Wed, 19 Mar 2008) | 1 line Fix bug #44627 - improve the thread safety of POILogFactory ........ r639231 | nick | 2008-03-20 10:06:59 +0000 (Thu, 20 Mar 2008) | 1 line Test relating to bug #44636 ........ r639232 | nick | 2008-03-20 10:16:15 +0000 (Thu, 20 Mar 2008) | 1 line Simple patch from Josh from bug #44636 - fix for RefVPtg and edit-in-excel oddness ........ r639242 | nick | 2008-03-20 11:02:39 +0000 (Thu, 20 Mar 2008) | 1 line Fix for readCompressedUnicode not moaning about length=0, from bug #44643 ........ r639254 | nick | 2008-03-20 11:43:14 +0000 (Thu, 20 Mar 2008) | 1 line Make junit happy ........ r639836 | nick | 2008-03-21 21:04:47 +0000 (Fri, 21 Mar 2008) | 1 line Tweak how you get dataformat strings out of cell styles, to be more logical, and in keeping with how we'll want to do things for xssf too ........ git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@642557 13f79535-47bb-0310-9956-ffa450edef68
2008-03-29 13:00:47 -04:00
import junit.framework.TestCase;
import org.apache.poi.hssf.record.CFRuleRecord.ComparisonOperator;
Merged revisions 638001-638784,638786-639486,639488-639601,639603-639836 via svnmerge from https://svn.apache.org/repos/asf/poi/trunk ........ r638803 | nick | 2008-03-19 11:57:38 +0000 (Wed, 19 Mar 2008) | 1 line Added test to show that bug #41546 is already fixed. Also rename a test file to be more consistent ........ r638804 | nick | 2008-03-19 12:01:32 +0000 (Wed, 19 Mar 2008) | 1 line Add test to show that bug #43251 is already fixed ........ r638812 | nick | 2008-03-19 12:28:56 +0000 (Wed, 19 Mar 2008) | 1 line Patch from Dmitriy from bug #30311 - Support for conditional formatting records ........ r638815 | nick | 2008-03-19 12:49:35 +0000 (Wed, 19 Mar 2008) | 1 line Fix bug #44627 - improve the thread safety of POILogFactory ........ r639231 | nick | 2008-03-20 10:06:59 +0000 (Thu, 20 Mar 2008) | 1 line Test relating to bug #44636 ........ r639232 | nick | 2008-03-20 10:16:15 +0000 (Thu, 20 Mar 2008) | 1 line Simple patch from Josh from bug #44636 - fix for RefVPtg and edit-in-excel oddness ........ r639242 | nick | 2008-03-20 11:02:39 +0000 (Thu, 20 Mar 2008) | 1 line Fix for readCompressedUnicode not moaning about length=0, from bug #44643 ........ r639254 | nick | 2008-03-20 11:43:14 +0000 (Thu, 20 Mar 2008) | 1 line Make junit happy ........ r639836 | nick | 2008-03-21 21:04:47 +0000 (Fri, 21 Mar 2008) | 1 line Tweak how you get dataformat strings out of cell styles, to be more logical, and in keeping with how we'll want to do things for xssf too ........ git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@642557 13f79535-47bb-0310-9956-ffa450edef68
2008-03-29 13:00:47 -04:00
import org.apache.poi.hssf.record.cf.BorderFormatting;
import org.apache.poi.hssf.record.cf.FontFormatting;
import org.apache.poi.hssf.record.cf.PatternFormatting;
import org.apache.poi.hssf.record.formula.Ptg;
import org.apache.poi.hssf.record.formula.RefNPtg;
import org.apache.poi.hssf.record.formula.RefPtg;
Merged revisions 638786-638802,638805-638811,638813-638814,638816-639230,639233-639241,639243-639253,639255-639486,639488-639601,639603-639835,639837-639917,639919-640056,640058-640710,640712-641156,641158-641184,641186-641795,641797-641798,641800-641933,641935-641963,641965-641966,641968-641995,641997-642230,642232-642562,642564-642565,642568-642570,642572-642573,642576-642736,642739-642877,642879,642881-642890,642892-642903,642905-642945,642947-643624,643626-643653,643655-643669,643671,643673-643830,643832-643833,643835-644342,644344-644472,644474-644508,644510-645347,645349-645351,645353-645559,645561-645565,645568-645951,645953-646193,646195-646311,646313-646404,646406-646665,646667-646853,646855-646869,646871-647151,647153-647185,647187-647277,647279-647566,647568-647573,647575,647578-647711,647714-647737,647739-647823,647825-648417 via svnmerge from https://svn.apache.org/repos/asf/poi/trunk ........ r648156 | yegor | 2008-04-15 08:54:20 +0100 (Tue, 15 Apr 2008) | 1 line TextShape is a common superclass of all shapes that can hold text. The subclasses are TextBox and AutoShape. ........ r648203 | yegor | 2008-04-15 11:05:22 +0100 (Tue, 15 Apr 2008) | 1 line start improving handling of resources in HSLF. PPFont object represents a font in a presenatation. ........ r648274 | yegor | 2008-04-15 16:11:13 +0100 (Tue, 15 Apr 2008) | 1 line TextSpecInfoAtom is present in PPT 2003+. When the text is changed we must update this record, otherwise the ppt becomes corrupted ........ r648276 | yegor | 2008-04-15 16:12:58 +0100 (Tue, 15 Apr 2008) | 1 line Improved factoring of ppt objects. For ppt tabels Slide.getShapes() returns the Table object (was ShapeGroup) ........ r648303 | nick | 2008-04-15 17:00:50 +0100 (Tue, 15 Apr 2008) | 1 line Nice and small change here... Update the formula parser code to use usermodel.HSSFWorkbook instead of model.Workbook. This should keep things a bit cleaner, and make it much easier for the formula code to work with XSSF ........ r648334 | josh | 2008-04-15 18:07:06 +0100 (Tue, 15 Apr 2008) | 1 line Conditional Formatting (30311) - API improvements, added HSSFSheetConditionalFormatting ........ git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@648444 13f79535-47bb-0310-9956-ffa450edef68
2008-04-15 18:47:30 -04:00
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
Merged revisions 638001-638784,638786-639486,639488-639601,639603-639836 via svnmerge from https://svn.apache.org/repos/asf/poi/trunk ........ r638803 | nick | 2008-03-19 11:57:38 +0000 (Wed, 19 Mar 2008) | 1 line Added test to show that bug #41546 is already fixed. Also rename a test file to be more consistent ........ r638804 | nick | 2008-03-19 12:01:32 +0000 (Wed, 19 Mar 2008) | 1 line Add test to show that bug #43251 is already fixed ........ r638812 | nick | 2008-03-19 12:28:56 +0000 (Wed, 19 Mar 2008) | 1 line Patch from Dmitriy from bug #30311 - Support for conditional formatting records ........ r638815 | nick | 2008-03-19 12:49:35 +0000 (Wed, 19 Mar 2008) | 1 line Fix bug #44627 - improve the thread safety of POILogFactory ........ r639231 | nick | 2008-03-20 10:06:59 +0000 (Thu, 20 Mar 2008) | 1 line Test relating to bug #44636 ........ r639232 | nick | 2008-03-20 10:16:15 +0000 (Thu, 20 Mar 2008) | 1 line Simple patch from Josh from bug #44636 - fix for RefVPtg and edit-in-excel oddness ........ r639242 | nick | 2008-03-20 11:02:39 +0000 (Thu, 20 Mar 2008) | 1 line Fix for readCompressedUnicode not moaning about length=0, from bug #44643 ........ r639254 | nick | 2008-03-20 11:43:14 +0000 (Thu, 20 Mar 2008) | 1 line Make junit happy ........ r639836 | nick | 2008-03-21 21:04:47 +0000 (Fri, 21 Mar 2008) | 1 line Tweak how you get dataformat strings out of cell styles, to be more logical, and in keeping with how we'll want to do things for xssf too ........ git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@642557 13f79535-47bb-0310-9956-ffa450edef68
2008-03-29 13:00:47 -04:00
import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.util.LittleEndian;
Merged revisions 638001-638784,638786-639486,639488-639601,639603-639836 via svnmerge from https://svn.apache.org/repos/asf/poi/trunk ........ r638803 | nick | 2008-03-19 11:57:38 +0000 (Wed, 19 Mar 2008) | 1 line Added test to show that bug #41546 is already fixed. Also rename a test file to be more consistent ........ r638804 | nick | 2008-03-19 12:01:32 +0000 (Wed, 19 Mar 2008) | 1 line Add test to show that bug #43251 is already fixed ........ r638812 | nick | 2008-03-19 12:28:56 +0000 (Wed, 19 Mar 2008) | 1 line Patch from Dmitriy from bug #30311 - Support for conditional formatting records ........ r638815 | nick | 2008-03-19 12:49:35 +0000 (Wed, 19 Mar 2008) | 1 line Fix bug #44627 - improve the thread safety of POILogFactory ........ r639231 | nick | 2008-03-20 10:06:59 +0000 (Thu, 20 Mar 2008) | 1 line Test relating to bug #44636 ........ r639232 | nick | 2008-03-20 10:16:15 +0000 (Thu, 20 Mar 2008) | 1 line Simple patch from Josh from bug #44636 - fix for RefVPtg and edit-in-excel oddness ........ r639242 | nick | 2008-03-20 11:02:39 +0000 (Thu, 20 Mar 2008) | 1 line Fix for readCompressedUnicode not moaning about length=0, from bug #44643 ........ r639254 | nick | 2008-03-20 11:43:14 +0000 (Thu, 20 Mar 2008) | 1 line Make junit happy ........ r639836 | nick | 2008-03-21 21:04:47 +0000 (Fri, 21 Mar 2008) | 1 line Tweak how you get dataformat strings out of cell styles, to be more logical, and in keeping with how we'll want to do things for xssf too ........ git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@642557 13f79535-47bb-0310-9956-ffa450edef68
2008-03-29 13:00:47 -04:00
/**
* Tests the serialization and deserialization of the TestCFRuleRecord
* class works correctly.
Merged revisions 638001-638784,638786-639486,639488-639601,639603-639836 via svnmerge from https://svn.apache.org/repos/asf/poi/trunk ........ r638803 | nick | 2008-03-19 11:57:38 +0000 (Wed, 19 Mar 2008) | 1 line Added test to show that bug #41546 is already fixed. Also rename a test file to be more consistent ........ r638804 | nick | 2008-03-19 12:01:32 +0000 (Wed, 19 Mar 2008) | 1 line Add test to show that bug #43251 is already fixed ........ r638812 | nick | 2008-03-19 12:28:56 +0000 (Wed, 19 Mar 2008) | 1 line Patch from Dmitriy from bug #30311 - Support for conditional formatting records ........ r638815 | nick | 2008-03-19 12:49:35 +0000 (Wed, 19 Mar 2008) | 1 line Fix bug #44627 - improve the thread safety of POILogFactory ........ r639231 | nick | 2008-03-20 10:06:59 +0000 (Thu, 20 Mar 2008) | 1 line Test relating to bug #44636 ........ r639232 | nick | 2008-03-20 10:16:15 +0000 (Thu, 20 Mar 2008) | 1 line Simple patch from Josh from bug #44636 - fix for RefVPtg and edit-in-excel oddness ........ r639242 | nick | 2008-03-20 11:02:39 +0000 (Thu, 20 Mar 2008) | 1 line Fix for readCompressedUnicode not moaning about length=0, from bug #44643 ........ r639254 | nick | 2008-03-20 11:43:14 +0000 (Thu, 20 Mar 2008) | 1 line Make junit happy ........ r639836 | nick | 2008-03-21 21:04:47 +0000 (Fri, 21 Mar 2008) | 1 line Tweak how you get dataformat strings out of cell styles, to be more logical, and in keeping with how we'll want to do things for xssf too ........ git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@642557 13f79535-47bb-0310-9956-ffa450edef68
2008-03-29 13:00:47 -04:00
*
* @author Dmitriy Kumshayev
*/
public final class TestCFRuleRecord extends TestCase
Merged revisions 638001-638784,638786-639486,639488-639601,639603-639836 via svnmerge from https://svn.apache.org/repos/asf/poi/trunk ........ r638803 | nick | 2008-03-19 11:57:38 +0000 (Wed, 19 Mar 2008) | 1 line Added test to show that bug #41546 is already fixed. Also rename a test file to be more consistent ........ r638804 | nick | 2008-03-19 12:01:32 +0000 (Wed, 19 Mar 2008) | 1 line Add test to show that bug #43251 is already fixed ........ r638812 | nick | 2008-03-19 12:28:56 +0000 (Wed, 19 Mar 2008) | 1 line Patch from Dmitriy from bug #30311 - Support for conditional formatting records ........ r638815 | nick | 2008-03-19 12:49:35 +0000 (Wed, 19 Mar 2008) | 1 line Fix bug #44627 - improve the thread safety of POILogFactory ........ r639231 | nick | 2008-03-20 10:06:59 +0000 (Thu, 20 Mar 2008) | 1 line Test relating to bug #44636 ........ r639232 | nick | 2008-03-20 10:16:15 +0000 (Thu, 20 Mar 2008) | 1 line Simple patch from Josh from bug #44636 - fix for RefVPtg and edit-in-excel oddness ........ r639242 | nick | 2008-03-20 11:02:39 +0000 (Thu, 20 Mar 2008) | 1 line Fix for readCompressedUnicode not moaning about length=0, from bug #44643 ........ r639254 | nick | 2008-03-20 11:43:14 +0000 (Thu, 20 Mar 2008) | 1 line Make junit happy ........ r639836 | nick | 2008-03-21 21:04:47 +0000 (Fri, 21 Mar 2008) | 1 line Tweak how you get dataformat strings out of cell styles, to be more logical, and in keeping with how we'll want to do things for xssf too ........ git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@642557 13f79535-47bb-0310-9956-ffa450edef68
2008-03-29 13:00:47 -04:00
{
public void testCreateCFRuleRecord ()
{
Merged revisions 638786-638802,638805-638811,638813-638814,638816-639230,639233-639241,639243-639253,639255-639486,639488-639601,639603-639835,639837-639917,639919-640056,640058-640710,640712-641156,641158-641184,641186-641795,641797-641798,641800-641933,641935-641963,641965-641966,641968-641995,641997-642230,642232-642562,642564-642565,642568-642570,642572-642573,642576-642736,642739-642877,642879,642881-642890,642892-642903,642905-642945,642947-643624,643626-643653,643655-643669,643671,643673-643830,643832-643833,643835-644342,644344-644472,644474-644508,644510-645347,645349-645351,645353-645559,645561-645565,645568-645951,645953-646193,646195-646311,646313-646404,646406-646665,646667-646853,646855-646869,646871-647151,647153-647185,647187-647277,647279-647566,647568-647573,647575,647578-647711,647714-647737,647739-647823,647825-648417 via svnmerge from https://svn.apache.org/repos/asf/poi/trunk ........ r648156 | yegor | 2008-04-15 08:54:20 +0100 (Tue, 15 Apr 2008) | 1 line TextShape is a common superclass of all shapes that can hold text. The subclasses are TextBox and AutoShape. ........ r648203 | yegor | 2008-04-15 11:05:22 +0100 (Tue, 15 Apr 2008) | 1 line start improving handling of resources in HSLF. PPFont object represents a font in a presenatation. ........ r648274 | yegor | 2008-04-15 16:11:13 +0100 (Tue, 15 Apr 2008) | 1 line TextSpecInfoAtom is present in PPT 2003+. When the text is changed we must update this record, otherwise the ppt becomes corrupted ........ r648276 | yegor | 2008-04-15 16:12:58 +0100 (Tue, 15 Apr 2008) | 1 line Improved factoring of ppt objects. For ppt tabels Slide.getShapes() returns the Table object (was ShapeGroup) ........ r648303 | nick | 2008-04-15 17:00:50 +0100 (Tue, 15 Apr 2008) | 1 line Nice and small change here... Update the formula parser code to use usermodel.HSSFWorkbook instead of model.Workbook. This should keep things a bit cleaner, and make it much easier for the formula code to work with XSSF ........ r648334 | josh | 2008-04-15 18:07:06 +0100 (Tue, 15 Apr 2008) | 1 line Conditional Formatting (30311) - API improvements, added HSSFSheetConditionalFormatting ........ git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@648444 13f79535-47bb-0310-9956-ffa450edef68
2008-04-15 18:47:30 -04:00
HSSFWorkbook workbook = new HSSFWorkbook();
CFRuleRecord record = CFRuleRecord.create(workbook, "7");
testCFRuleRecord(record);
// Serialize
byte [] serializedRecord = record.serialize();
// Strip header
byte [] recordData = new byte[serializedRecord.length-4];
System.arraycopy(serializedRecord, 4, recordData, 0, recordData.length);
// Deserialize
record = new CFRuleRecord(new TestcaseRecordInputStream(CFRuleRecord.sid, (short)recordData.length, recordData));
// Serialize again
Merged revisions 638001-638784,638786-639486,639488-639601,639603-639836 via svnmerge from https://svn.apache.org/repos/asf/poi/trunk ........ r638803 | nick | 2008-03-19 11:57:38 +0000 (Wed, 19 Mar 2008) | 1 line Added test to show that bug #41546 is already fixed. Also rename a test file to be more consistent ........ r638804 | nick | 2008-03-19 12:01:32 +0000 (Wed, 19 Mar 2008) | 1 line Add test to show that bug #43251 is already fixed ........ r638812 | nick | 2008-03-19 12:28:56 +0000 (Wed, 19 Mar 2008) | 1 line Patch from Dmitriy from bug #30311 - Support for conditional formatting records ........ r638815 | nick | 2008-03-19 12:49:35 +0000 (Wed, 19 Mar 2008) | 1 line Fix bug #44627 - improve the thread safety of POILogFactory ........ r639231 | nick | 2008-03-20 10:06:59 +0000 (Thu, 20 Mar 2008) | 1 line Test relating to bug #44636 ........ r639232 | nick | 2008-03-20 10:16:15 +0000 (Thu, 20 Mar 2008) | 1 line Simple patch from Josh from bug #44636 - fix for RefVPtg and edit-in-excel oddness ........ r639242 | nick | 2008-03-20 11:02:39 +0000 (Thu, 20 Mar 2008) | 1 line Fix for readCompressedUnicode not moaning about length=0, from bug #44643 ........ r639254 | nick | 2008-03-20 11:43:14 +0000 (Thu, 20 Mar 2008) | 1 line Make junit happy ........ r639836 | nick | 2008-03-21 21:04:47 +0000 (Fri, 21 Mar 2008) | 1 line Tweak how you get dataformat strings out of cell styles, to be more logical, and in keeping with how we'll want to do things for xssf too ........ git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@642557 13f79535-47bb-0310-9956-ffa450edef68
2008-03-29 13:00:47 -04:00
byte[] output = record.serialize();
Merged revisions 638001-638784,638786-639486,639488-639601,639603-639836 via svnmerge from https://svn.apache.org/repos/asf/poi/trunk ........ r638803 | nick | 2008-03-19 11:57:38 +0000 (Wed, 19 Mar 2008) | 1 line Added test to show that bug #41546 is already fixed. Also rename a test file to be more consistent ........ r638804 | nick | 2008-03-19 12:01:32 +0000 (Wed, 19 Mar 2008) | 1 line Add test to show that bug #43251 is already fixed ........ r638812 | nick | 2008-03-19 12:28:56 +0000 (Wed, 19 Mar 2008) | 1 line Patch from Dmitriy from bug #30311 - Support for conditional formatting records ........ r638815 | nick | 2008-03-19 12:49:35 +0000 (Wed, 19 Mar 2008) | 1 line Fix bug #44627 - improve the thread safety of POILogFactory ........ r639231 | nick | 2008-03-20 10:06:59 +0000 (Thu, 20 Mar 2008) | 1 line Test relating to bug #44636 ........ r639232 | nick | 2008-03-20 10:16:15 +0000 (Thu, 20 Mar 2008) | 1 line Simple patch from Josh from bug #44636 - fix for RefVPtg and edit-in-excel oddness ........ r639242 | nick | 2008-03-20 11:02:39 +0000 (Thu, 20 Mar 2008) | 1 line Fix for readCompressedUnicode not moaning about length=0, from bug #44643 ........ r639254 | nick | 2008-03-20 11:43:14 +0000 (Thu, 20 Mar 2008) | 1 line Make junit happy ........ r639836 | nick | 2008-03-21 21:04:47 +0000 (Fri, 21 Mar 2008) | 1 line Tweak how you get dataformat strings out of cell styles, to be more logical, and in keeping with how we'll want to do things for xssf too ........ git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@642557 13f79535-47bb-0310-9956-ffa450edef68
2008-03-29 13:00:47 -04:00
// Compare
assertEquals("Output size", recordData.length+4, output.length); //includes sid+recordlength
Merged revisions 638001-638784,638786-639486,639488-639601,639603-639836 via svnmerge from https://svn.apache.org/repos/asf/poi/trunk ........ r638803 | nick | 2008-03-19 11:57:38 +0000 (Wed, 19 Mar 2008) | 1 line Added test to show that bug #41546 is already fixed. Also rename a test file to be more consistent ........ r638804 | nick | 2008-03-19 12:01:32 +0000 (Wed, 19 Mar 2008) | 1 line Add test to show that bug #43251 is already fixed ........ r638812 | nick | 2008-03-19 12:28:56 +0000 (Wed, 19 Mar 2008) | 1 line Patch from Dmitriy from bug #30311 - Support for conditional formatting records ........ r638815 | nick | 2008-03-19 12:49:35 +0000 (Wed, 19 Mar 2008) | 1 line Fix bug #44627 - improve the thread safety of POILogFactory ........ r639231 | nick | 2008-03-20 10:06:59 +0000 (Thu, 20 Mar 2008) | 1 line Test relating to bug #44636 ........ r639232 | nick | 2008-03-20 10:16:15 +0000 (Thu, 20 Mar 2008) | 1 line Simple patch from Josh from bug #44636 - fix for RefVPtg and edit-in-excel oddness ........ r639242 | nick | 2008-03-20 11:02:39 +0000 (Thu, 20 Mar 2008) | 1 line Fix for readCompressedUnicode not moaning about length=0, from bug #44643 ........ r639254 | nick | 2008-03-20 11:43:14 +0000 (Thu, 20 Mar 2008) | 1 line Make junit happy ........ r639836 | nick | 2008-03-21 21:04:47 +0000 (Fri, 21 Mar 2008) | 1 line Tweak how you get dataformat strings out of cell styles, to be more logical, and in keeping with how we'll want to do things for xssf too ........ git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@642557 13f79535-47bb-0310-9956-ffa450edef68
2008-03-29 13:00:47 -04:00
for (int i = 0; i < recordData.length;i++)
{
assertEquals("CFRuleRecord doesn't match", recordData[i], output[i+4]);
}
}
Merged revisions 638001-638784,638786-639486,639488-639601,639603-639836 via svnmerge from https://svn.apache.org/repos/asf/poi/trunk ........ r638803 | nick | 2008-03-19 11:57:38 +0000 (Wed, 19 Mar 2008) | 1 line Added test to show that bug #41546 is already fixed. Also rename a test file to be more consistent ........ r638804 | nick | 2008-03-19 12:01:32 +0000 (Wed, 19 Mar 2008) | 1 line Add test to show that bug #43251 is already fixed ........ r638812 | nick | 2008-03-19 12:28:56 +0000 (Wed, 19 Mar 2008) | 1 line Patch from Dmitriy from bug #30311 - Support for conditional formatting records ........ r638815 | nick | 2008-03-19 12:49:35 +0000 (Wed, 19 Mar 2008) | 1 line Fix bug #44627 - improve the thread safety of POILogFactory ........ r639231 | nick | 2008-03-20 10:06:59 +0000 (Thu, 20 Mar 2008) | 1 line Test relating to bug #44636 ........ r639232 | nick | 2008-03-20 10:16:15 +0000 (Thu, 20 Mar 2008) | 1 line Simple patch from Josh from bug #44636 - fix for RefVPtg and edit-in-excel oddness ........ r639242 | nick | 2008-03-20 11:02:39 +0000 (Thu, 20 Mar 2008) | 1 line Fix for readCompressedUnicode not moaning about length=0, from bug #44643 ........ r639254 | nick | 2008-03-20 11:43:14 +0000 (Thu, 20 Mar 2008) | 1 line Make junit happy ........ r639836 | nick | 2008-03-21 21:04:47 +0000 (Fri, 21 Mar 2008) | 1 line Tweak how you get dataformat strings out of cell styles, to be more logical, and in keeping with how we'll want to do things for xssf too ........ git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@642557 13f79535-47bb-0310-9956-ffa450edef68
2008-03-29 13:00:47 -04:00
private void testCFRuleRecord(CFRuleRecord record)
{
FontFormatting fontFormatting = new FontFormatting();
testFontFormattingAccessors(fontFormatting);
assertFalse(record.containsFontFormattingBlock());
record.setFontFormatting(fontFormatting);
assertTrue(record.containsFontFormattingBlock());
BorderFormatting borderFormatting = new BorderFormatting();
testBorderFormattingAccessors(borderFormatting);
assertFalse(record.containsBorderFormattingBlock());
record.setBorderFormatting(borderFormatting);
assertTrue(record.containsBorderFormattingBlock());
assertFalse(record.isLeftBorderModified());
record.setLeftBorderModified(true);
assertTrue(record.isLeftBorderModified());
assertFalse(record.isRightBorderModified());
record.setRightBorderModified(true);
assertTrue(record.isRightBorderModified());
assertFalse(record.isTopBorderModified());
record.setTopBorderModified(true);
assertTrue(record.isTopBorderModified());
assertFalse(record.isBottomBorderModified());
record.setBottomBorderModified(true);
assertTrue(record.isBottomBorderModified());
assertFalse(record.isTopLeftBottomRightBorderModified());
record.setTopLeftBottomRightBorderModified(true);
assertTrue(record.isTopLeftBottomRightBorderModified());
assertFalse(record.isBottomLeftTopRightBorderModified());
record.setBottomLeftTopRightBorderModified(true);
assertTrue(record.isBottomLeftTopRightBorderModified());
PatternFormatting patternFormatting = new PatternFormatting();
testPatternFormattingAccessors(patternFormatting);
assertFalse(record.containsPatternFormattingBlock());
record.setPatternFormatting(patternFormatting);
assertTrue(record.containsPatternFormattingBlock());
assertFalse(record.isPatternBackgroundColorModified());
record.setPatternBackgroundColorModified(true);
assertTrue(record.isPatternBackgroundColorModified());
assertFalse(record.isPatternColorModified());
record.setPatternColorModified(true);
assertTrue(record.isPatternColorModified());
assertFalse(record.isPatternStyleModified());
record.setPatternStyleModified(true);
assertTrue(record.isPatternStyleModified());
Merged revisions 638001-638784,638786-639486,639488-639601,639603-639836 via svnmerge from https://svn.apache.org/repos/asf/poi/trunk ........ r638803 | nick | 2008-03-19 11:57:38 +0000 (Wed, 19 Mar 2008) | 1 line Added test to show that bug #41546 is already fixed. Also rename a test file to be more consistent ........ r638804 | nick | 2008-03-19 12:01:32 +0000 (Wed, 19 Mar 2008) | 1 line Add test to show that bug #43251 is already fixed ........ r638812 | nick | 2008-03-19 12:28:56 +0000 (Wed, 19 Mar 2008) | 1 line Patch from Dmitriy from bug #30311 - Support for conditional formatting records ........ r638815 | nick | 2008-03-19 12:49:35 +0000 (Wed, 19 Mar 2008) | 1 line Fix bug #44627 - improve the thread safety of POILogFactory ........ r639231 | nick | 2008-03-20 10:06:59 +0000 (Thu, 20 Mar 2008) | 1 line Test relating to bug #44636 ........ r639232 | nick | 2008-03-20 10:16:15 +0000 (Thu, 20 Mar 2008) | 1 line Simple patch from Josh from bug #44636 - fix for RefVPtg and edit-in-excel oddness ........ r639242 | nick | 2008-03-20 11:02:39 +0000 (Thu, 20 Mar 2008) | 1 line Fix for readCompressedUnicode not moaning about length=0, from bug #44643 ........ r639254 | nick | 2008-03-20 11:43:14 +0000 (Thu, 20 Mar 2008) | 1 line Make junit happy ........ r639836 | nick | 2008-03-21 21:04:47 +0000 (Fri, 21 Mar 2008) | 1 line Tweak how you get dataformat strings out of cell styles, to be more logical, and in keeping with how we'll want to do things for xssf too ........ git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@642557 13f79535-47bb-0310-9956-ffa450edef68
2008-03-29 13:00:47 -04:00
}
private void testPatternFormattingAccessors(PatternFormatting patternFormatting)
{
patternFormatting.setFillBackgroundColor(HSSFColor.GREEN.index);
assertEquals(HSSFColor.GREEN.index,patternFormatting.getFillBackgroundColor());
patternFormatting.setFillForegroundColor(HSSFColor.INDIGO.index);
assertEquals(HSSFColor.INDIGO.index,patternFormatting.getFillForegroundColor());
Merged revisions 638001-638784,638786-639486,639488-639601,639603-639836 via svnmerge from https://svn.apache.org/repos/asf/poi/trunk ........ r638803 | nick | 2008-03-19 11:57:38 +0000 (Wed, 19 Mar 2008) | 1 line Added test to show that bug #41546 is already fixed. Also rename a test file to be more consistent ........ r638804 | nick | 2008-03-19 12:01:32 +0000 (Wed, 19 Mar 2008) | 1 line Add test to show that bug #43251 is already fixed ........ r638812 | nick | 2008-03-19 12:28:56 +0000 (Wed, 19 Mar 2008) | 1 line Patch from Dmitriy from bug #30311 - Support for conditional formatting records ........ r638815 | nick | 2008-03-19 12:49:35 +0000 (Wed, 19 Mar 2008) | 1 line Fix bug #44627 - improve the thread safety of POILogFactory ........ r639231 | nick | 2008-03-20 10:06:59 +0000 (Thu, 20 Mar 2008) | 1 line Test relating to bug #44636 ........ r639232 | nick | 2008-03-20 10:16:15 +0000 (Thu, 20 Mar 2008) | 1 line Simple patch from Josh from bug #44636 - fix for RefVPtg and edit-in-excel oddness ........ r639242 | nick | 2008-03-20 11:02:39 +0000 (Thu, 20 Mar 2008) | 1 line Fix for readCompressedUnicode not moaning about length=0, from bug #44643 ........ r639254 | nick | 2008-03-20 11:43:14 +0000 (Thu, 20 Mar 2008) | 1 line Make junit happy ........ r639836 | nick | 2008-03-21 21:04:47 +0000 (Fri, 21 Mar 2008) | 1 line Tweak how you get dataformat strings out of cell styles, to be more logical, and in keeping with how we'll want to do things for xssf too ........ git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@642557 13f79535-47bb-0310-9956-ffa450edef68
2008-03-29 13:00:47 -04:00
patternFormatting.setFillPattern(PatternFormatting.DIAMONDS);
assertEquals(PatternFormatting.DIAMONDS,patternFormatting.getFillPattern());
}
private void testBorderFormattingAccessors(BorderFormatting borderFormatting)
{
borderFormatting.setBackwardDiagonalOn(false);
assertFalse(borderFormatting.isBackwardDiagonalOn());
borderFormatting.setBackwardDiagonalOn(true);
assertTrue(borderFormatting.isBackwardDiagonalOn());
Merged revisions 638001-638784,638786-639486,639488-639601,639603-639836 via svnmerge from https://svn.apache.org/repos/asf/poi/trunk ........ r638803 | nick | 2008-03-19 11:57:38 +0000 (Wed, 19 Mar 2008) | 1 line Added test to show that bug #41546 is already fixed. Also rename a test file to be more consistent ........ r638804 | nick | 2008-03-19 12:01:32 +0000 (Wed, 19 Mar 2008) | 1 line Add test to show that bug #43251 is already fixed ........ r638812 | nick | 2008-03-19 12:28:56 +0000 (Wed, 19 Mar 2008) | 1 line Patch from Dmitriy from bug #30311 - Support for conditional formatting records ........ r638815 | nick | 2008-03-19 12:49:35 +0000 (Wed, 19 Mar 2008) | 1 line Fix bug #44627 - improve the thread safety of POILogFactory ........ r639231 | nick | 2008-03-20 10:06:59 +0000 (Thu, 20 Mar 2008) | 1 line Test relating to bug #44636 ........ r639232 | nick | 2008-03-20 10:16:15 +0000 (Thu, 20 Mar 2008) | 1 line Simple patch from Josh from bug #44636 - fix for RefVPtg and edit-in-excel oddness ........ r639242 | nick | 2008-03-20 11:02:39 +0000 (Thu, 20 Mar 2008) | 1 line Fix for readCompressedUnicode not moaning about length=0, from bug #44643 ........ r639254 | nick | 2008-03-20 11:43:14 +0000 (Thu, 20 Mar 2008) | 1 line Make junit happy ........ r639836 | nick | 2008-03-21 21:04:47 +0000 (Fri, 21 Mar 2008) | 1 line Tweak how you get dataformat strings out of cell styles, to be more logical, and in keeping with how we'll want to do things for xssf too ........ git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@642557 13f79535-47bb-0310-9956-ffa450edef68
2008-03-29 13:00:47 -04:00
borderFormatting.setBorderBottom(BorderFormatting.BORDER_DOTTED);
assertEquals(BorderFormatting.BORDER_DOTTED, borderFormatting.getBorderBottom());
Merged revisions 638001-638784,638786-639486,639488-639601,639603-639836 via svnmerge from https://svn.apache.org/repos/asf/poi/trunk ........ r638803 | nick | 2008-03-19 11:57:38 +0000 (Wed, 19 Mar 2008) | 1 line Added test to show that bug #41546 is already fixed. Also rename a test file to be more consistent ........ r638804 | nick | 2008-03-19 12:01:32 +0000 (Wed, 19 Mar 2008) | 1 line Add test to show that bug #43251 is already fixed ........ r638812 | nick | 2008-03-19 12:28:56 +0000 (Wed, 19 Mar 2008) | 1 line Patch from Dmitriy from bug #30311 - Support for conditional formatting records ........ r638815 | nick | 2008-03-19 12:49:35 +0000 (Wed, 19 Mar 2008) | 1 line Fix bug #44627 - improve the thread safety of POILogFactory ........ r639231 | nick | 2008-03-20 10:06:59 +0000 (Thu, 20 Mar 2008) | 1 line Test relating to bug #44636 ........ r639232 | nick | 2008-03-20 10:16:15 +0000 (Thu, 20 Mar 2008) | 1 line Simple patch from Josh from bug #44636 - fix for RefVPtg and edit-in-excel oddness ........ r639242 | nick | 2008-03-20 11:02:39 +0000 (Thu, 20 Mar 2008) | 1 line Fix for readCompressedUnicode not moaning about length=0, from bug #44643 ........ r639254 | nick | 2008-03-20 11:43:14 +0000 (Thu, 20 Mar 2008) | 1 line Make junit happy ........ r639836 | nick | 2008-03-21 21:04:47 +0000 (Fri, 21 Mar 2008) | 1 line Tweak how you get dataformat strings out of cell styles, to be more logical, and in keeping with how we'll want to do things for xssf too ........ git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@642557 13f79535-47bb-0310-9956-ffa450edef68
2008-03-29 13:00:47 -04:00
borderFormatting.setBorderDiagonal(BorderFormatting.BORDER_MEDIUM);
assertEquals(BorderFormatting.BORDER_MEDIUM, borderFormatting.getBorderDiagonal());
Merged revisions 638001-638784,638786-639486,639488-639601,639603-639836 via svnmerge from https://svn.apache.org/repos/asf/poi/trunk ........ r638803 | nick | 2008-03-19 11:57:38 +0000 (Wed, 19 Mar 2008) | 1 line Added test to show that bug #41546 is already fixed. Also rename a test file to be more consistent ........ r638804 | nick | 2008-03-19 12:01:32 +0000 (Wed, 19 Mar 2008) | 1 line Add test to show that bug #43251 is already fixed ........ r638812 | nick | 2008-03-19 12:28:56 +0000 (Wed, 19 Mar 2008) | 1 line Patch from Dmitriy from bug #30311 - Support for conditional formatting records ........ r638815 | nick | 2008-03-19 12:49:35 +0000 (Wed, 19 Mar 2008) | 1 line Fix bug #44627 - improve the thread safety of POILogFactory ........ r639231 | nick | 2008-03-20 10:06:59 +0000 (Thu, 20 Mar 2008) | 1 line Test relating to bug #44636 ........ r639232 | nick | 2008-03-20 10:16:15 +0000 (Thu, 20 Mar 2008) | 1 line Simple patch from Josh from bug #44636 - fix for RefVPtg and edit-in-excel oddness ........ r639242 | nick | 2008-03-20 11:02:39 +0000 (Thu, 20 Mar 2008) | 1 line Fix for readCompressedUnicode not moaning about length=0, from bug #44643 ........ r639254 | nick | 2008-03-20 11:43:14 +0000 (Thu, 20 Mar 2008) | 1 line Make junit happy ........ r639836 | nick | 2008-03-21 21:04:47 +0000 (Fri, 21 Mar 2008) | 1 line Tweak how you get dataformat strings out of cell styles, to be more logical, and in keeping with how we'll want to do things for xssf too ........ git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@642557 13f79535-47bb-0310-9956-ffa450edef68
2008-03-29 13:00:47 -04:00
borderFormatting.setBorderLeft(BorderFormatting.BORDER_MEDIUM_DASH_DOT_DOT);
assertEquals(BorderFormatting.BORDER_MEDIUM_DASH_DOT_DOT, borderFormatting.getBorderLeft());
borderFormatting.setBorderRight(BorderFormatting.BORDER_MEDIUM_DASHED);
assertEquals(BorderFormatting.BORDER_MEDIUM_DASHED, borderFormatting.getBorderRight());
borderFormatting.setBorderTop(BorderFormatting.BORDER_HAIR);
assertEquals(BorderFormatting.BORDER_HAIR, borderFormatting.getBorderTop());
borderFormatting.setBottomBorderColor(HSSFColor.AQUA.index);
assertEquals(HSSFColor.AQUA.index, borderFormatting.getBottomBorderColor());
borderFormatting.setDiagonalBorderColor(HSSFColor.RED.index);
assertEquals(HSSFColor.RED.index, borderFormatting.getDiagonalBorderColor());
assertFalse(borderFormatting.isForwardDiagonalOn());
borderFormatting.setForwardDiagonalOn(true);
assertTrue(borderFormatting.isForwardDiagonalOn());
borderFormatting.setLeftBorderColor(HSSFColor.BLACK.index);
assertEquals(HSSFColor.BLACK.index, borderFormatting.getLeftBorderColor());
borderFormatting.setRightBorderColor(HSSFColor.BLUE.index);
assertEquals(HSSFColor.BLUE.index, borderFormatting.getRightBorderColor());
borderFormatting.setTopBorderColor(HSSFColor.GOLD.index);
assertEquals(HSSFColor.GOLD.index, borderFormatting.getTopBorderColor());
}
Merged revisions 638001-638784,638786-639486,639488-639601,639603-639836 via svnmerge from https://svn.apache.org/repos/asf/poi/trunk ........ r638803 | nick | 2008-03-19 11:57:38 +0000 (Wed, 19 Mar 2008) | 1 line Added test to show that bug #41546 is already fixed. Also rename a test file to be more consistent ........ r638804 | nick | 2008-03-19 12:01:32 +0000 (Wed, 19 Mar 2008) | 1 line Add test to show that bug #43251 is already fixed ........ r638812 | nick | 2008-03-19 12:28:56 +0000 (Wed, 19 Mar 2008) | 1 line Patch from Dmitriy from bug #30311 - Support for conditional formatting records ........ r638815 | nick | 2008-03-19 12:49:35 +0000 (Wed, 19 Mar 2008) | 1 line Fix bug #44627 - improve the thread safety of POILogFactory ........ r639231 | nick | 2008-03-20 10:06:59 +0000 (Thu, 20 Mar 2008) | 1 line Test relating to bug #44636 ........ r639232 | nick | 2008-03-20 10:16:15 +0000 (Thu, 20 Mar 2008) | 1 line Simple patch from Josh from bug #44636 - fix for RefVPtg and edit-in-excel oddness ........ r639242 | nick | 2008-03-20 11:02:39 +0000 (Thu, 20 Mar 2008) | 1 line Fix for readCompressedUnicode not moaning about length=0, from bug #44643 ........ r639254 | nick | 2008-03-20 11:43:14 +0000 (Thu, 20 Mar 2008) | 1 line Make junit happy ........ r639836 | nick | 2008-03-21 21:04:47 +0000 (Fri, 21 Mar 2008) | 1 line Tweak how you get dataformat strings out of cell styles, to be more logical, and in keeping with how we'll want to do things for xssf too ........ git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@642557 13f79535-47bb-0310-9956-ffa450edef68
2008-03-29 13:00:47 -04:00
private void testFontFormattingAccessors(FontFormatting fontFormatting)
{
// Check for defaults
assertFalse(fontFormatting.isEscapementTypeModified());
assertFalse(fontFormatting.isFontCancellationModified());
assertFalse(fontFormatting.isFontOutlineModified());
assertFalse(fontFormatting.isFontShadowModified());
assertFalse(fontFormatting.isFontStyleModified());
assertFalse(fontFormatting.isUnderlineTypeModified());
assertFalse(fontFormatting.isFontWeightModified());
assertFalse(fontFormatting.isBold());
assertFalse(fontFormatting.isItalic());
assertFalse(fontFormatting.isOutlineOn());
assertFalse(fontFormatting.isShadowOn());
assertFalse(fontFormatting.isStruckout());
assertEquals(0, fontFormatting.getEscapementType());
assertEquals(-1, fontFormatting.getFontColorIndex());
assertEquals(-1, fontFormatting.getFontHeight());
assertEquals(0, fontFormatting.getFontWeight());
assertEquals(0, fontFormatting.getUnderlineType());
fontFormatting.setBold(true);
assertTrue(fontFormatting.isBold());
fontFormatting.setBold(false);
assertFalse(fontFormatting.isBold());
fontFormatting.setEscapementType(FontFormatting.SS_SUB);
assertEquals(FontFormatting.SS_SUB, fontFormatting.getEscapementType());
fontFormatting.setEscapementType(FontFormatting.SS_SUPER);
assertEquals(FontFormatting.SS_SUPER, fontFormatting.getEscapementType());
fontFormatting.setEscapementType(FontFormatting.SS_NONE);
assertEquals(FontFormatting.SS_NONE, fontFormatting.getEscapementType());
fontFormatting.setEscapementTypeModified(false);
assertFalse(fontFormatting.isEscapementTypeModified());
fontFormatting.setEscapementTypeModified(true);
assertTrue(fontFormatting.isEscapementTypeModified());
fontFormatting.setFontWieghtModified(false);
assertFalse(fontFormatting.isFontWeightModified());
fontFormatting.setFontWieghtModified(true);
assertTrue(fontFormatting.isFontWeightModified());
fontFormatting.setFontCancellationModified(false);
assertFalse(fontFormatting.isFontCancellationModified());
fontFormatting.setFontCancellationModified(true);
assertTrue(fontFormatting.isFontCancellationModified());
fontFormatting.setFontColorIndex((short)10);
assertEquals(10,fontFormatting.getFontColorIndex());
fontFormatting.setFontHeight(100);
assertEquals(100,fontFormatting.getFontHeight());
fontFormatting.setFontOutlineModified(false);
assertFalse(fontFormatting.isFontOutlineModified());
fontFormatting.setFontOutlineModified(true);
assertTrue(fontFormatting.isFontOutlineModified());
fontFormatting.setFontShadowModified(false);
assertFalse(fontFormatting.isFontShadowModified());
fontFormatting.setFontShadowModified(true);
assertTrue(fontFormatting.isFontShadowModified());
fontFormatting.setFontStyleModified(false);
assertFalse(fontFormatting.isFontStyleModified());
fontFormatting.setFontStyleModified(true);
assertTrue(fontFormatting.isFontStyleModified());
fontFormatting.setItalic(false);
assertFalse(fontFormatting.isItalic());
fontFormatting.setItalic(true);
assertTrue(fontFormatting.isItalic());
fontFormatting.setOutline(false);
assertFalse(fontFormatting.isOutlineOn());
fontFormatting.setOutline(true);
assertTrue(fontFormatting.isOutlineOn());
fontFormatting.setShadow(false);
assertFalse(fontFormatting.isShadowOn());
fontFormatting.setShadow(true);
assertTrue(fontFormatting.isShadowOn());
fontFormatting.setStrikeout(false);
assertFalse(fontFormatting.isStruckout());
fontFormatting.setStrikeout(true);
assertTrue(fontFormatting.isStruckout());
fontFormatting.setUnderlineType(FontFormatting.U_DOUBLE_ACCOUNTING);
assertEquals(FontFormatting.U_DOUBLE_ACCOUNTING, fontFormatting.getUnderlineType());
fontFormatting.setUnderlineTypeModified(false);
assertFalse(fontFormatting.isUnderlineTypeModified());
fontFormatting.setUnderlineTypeModified(true);
assertTrue(fontFormatting.isUnderlineTypeModified());
Merged revisions 638001-638784,638786-639486,639488-639601,639603-639836 via svnmerge from https://svn.apache.org/repos/asf/poi/trunk ........ r638803 | nick | 2008-03-19 11:57:38 +0000 (Wed, 19 Mar 2008) | 1 line Added test to show that bug #41546 is already fixed. Also rename a test file to be more consistent ........ r638804 | nick | 2008-03-19 12:01:32 +0000 (Wed, 19 Mar 2008) | 1 line Add test to show that bug #43251 is already fixed ........ r638812 | nick | 2008-03-19 12:28:56 +0000 (Wed, 19 Mar 2008) | 1 line Patch from Dmitriy from bug #30311 - Support for conditional formatting records ........ r638815 | nick | 2008-03-19 12:49:35 +0000 (Wed, 19 Mar 2008) | 1 line Fix bug #44627 - improve the thread safety of POILogFactory ........ r639231 | nick | 2008-03-20 10:06:59 +0000 (Thu, 20 Mar 2008) | 1 line Test relating to bug #44636 ........ r639232 | nick | 2008-03-20 10:16:15 +0000 (Thu, 20 Mar 2008) | 1 line Simple patch from Josh from bug #44636 - fix for RefVPtg and edit-in-excel oddness ........ r639242 | nick | 2008-03-20 11:02:39 +0000 (Thu, 20 Mar 2008) | 1 line Fix for readCompressedUnicode not moaning about length=0, from bug #44643 ........ r639254 | nick | 2008-03-20 11:43:14 +0000 (Thu, 20 Mar 2008) | 1 line Make junit happy ........ r639836 | nick | 2008-03-21 21:04:47 +0000 (Fri, 21 Mar 2008) | 1 line Tweak how you get dataformat strings out of cell styles, to be more logical, and in keeping with how we'll want to do things for xssf too ........ git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@642557 13f79535-47bb-0310-9956-ffa450edef68
2008-03-29 13:00:47 -04:00
}
public void testWrite() {
Merged revisions 638786-638802,638805-638811,638813-638814,638816-639230,639233-639241,639243-639253,639255-639486,639488-639601,639603-639835,639837-639917,639919-640056,640058-640710,640712-641156,641158-641184,641186-641795,641797-641798,641800-641933,641935-641963,641965-641966,641968-641995,641997-642230,642232-642562,642564-642565,642568-642570,642572-642573,642576-642736,642739-642877,642879,642881-642890,642892-642903,642905-642945,642947-643624,643626-643653,643655-643669,643671,643673-643830,643832-643833,643835-644342,644344-644472,644474-644508,644510-645347,645349-645351,645353-645559,645561-645565,645568-645951,645953-646193,646195-646311,646313-646404,646406-646665,646667-646853,646855-646869,646871-647151,647153-647185,647187-647277,647279-647566,647568-647573,647575,647578-647711,647714-647737,647739-647823,647825-648417 via svnmerge from https://svn.apache.org/repos/asf/poi/trunk ........ r648156 | yegor | 2008-04-15 08:54:20 +0100 (Tue, 15 Apr 2008) | 1 line TextShape is a common superclass of all shapes that can hold text. The subclasses are TextBox and AutoShape. ........ r648203 | yegor | 2008-04-15 11:05:22 +0100 (Tue, 15 Apr 2008) | 1 line start improving handling of resources in HSLF. PPFont object represents a font in a presenatation. ........ r648274 | yegor | 2008-04-15 16:11:13 +0100 (Tue, 15 Apr 2008) | 1 line TextSpecInfoAtom is present in PPT 2003+. When the text is changed we must update this record, otherwise the ppt becomes corrupted ........ r648276 | yegor | 2008-04-15 16:12:58 +0100 (Tue, 15 Apr 2008) | 1 line Improved factoring of ppt objects. For ppt tabels Slide.getShapes() returns the Table object (was ShapeGroup) ........ r648303 | nick | 2008-04-15 17:00:50 +0100 (Tue, 15 Apr 2008) | 1 line Nice and small change here... Update the formula parser code to use usermodel.HSSFWorkbook instead of model.Workbook. This should keep things a bit cleaner, and make it much easier for the formula code to work with XSSF ........ r648334 | josh | 2008-04-15 18:07:06 +0100 (Tue, 15 Apr 2008) | 1 line Conditional Formatting (30311) - API improvements, added HSSFSheetConditionalFormatting ........ git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@648444 13f79535-47bb-0310-9956-ffa450edef68
2008-04-15 18:47:30 -04:00
HSSFWorkbook workbook = new HSSFWorkbook();
CFRuleRecord rr = CFRuleRecord.create(workbook, ComparisonOperator.BETWEEN, "5", "10");
PatternFormatting patternFormatting = new PatternFormatting();
patternFormatting.setFillPattern(PatternFormatting.BRICKS);
rr.setPatternFormatting(patternFormatting);
byte[] data = rr.serialize();
assertEquals(26, data.length);
assertEquals(3, LittleEndian.getShort(data, 6));
assertEquals(3, LittleEndian.getShort(data, 8));
int flags = LittleEndian.getInt(data, 10);
assertEquals("unused flags should be 111", 0x00380000, flags & 0x00380000);
assertEquals("undocumented flags should be 0000", 0, flags & 0x03C00000); // Otherwise Excel gets unhappy
Merged revisions 638786-638802,638805-638811,638813-638814,638816-639230,639233-639241,639243-639253,639255-639486,639488-639601,639603-639835,639837-639917,639919-640056,640058-640710,640712-641156,641158-641184,641186-641795,641797-641798,641800-641933,641935-641963,641965-641966,641968-641995,641997-642230,642232-642562,642564-642565,642568-642570,642572-642573,642576-642736,642739-642877,642879,642881-642890,642892-642903,642905-642945,642947-643624,643626-643653,643655-643669,643671,643673-643830,643832-643833,643835-644342,644344-644472,644474-644508,644510-645347,645349-645351,645353-645559,645561-645565,645568-645951,645953-646193,646195-646311,646313-646404,646406-646665,646667-646853,646855-646869,646871-647151,647153-647185,647187-647277,647279-647566,647568-647573,647575,647578-647711,647714-647737,647739-647823,647825-648417 via svnmerge from https://svn.apache.org/repos/asf/poi/trunk ........ r648156 | yegor | 2008-04-15 08:54:20 +0100 (Tue, 15 Apr 2008) | 1 line TextShape is a common superclass of all shapes that can hold text. The subclasses are TextBox and AutoShape. ........ r648203 | yegor | 2008-04-15 11:05:22 +0100 (Tue, 15 Apr 2008) | 1 line start improving handling of resources in HSLF. PPFont object represents a font in a presenatation. ........ r648274 | yegor | 2008-04-15 16:11:13 +0100 (Tue, 15 Apr 2008) | 1 line TextSpecInfoAtom is present in PPT 2003+. When the text is changed we must update this record, otherwise the ppt becomes corrupted ........ r648276 | yegor | 2008-04-15 16:12:58 +0100 (Tue, 15 Apr 2008) | 1 line Improved factoring of ppt objects. For ppt tabels Slide.getShapes() returns the Table object (was ShapeGroup) ........ r648303 | nick | 2008-04-15 17:00:50 +0100 (Tue, 15 Apr 2008) | 1 line Nice and small change here... Update the formula parser code to use usermodel.HSSFWorkbook instead of model.Workbook. This should keep things a bit cleaner, and make it much easier for the formula code to work with XSSF ........ r648334 | josh | 2008-04-15 18:07:06 +0100 (Tue, 15 Apr 2008) | 1 line Conditional Formatting (30311) - API improvements, added HSSFSheetConditionalFormatting ........ git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@648444 13f79535-47bb-0310-9956-ffa450edef68
2008-04-15 18:47:30 -04:00
// check all remaining flag bits (some are not well understood yet)
assertEquals(0x203FFFFF, flags);
}
private static final byte[] DATA_REFN = {
// formula extracted from bugzilla 45234 att 22141
1, 3,
9, // formula 1 length
0, 0, 0, -1, -1, 63, 32, 2, -128, 0, 0, 0, 5,
// formula 1: "=B3=1" (formula is relative to B4)
76, -1, -1, 0, -64, // tRefN(B1)
30, 1, 0,
11,
};
/**
* tRefN and tAreaN tokens must be preserved when re-serializing conditional format formulas
*/
public void testReserializeRefNTokens() {
RecordInputStream is = new TestcaseRecordInputStream(CFRuleRecord.sid, DATA_REFN);
CFRuleRecord rr = new CFRuleRecord(is);
Ptg[] ptgs = rr.getParsedExpression1();
assertEquals(3, ptgs.length);
if (ptgs[0] instanceof RefPtg) {
throw new AssertionFailedError("Identified bug 45234");
}
assertEquals(RefNPtg.class, ptgs[0].getClass());
RefNPtg refNPtg = (RefNPtg) ptgs[0];
assertTrue(refNPtg.isColRelative());
assertTrue(refNPtg.isRowRelative());
byte[] data = rr.serialize();
if (!compareArrays(DATA_REFN, 0, data, 4, DATA_REFN.length)) {
fail("Did not re-serialize correctly");
}
}
private static boolean compareArrays(byte[] arrayA, int offsetA, byte[] arrayB, int offsetB, int length) {
if (offsetA + length > arrayA.length) {
return false;
}
if (offsetB + length > arrayB.length) {
return false;
}
for (int i = 0; i < length; i++) {
if (arrayA[i+offsetA] != arrayB[i+offsetB]) {
return false;
}
}
return true;
}
public static void main(String[] ignored_args)
Merged revisions 638001-638784,638786-639486,639488-639601,639603-639836 via svnmerge from https://svn.apache.org/repos/asf/poi/trunk ........ r638803 | nick | 2008-03-19 11:57:38 +0000 (Wed, 19 Mar 2008) | 1 line Added test to show that bug #41546 is already fixed. Also rename a test file to be more consistent ........ r638804 | nick | 2008-03-19 12:01:32 +0000 (Wed, 19 Mar 2008) | 1 line Add test to show that bug #43251 is already fixed ........ r638812 | nick | 2008-03-19 12:28:56 +0000 (Wed, 19 Mar 2008) | 1 line Patch from Dmitriy from bug #30311 - Support for conditional formatting records ........ r638815 | nick | 2008-03-19 12:49:35 +0000 (Wed, 19 Mar 2008) | 1 line Fix bug #44627 - improve the thread safety of POILogFactory ........ r639231 | nick | 2008-03-20 10:06:59 +0000 (Thu, 20 Mar 2008) | 1 line Test relating to bug #44636 ........ r639232 | nick | 2008-03-20 10:16:15 +0000 (Thu, 20 Mar 2008) | 1 line Simple patch from Josh from bug #44636 - fix for RefVPtg and edit-in-excel oddness ........ r639242 | nick | 2008-03-20 11:02:39 +0000 (Thu, 20 Mar 2008) | 1 line Fix for readCompressedUnicode not moaning about length=0, from bug #44643 ........ r639254 | nick | 2008-03-20 11:43:14 +0000 (Thu, 20 Mar 2008) | 1 line Make junit happy ........ r639836 | nick | 2008-03-21 21:04:47 +0000 (Fri, 21 Mar 2008) | 1 line Tweak how you get dataformat strings out of cell styles, to be more logical, and in keeping with how we'll want to do things for xssf too ........ git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@642557 13f79535-47bb-0310-9956-ffa450edef68
2008-03-29 13:00:47 -04:00
{
System.out.println("Testing org.apache.poi.hssf.record.CFRuleRecord");
junit.textui.TestRunner.run(TestCFRuleRecord.class);
}
}