diff options
author | Glen Stampoultzis <glens@apache.org> | 2004-08-23 08:52:54 +0000 |
---|---|---|
committer | Glen Stampoultzis <glens@apache.org> | 2004-08-23 08:52:54 +0000 |
commit | ed3268bd931a6005d8a6019d0eba9760a84afddc (patch) | |
tree | 98df9545c1c9e1fd9a29b049cade3ec995988b46 /src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheet.java | |
parent | 68b95f3a3fda2a484ea0ded1d083676704703c68 (diff) | |
download | poi-ed3268bd931a6005d8a6019d0eba9760a84afddc.tar.gz poi-ed3268bd931a6005d8a6019d0eba9760a84afddc.zip |
Merged REL_2_BRANCH to head.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@353586 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheet.java')
-rw-r--r-- | src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheet.java | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheet.java b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheet.java index 572c16aa3d..d552b05966 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheet.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheet.java @@ -169,7 +169,6 @@ public class TestHSSFSheet FileOutputStream stream = new FileOutputStream(tempFile); workbook.write(stream); stream.close(); - System.out.println( "tempFile.getCanonicalPath() = " + tempFile.getCanonicalPath() ); FileInputStream readStream = new FileInputStream(tempFile); workbook = new HSSFWorkbook(readStream); @@ -310,8 +309,8 @@ public class TestHSSFSheet * @author Shawn Laubach (slaubach at apache dot org) */ public void testDisplayOptions() throws Exception { - HSSFWorkbook wb = new HSSFWorkbook(); - HSSFSheet sheet = wb.createSheet(); + HSSFWorkbook wb = new HSSFWorkbook(); + HSSFSheet sheet = wb.createSheet(); File tempFile = File.createTempFile("display", "test.xls"); FileOutputStream stream = new FileOutputStream(tempFile); @@ -321,15 +320,15 @@ public class TestHSSFSheet FileInputStream readStream = new FileInputStream(tempFile); wb = new HSSFWorkbook(readStream); sheet = wb.getSheetAt(0); - readStream.close(); - - assertEquals(sheet.isDisplayGridlines(), true); - assertEquals(sheet.isDisplayRowColHeadings(), true); - assertEquals(sheet.isDisplayFormulas(), false); - - sheet.setDisplayGridlines(false); - sheet.setDisplayRowColHeadings(false); - sheet.setDisplayFormulas(true); + readStream.close(); + + assertEquals(sheet.isDisplayGridlines(), true); + assertEquals(sheet.isDisplayRowColHeadings(), true); + assertEquals(sheet.isDisplayFormulas(), false); + + sheet.setDisplayGridlines(false); + sheet.setDisplayRowColHeadings(false); + sheet.setDisplayFormulas(true); tempFile = File.createTempFile("display", "test.xls"); stream = new FileOutputStream(tempFile); @@ -339,14 +338,15 @@ public class TestHSSFSheet readStream = new FileInputStream(tempFile); wb = new HSSFWorkbook(readStream); sheet = wb.getSheetAt(0); - readStream.close(); - - - assertEquals(sheet.isDisplayGridlines(), false); - assertEquals(sheet.isDisplayRowColHeadings(), false); - assertEquals(sheet.isDisplayFormulas(), true); + readStream.close(); + + + assertEquals(sheet.isDisplayGridlines(), false); + assertEquals(sheet.isDisplayRowColHeadings(), false); + assertEquals(sheet.isDisplayFormulas(), true); } + /** * Make sure the excel file loads work * @@ -354,47 +354,47 @@ public class TestHSSFSheet public void testPageBreakFiles() throws Exception{ FileInputStream fis = null; HSSFWorkbook wb = null; - + String filename = System.getProperty("HSSF.testdata.path"); filename = filename + "/SimpleWithPageBreaks.xls"; fis = new FileInputStream(filename); wb = new HSSFWorkbook(fis); fis.close(); - + HSSFSheet sheet = wb.getSheetAt(0); assertNotNull(sheet); - + assertEquals("1 row page break", 1, sheet.getRowBreaks().length); assertEquals("1 column page break", 1, sheet.getColumnBreaks().length); assertTrue("No row page break", sheet.isRowBroken(22)); assertTrue("No column page break", sheet.isColumnBroken((short)4)); - - sheet.setRowBreak(10); + + sheet.setRowBreak(10); sheet.setColumnBreak((short)13); assertEquals("row breaks number", 2, sheet.getRowBreaks().length); assertEquals("column breaks number", 2, sheet.getColumnBreaks().length); - + File tempFile = File.createTempFile("display", "testPagebreaks.xls"); FileOutputStream stream = new FileOutputStream(tempFile); wb.write(stream); stream.close(); - + wb = new HSSFWorkbook(new FileInputStream(tempFile)); sheet = wb.getSheetAt(0); assertTrue("No row page break", sheet.isRowBroken(22)); assertTrue("No column page break", sheet.isColumnBroken((short)4)); - + assertEquals("row breaks number", 2, sheet.getRowBreaks().length); assertEquals("column breaks number", 2, sheet.getColumnBreaks().length); - - + + } - + public static void main(java.lang.String[] args) { junit.textui.TestRunner.run(TestHSSFSheet.class); } |