import junit.framework.TestCase;\r
\r
import org.apache.poi.hssf.usermodel.HSSFConditionalFormatting;\r
+import org.apache.poi.hssf.usermodel.HSSFConditionalFormattingRule;\r
import org.apache.poi.ss.ITestDataProvider;\r
import org.apache.poi.ss.util.CellRangeAddress;\r
\r
\r
// Check the rules / values in detail\r
\r
+ \r
// Highlight Positive values - Column C\r
cf = sheetCF.getConditionalFormattingAt(0);\r
assertEquals(1, cf.getFormattingRanges().length);\r
assertEquals(1, cf.getNumberOfRules());\r
cr = cf.getRule(0);\r
assertEquals(ConditionType.CELL_VALUE_IS, cr.getConditionTypeType());\r
- // TODO Check the rest of this\r
+ assertEquals(ComparisonOperator.GT, cr.getComparisonOperation());\r
+ assertEquals("0", cr.getFormula1());\r
+ assertEquals(null, cr.getFormula2());\r
+// assertColourGreen(cr);\r
+ // TODO Colour checking\r
+ \r
\r
// Highlight 10-30 - Column D\r
- // TODO\r
+ cf = sheetCF.getConditionalFormattingAt(1);\r
+ assertEquals(1, cf.getFormattingRanges().length);\r
+ assertEquals("D2:D17", cf.getFormattingRanges()[0].formatAsString());\r
+ \r
+ assertEquals(1, cf.getNumberOfRules());\r
+ cr = cf.getRule(0);\r
+ assertEquals(ConditionType.CELL_VALUE_IS, cr.getConditionTypeType());\r
+ assertEquals(ComparisonOperator.BETWEEN, cr.getComparisonOperation());\r
+ assertEquals("10", cr.getFormula1());\r
+ assertEquals("30", cr.getFormula2());\r
+// assertColourGreen(cr);\r
+// assertColourRed(cr);\r
+ // TODO Colour checking\r
+\r
+ \r
+ // Data Bars - Column E\r
+ cf = sheetCF.getConditionalFormattingAt(2);\r
+ assertEquals(1, cf.getFormattingRanges().length);\r
+ assertEquals("E2:E17", cf.getFormattingRanges()[0].formatAsString());\r
+ \r
+ assertEquals(1, cf.getNumberOfRules());\r
+ cr = cf.getRule(0);\r
+ assertEquals(ConditionType.DATA_BAR, cr.getConditionTypeType());\r
+ // TODO Support then check the rest\r
+ \r
+ \r
+ // Colours R->G - Column F\r
+ // Colours BWR - Column G\r
+ // Icons : Default - Column H\r
+ // Icons : 3 signs - Column I\r
+ // Icons : 3 traffic lights 2 - Column J\r
+ // Icons : 4 traffic lights - Column K\r
+ // Icons : 3 symbols - Column L\r
+ // Icons : 3 flags - Column M\r
+ // Icons : 3 symbols 2 - Column N\r
+ // Icons : 3 arrows - Column O \r
+ // Icons : 5 arrows grey - Column P \r
+ // Icons : 3 stars (ext) - Column Q\r
+ // Icons : 4 ratings - Column R\r
+ // Icons : 5 ratings - Column S\r
+ // Custom Icon+Format - Column T\r
+ // Mixed icons - Column U\r
+\r
}\r
\r
public void testCreateFontFormatting() {\r