SheetConditionalFormatting sheetCF = sh.getSheetConditionalFormatting();\r
\r
ConditionalFormattingRule rule1 = sheetCF.createConditionalFormattingRule("SUM(A1:A5)>10");\r
- assertEquals(ConditionalFormattingRule.CONDITION_TYPE_FORMULA, rule1.getConditionType());\r
+ assertEquals(ConditionType.FORMULA.id, rule1.getConditionType());\r
+ assertEquals(ConditionType.FORMULA, rule1.getConditionTypeType());\r
assertEquals("SUM(A1:A5)>10", rule1.getFormula1());\r
int formatIndex1 = sheetCF.addConditionalFormatting(\r
new CellRangeAddress[]{\r
\r
ConditionalFormattingRule rule1 = sheetCF.createConditionalFormattingRule(\r
ComparisonOperator.EQUAL, "SUM(A1:A5)+10");\r
- assertEquals(ConditionalFormattingRule.CONDITION_TYPE_CELL_VALUE_IS, rule1.getConditionType());\r
+ assertEquals(ConditionType.CELL_VALUE_IS.id, rule1.getConditionType());\r
+ assertEquals(ConditionType.CELL_VALUE_IS, rule1.getConditionTypeType());\r
assertEquals("SUM(A1:A5)+10", rule1.getFormula1());\r
assertEquals(ComparisonOperator.EQUAL, rule1.getComparisonOperation());\r
\r
ConditionalFormattingRule rule2 = sheetCF.createConditionalFormattingRule(\r
ComparisonOperator.NOT_EQUAL, "15");\r
- assertEquals(ConditionalFormattingRule.CONDITION_TYPE_CELL_VALUE_IS, rule2.getConditionType());\r
+ assertEquals(ConditionType.CELL_VALUE_IS.id, rule2.getConditionType());\r
+ assertEquals(ConditionType.CELL_VALUE_IS, rule2.getConditionTypeType());\r
assertEquals("15", rule2.getFormula1());\r
assertEquals(ComparisonOperator.NOT_EQUAL, rule2.getComparisonOperation());\r
\r
ConditionalFormattingRule rule3 = sheetCF.createConditionalFormattingRule(\r
ComparisonOperator.NOT_EQUAL, "15");\r
- assertEquals(ConditionalFormattingRule.CONDITION_TYPE_CELL_VALUE_IS, rule3.getConditionType());\r
+ assertEquals(ConditionType.CELL_VALUE_IS.id, rule3.getConditionType());\r
+ assertEquals(ConditionType.CELL_VALUE_IS, rule3.getConditionTypeType());\r
assertEquals("15", rule3.getFormula1());\r
assertEquals(ComparisonOperator.NOT_EQUAL, rule3.getComparisonOperation());\r
\r
ConditionalFormattingRule rule4 = sheetCF.createConditionalFormattingRule(\r
ComparisonOperator.GT, "0");\r
- assertEquals(ConditionalFormattingRule.CONDITION_TYPE_CELL_VALUE_IS, rule4.getConditionType());\r
+ assertEquals(ConditionType.CELL_VALUE_IS.id, rule4.getConditionType());\r
+ assertEquals(ConditionType.CELL_VALUE_IS, rule4.getConditionTypeType());\r
assertEquals("0", rule4.getFormula1());\r
assertEquals(ComparisonOperator.GT, rule4.getComparisonOperation());\r
\r
ConditionalFormattingRule rule5 = sheetCF.createConditionalFormattingRule(\r
ComparisonOperator.LT, "0");\r
- assertEquals(ConditionalFormattingRule.CONDITION_TYPE_CELL_VALUE_IS, rule5.getConditionType());\r
+ assertEquals(ConditionType.CELL_VALUE_IS.id, rule5.getConditionType());\r
+ assertEquals(ConditionType.CELL_VALUE_IS, rule5.getConditionTypeType());\r
assertEquals("0", rule5.getFormula1());\r
assertEquals(ComparisonOperator.LT, rule5.getComparisonOperation());\r
\r
ConditionalFormattingRule rule6 = sheetCF.createConditionalFormattingRule(\r
ComparisonOperator.GE, "0");\r
- assertEquals(ConditionalFormattingRule.CONDITION_TYPE_CELL_VALUE_IS, rule6.getConditionType());\r
+ assertEquals(ConditionType.CELL_VALUE_IS.id, rule6.getConditionType());\r
+ assertEquals(ConditionType.CELL_VALUE_IS, rule6.getConditionTypeType());\r
assertEquals("0", rule6.getFormula1());\r
assertEquals(ComparisonOperator.GE, rule6.getComparisonOperation());\r
\r
ConditionalFormattingRule rule7 = sheetCF.createConditionalFormattingRule(\r
ComparisonOperator.LE, "0");\r
- assertEquals(ConditionalFormattingRule.CONDITION_TYPE_CELL_VALUE_IS, rule7.getConditionType());\r
+ assertEquals(ConditionType.CELL_VALUE_IS.id, rule7.getConditionType());\r
+ assertEquals(ConditionType.CELL_VALUE_IS, rule7.getConditionTypeType());\r
assertEquals("0", rule7.getFormula1());\r
assertEquals(ComparisonOperator.LE, rule7.getComparisonOperation());\r
\r
ConditionalFormattingRule rule8 = sheetCF.createConditionalFormattingRule(\r
ComparisonOperator.BETWEEN, "0", "5");\r
- assertEquals(ConditionalFormattingRule.CONDITION_TYPE_CELL_VALUE_IS, rule8.getConditionType());\r
+ assertEquals(ConditionType.CELL_VALUE_IS.id, rule8.getConditionType());\r
+ assertEquals(ConditionType.CELL_VALUE_IS, rule8.getConditionTypeType());\r
assertEquals("0", rule8.getFormula1());\r
assertEquals("5", rule8.getFormula2());\r
assertEquals(ComparisonOperator.BETWEEN, rule8.getComparisonOperation());\r
\r
ConditionalFormattingRule rule9 = sheetCF.createConditionalFormattingRule(\r
ComparisonOperator.NOT_BETWEEN, "0", "5");\r
- assertEquals(ConditionalFormattingRule.CONDITION_TYPE_CELL_VALUE_IS, rule9.getConditionType());\r
+ assertEquals(ConditionType.CELL_VALUE_IS.id, rule9.getConditionType());\r
+ assertEquals(ConditionType.CELL_VALUE_IS, rule9.getConditionTypeType());\r
assertEquals("0", rule9.getFormula1());\r
assertEquals("5", rule9.getFormula2());\r
assertEquals(ComparisonOperator.NOT_BETWEEN, rule9.getComparisonOperation());\r
\r
// CF1 has two rules: values less than -3 are bold-italic red, values greater than 3 are green\r
ConditionalFormattingRule rule1 = cf1.getRule(0);\r
- assertEquals(ConditionalFormattingRule.CONDITION_TYPE_CELL_VALUE_IS, rule1.getConditionType());\r
+ assertEquals(ConditionType.CELL_VALUE_IS, rule1.getConditionTypeType());\r
assertEquals(ComparisonOperator.GT, rule1.getComparisonOperation());\r
assertEquals("3", rule1.getFormula1());\r
assertNull(rule1.getFormula2());\r
assertFalse(fmt1.isItalic());\r
\r
ConditionalFormattingRule rule2 = cf1.getRule(1);\r
- assertEquals(ConditionalFormattingRule.CONDITION_TYPE_CELL_VALUE_IS, rule2.getConditionType());\r
+ assertEquals(ConditionType.CELL_VALUE_IS, rule2.getConditionTypeType());\r
assertEquals(ComparisonOperator.LT, rule2.getComparisonOperation());\r
assertEquals("-3", rule2.getFormula1());\r
assertNull(rule2.getFormula2());\r
assertEquals("B9", regions2[0].formatAsString());\r
\r
ConditionalFormattingRule rule3 = cf2.getRule(0);\r
- assertEquals(ConditionalFormattingRule.CONDITION_TYPE_FORMULA, rule3.getConditionType());\r
+ assertEquals(ConditionType.FORMULA, rule3.getConditionTypeType());\r
assertEquals(ComparisonOperator.NO_COMPARISON, rule3.getComparisonOperation());\r
assertEquals("$A$8>5", rule3.getFormula1());\r
assertNull(rule3.getFormula2());\r
assertEquals(2, cf3.getNumberOfRules());\r
\r
ConditionalFormattingRule rule4 = cf3.getRule(0);\r
- assertEquals(ConditionalFormattingRule.CONDITION_TYPE_CELL_VALUE_IS, rule4.getConditionType());\r
+ assertEquals(ConditionType.CELL_VALUE_IS, rule4.getConditionTypeType());\r
assertEquals(ComparisonOperator.LE, rule4.getComparisonOperation());\r
assertEquals("\"AAA\"", rule4.getFormula1());\r
assertNull(rule4.getFormula2());\r
\r
ConditionalFormattingRule rule5 = cf3.getRule(1);\r
- assertEquals(ConditionalFormattingRule.CONDITION_TYPE_CELL_VALUE_IS, rule5.getConditionType());\r
+ assertEquals(ConditionType.CELL_VALUE_IS, rule5.getConditionTypeType());\r
assertEquals(ComparisonOperator.BETWEEN, rule5.getComparisonOperation());\r
assertEquals("\"A\"", rule5.getFormula1());\r
assertEquals("\"AAA\"", rule5.getFormula2());\r
\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
\r
// Highlight 10-30 - Column D\r