Author: onealj
Date: Fri Feb 17 09:37:00 2017
New Revision: 1783360

URL: http://svn.apache.org/viewvc?rev=1783360&view=rev
Log:
convert from junit3 to junit4

Modified:
    poi/trunk/src/testcases/org/apache/poi/hssf/record/TestObjRecord.java

Modified: poi/trunk/src/testcases/org/apache/poi/hssf/record/TestObjRecord.java
URL: 
http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/record/TestObjRecord.java?rev=1783360&r1=1783359&r2=1783360&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/hssf/record/TestObjRecord.java 
(original)
+++ poi/trunk/src/testcases/org/apache/poi/hssf/record/TestObjRecord.java Fri 
Feb 17 09:37:00 2017
@@ -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
             + "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
 
     }
 
+    @Test
     public void testStore() {
         ObjRecord record = new 
ObjRecord(TestcaseRecordInputStream.create(ObjRecord.sid, recdata));
 
@@ -80,6 +81,7 @@ public final class TestObjRecord extends
         assertArrayEquals(recdata, subData);
     }
 
+    @Test
     public void testConstruct() {
         ObjRecord record = new ObjRecord();
         CommonObjectDataSubRecord ftCmo = new CommonObjectDataSubRecord();
@@ -106,11 +108,12 @@ public final class TestObjRecord extends
         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
      * 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(""



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to