From 9f66b9c5f4e720367c3de5ee9144e59b16e3024c Mon Sep 17 00:00:00 2001 From: Josh Micich Date: Mon, 31 Mar 2008 05:19:00 +0000 Subject: [PATCH] removed incorrect test case methods git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@642880 13f79535-47bb-0310-9956-ffa450edef68 --- .../TestHSSFConfditionalFormatting.java | 115 +----------------- 1 file changed, 1 insertion(+), 114 deletions(-) diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFConfditionalFormatting.java b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFConfditionalFormatting.java index 3541787d8..6186d227e 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFConfditionalFormatting.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFConfditionalFormatting.java @@ -17,14 +17,6 @@ package org.apache.poi.hssf.usermodel; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; - import junit.framework.TestCase; import org.apache.poi.hssf.record.CFRuleRecord.ComparisonOperator; @@ -36,7 +28,7 @@ import org.apache.poi.hssf.util.Region; */ public final class TestHSSFConfditionalFormatting extends TestCase { - public void XtestLastAndFirstColumns() + public void testLastAndFirstColumns() { HSSFWorkbook workbook = new HSSFWorkbook(); HSSFSheet sheet = workbook.createSheet(); @@ -95,109 +87,4 @@ public final class TestHSSFConfditionalFormatting extends TestCase assertEquals("2",rule2.getFormula2()); assertEquals("1",rule2.getFormula1()); } - - public void XtestOutput() { - - HSSFWorkbook wb = new HSSFWorkbook(); - HSSFSheet sheet = wb.createSheet(); - String formula = "7"; - - HSSFFontFormatting fontFmt = new HSSFFontFormatting(); - fontFmt.setFontStyle(true, false); - - HSSFBorderFormatting bordFmt = new HSSFBorderFormatting(); - bordFmt.setBorderBottom(HSSFBorderFormatting.BORDER_THIN); - bordFmt.setBorderTop(HSSFBorderFormatting.BORDER_THICK); - bordFmt.setBorderLeft(HSSFBorderFormatting.BORDER_DASHED); - bordFmt.setBorderRight(HSSFBorderFormatting.BORDER_DOTTED); - - HSSFPatternFormatting patternFmt = new HSSFPatternFormatting(); - patternFmt.setFillBackgroundColor(HSSFColor.RED.index); - - HSSFConditionalFormattingRule [] cfRules = - { - sheet.createConditionalFormattingRule(formula, fontFmt, bordFmt, patternFmt), - sheet.createConditionalFormattingRule(ComparisonOperator.BETWEEN, "1", "2", fontFmt, bordFmt, patternFmt) - }; - - short col = 1; - Region [] regions = - { - new Region(0,col,-1,col) - }; - - sheet.addConditionalFormatting(regions, cfRules); - - try { - OutputStream os = new FileOutputStream("C:/josh/temp/cfExample.xls"); - wb.write(os); - os.close(); - } catch (IOException e) { - throw new RuntimeException(e); - } - } - - public void testReadWrite() { - - HSSFWorkbook wb; - try { - InputStream is = new FileInputStream("C:/josh/temp/cfEx.xls"); - wb = new HSSFWorkbook(is); - } catch (IOException e) { - throw new RuntimeException(e); - } - - HSSFSheet sheet = wb.getSheetAt(0); - - int nCFs = sheet.getNumConditionalFormattings(); - HSSFConditionalFormatting cf = sheet.getConditionalFormattingAt(0); - Region[] regions = cf.getFormattingRegions(); - - sheet.removeConditionalFormatting(0); - - HSSFFontFormatting fontFmt = new HSSFFontFormatting(); - fontFmt.setFontStyle(false, true); - HSSFConditionalFormattingRule rule1 = cf.getRule(0); - HSSFConditionalFormattingRule rule = sheet.createConditionalFormattingRule(ComparisonOperator.BETWEEN, "5", "10", fontFmt, null, null); - - byte[] rawRecord1 = rule1.getCfRuleRecord().getFontFormatting().getRawRecord(); - for (int i = 0; i < rawRecord1.length; i++) { - System.out.print(rawRecord1[i] + ","); - } - System.out.println(); - - byte[] rawRecord = fontFmt.getFontFormattingBlock().getRawRecord(); - for (int i = 0; i < rawRecord.length; i++) { - System.out.print(rawRecord[i]+ ","); - } - System.out.println(); - - rule.getCfRuleRecord().setFontFormatting(rule1.getCfRuleRecord().getFontFormatting()); - - sheet.addConditionalFormatting(regions, new HSSFConditionalFormattingRule[] { rule, }); - - - HSSFWorkbook wb2; -if(false) try { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - wb.write(baos); - - ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); - - wb2 = new HSSFWorkbook(bais); - } catch (IOException e) { - throw new RuntimeException(e); - } - - - try { - OutputStream os = new FileOutputStream("C:/josh/temp/cfEx3.xls"); - wb.write(os); - os.close(); - } catch (IOException e) { - throw new RuntimeException(e); - } - - - } }