aboutsummaryrefslogtreecommitdiffstats
path: root/src/testcases/org/apache/poi/hssf/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/testcases/org/apache/poi/hssf/util')
-rw-r--r--src/testcases/org/apache/poi/hssf/util/AllHSSFUtilTests.java22
-rw-r--r--src/testcases/org/apache/poi/hssf/util/TestHSSFColor.java37
2 files changed, 31 insertions, 28 deletions
diff --git a/src/testcases/org/apache/poi/hssf/util/AllHSSFUtilTests.java b/src/testcases/org/apache/poi/hssf/util/AllHSSFUtilTests.java
index 6faba78461..7e71fb2de1 100644
--- a/src/testcases/org/apache/poi/hssf/util/AllHSSFUtilTests.java
+++ b/src/testcases/org/apache/poi/hssf/util/AllHSSFUtilTests.java
@@ -17,22 +17,18 @@
package org.apache.poi.hssf.util;
-import junit.framework.Test;
-import junit.framework.TestSuite;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
/**
* Collects all tests for org.apache.poi.hssf.util.
- *
- * @author Josh Micich
*/
+@RunWith(Suite.class)
+@Suite.SuiteClasses({
+ TestAreaReference.class,
+ TestCellReference.class,
+ TestHSSFColor.class,
+ TestRKUtil.class
+})
public class AllHSSFUtilTests {
-
- public static Test suite() {
- TestSuite result = new TestSuite(AllHSSFUtilTests.class.getName());
- result.addTestSuite(TestAreaReference.class);
- // result.addTestSuite(TestCellReference.class); //converted to junit4
- result.addTestSuite(TestHSSFColor.class);
- result.addTestSuite(TestRKUtil.class);
- return result;
- }
}
diff --git a/src/testcases/org/apache/poi/hssf/util/TestHSSFColor.java b/src/testcases/org/apache/poi/hssf/util/TestHSSFColor.java
index 319a7449ec..be35ee268d 100644
--- a/src/testcases/org/apache/poi/hssf/util/TestHSSFColor.java
+++ b/src/testcases/org/apache/poi/hssf/util/TestHSSFColor.java
@@ -17,38 +17,45 @@
package org.apache.poi.hssf.util;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
import java.util.Map;
-import junit.framework.TestCase;
-/**
- * @author Nick Burch
- */
-public final class TestHSSFColor extends TestCase {
- public void testBasics() {
+import org.apache.poi.hssf.util.HSSFColor.HSSFColorPredefined;
+import org.junit.Test;
+
+public final class TestHSSFColor {
+ @Test
+ public void testBasics() {
assertNotNull(HSSFColor.YELLOW.class);
- assertTrue(HSSFColor.YELLOW.index > 0);
- assertTrue(HSSFColor.YELLOW.index2 > 0);
+ assertTrue(HSSFColorPredefined.YELLOW.getIndex() > 0);
+ assertTrue(HSSFColorPredefined.YELLOW.getIndex2() > 0);
}
+ @Test
public void testContents() {
- assertEquals(3, HSSFColor.YELLOW.triplet.length);
- assertEquals(255, HSSFColor.YELLOW.triplet[0]);
- assertEquals(255, HSSFColor.YELLOW.triplet[1]);
- assertEquals(0, HSSFColor.YELLOW.triplet[2]);
+ short[] triplet = HSSFColorPredefined.YELLOW.getTriplet();
+ assertEquals(3, triplet.length);
+ assertEquals(255, triplet[0]);
+ assertEquals(255, triplet[1]);
+ assertEquals(0, triplet[2]);
- assertEquals("FFFF:FFFF:0", HSSFColor.YELLOW.hexString);
+ assertEquals("FFFF:FFFF:0", HSSFColorPredefined.YELLOW.getHexString());
}
+ @Test
public void testTrippletHash() {
Map<String, HSSFColor> tripplets = HSSFColor.getTripletHash();
assertEquals(
HSSFColor.MAROON.class,
- tripplets.get(HSSFColor.MAROON.hexString).getClass()
+ tripplets.get(HSSFColorPredefined.MAROON.getHexString()).getClass()
);
assertEquals(
HSSFColor.YELLOW.class,
- tripplets.get(HSSFColor.YELLOW.hexString).getClass()
+ tripplets.get(HSSFColorPredefined.YELLOW.getHexString()).getClass()
);
}
}