diff options
author | Dominik Stadler <centic@apache.org> | 2014-12-22 08:17:56 +0000 |
---|---|---|
committer | Dominik Stadler <centic@apache.org> | 2014-12-22 08:17:56 +0000 |
commit | 124cda92e637b3ab014fa93f0ffd557d928cb79c (patch) | |
tree | e914efeba4f2490621e05bfab2edf6ad35702a25 /src/testcases/org/apache | |
parent | 766300e0338a383984058bff44ab6a24eaa897ea (diff) | |
download | poi-124cda92e637b3ab014fa93f0ffd557d928cb79c.tar.gz poi-124cda92e637b3ab014fa93f0ffd557d928cb79c.zip |
Bug 57231: Add missing ArrayRecord.clone()
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1647255 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases/org/apache')
-rw-r--r-- | src/testcases/org/apache/poi/hssf/record/TestArrayRecord.java | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/src/testcases/org/apache/poi/hssf/record/TestArrayRecord.java b/src/testcases/org/apache/poi/hssf/record/TestArrayRecord.java index d2b483f407..ff5fe0ad9b 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestArrayRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestArrayRecord.java @@ -19,14 +19,17 @@ package org.apache.poi.hssf.record; import junit.framework.TestCase; +import org.apache.poi.hssf.HSSFTestDataSamples; +import org.apache.poi.hssf.usermodel.HSSFSheet; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.hssf.util.CellRangeAddress8Bit; -import org.apache.poi.ss.formula.ptg.Ptg; +import org.apache.poi.ss.formula.Formula; import org.apache.poi.ss.formula.FormulaParser; import org.apache.poi.ss.formula.FormulaRenderer; import org.apache.poi.ss.formula.FormulaType; -import org.apache.poi.ss.formula.Formula; -import org.apache.poi.util.HexRead; +import org.apache.poi.ss.formula.ptg.Ptg; import org.apache.poi.util.HexDump; +import org.apache.poi.util.HexRead; public final class TestArrayRecord extends TestCase { @@ -53,7 +56,22 @@ public final class TestArrayRecord extends TestCase { byte[] ser = r2.serialize(); //serialize and check that the data is the same as in r1 assertEquals(HexDump.toHex(data), HexDump.toHex(ser)); + } + + public void testBug57231() { + HSSFWorkbook wb = HSSFTestDataSamples + .openSampleWorkbook("57231_MixedGasReport.xls"); + HSSFSheet sheet = wb.getSheet("master"); + + HSSFSheet newSheet = wb.cloneSheet(wb.getSheetIndex(sheet)); + int idx = wb.getSheetIndex(newSheet); + wb.setSheetName(idx, "newName"); + // Write the output to a file + HSSFWorkbook wbBack = HSSFTestDataSamples.writeOutAndReadBack(wb); + assertNotNull(wbBack); + assertNotNull(wbBack.getSheet("master")); + assertNotNull(wbBack.getSheet("newName")); } -}
\ No newline at end of file +} |