diff options
author | Javen O'Neal <onealj@apache.org> | 2017-02-17 09:37:00 +0000 |
---|---|---|
committer | Javen O'Neal <onealj@apache.org> | 2017-02-17 09:37:00 +0000 |
commit | 853bad0371be83d0d3dd4e9bc7dcec15956db3aa (patch) | |
tree | 183df325ed5b7155c9cb044195cfd65e1b14ecf2 /src/testcases/org | |
parent | 2178f11e17dad6de99a8292cb3a4b5337c435e90 (diff) | |
download | poi-853bad0371be83d0d3dd4e9bc7dcec15956db3aa.tar.gz poi-853bad0371be83d0d3dd4e9bc7dcec15956db3aa.zip |
convert from junit3 to junit4
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1783360 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases/org')
-rw-r--r-- | src/testcases/org/apache/poi/hssf/record/TestObjRecord.java | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/testcases/org/apache/poi/hssf/record/TestObjRecord.java b/src/testcases/org/apache/poi/hssf/record/TestObjRecord.java index 504180d62d..b20dc35bfd 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestObjRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestObjRecord.java @@ -18,21 +18,20 @@ package org.apache.poi.hssf.record; import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; import java.util.List; -import junit.framework.AssertionFailedError; -import junit.framework.TestCase; - import org.apache.poi.util.HexRead; +import org.junit.Test; /** * Tests the serialization and deserialization of the ObjRecord class works correctly. * Test data taken directly from a real Excel file. - * - * @author Yegor Kozlov */ -public final class TestObjRecord extends TestCase { +public final class TestObjRecord { /** * OBJ record data containing two sub-records. * The data taken directly from a real Excel file. @@ -58,6 +57,7 @@ public final class TestObjRecord extends TestCase { + "15 00 12 00 00 00 01 00 11 60 00 00 00 00 38 6F CC 03 00 00 00 00 06 00 02 00 00 00 00 00 00 00" ); + @Test public void testLoad() { ObjRecord record = new ObjRecord(TestcaseRecordInputStream.create(ObjRecord.sid, recdata)); @@ -70,6 +70,7 @@ public final class TestObjRecord extends TestCase { } + @Test public void testStore() { ObjRecord record = new ObjRecord(TestcaseRecordInputStream.create(ObjRecord.sid, recdata)); @@ -80,6 +81,7 @@ public final class TestObjRecord extends TestCase { assertArrayEquals(recdata, subData); } + @Test public void testConstruct() { ObjRecord record = new ObjRecord(); CommonObjectDataSubRecord ftCmo = new CommonObjectDataSubRecord(); @@ -106,11 +108,12 @@ public final class TestObjRecord extends TestCase { assertTrue( subrecords.get(1) instanceof EndSubRecord ); } + @Test public void testReadWriteWithPadding_bug45133() { ObjRecord record = new ObjRecord(TestcaseRecordInputStream.create(recdataNeedingPadding)); if (record.getRecordSize() == 34) { - throw new AssertionFailedError("Identified bug 45133"); + fail("Identified bug 45133"); } assertEquals(36, record.getRecordSize()); @@ -126,6 +129,7 @@ public final class TestObjRecord extends TestCase { * Check that ObjRecord tolerates and preserves padding to a 4-byte boundary * (normally padding is to a 2-byte boundary). */ + @Test public void test4BytePadding() { // actual data from file saved by Excel 2007 byte[] data = HexRead.readFromString("" |