poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r1712984 - /poi/trunk/src/testcases/org/apache/poi/TestPOIDocumentMain.java
Date Fri, 06 Nov 2015 17:02:18 GMT
Author: nick
Date: Fri Nov  6 17:02:18 2015
New Revision: 1712984

URL: http://svn.apache.org/viewvc?rev=1712984&view=rev
Log:
Convert to JUnit4

Modified:
    poi/trunk/src/testcases/org/apache/poi/TestPOIDocumentMain.java

Modified: poi/trunk/src/testcases/org/apache/poi/TestPOIDocumentMain.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/TestPOIDocumentMain.java?rev=1712984&r1=1712983&r2=1712984&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/TestPOIDocumentMain.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/TestPOIDocumentMain.java Fri Nov  6 17:02:18 2015
@@ -22,7 +22,10 @@ import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 
-import junit.framework.TestCase;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
 
 import org.apache.poi.hssf.HSSFTestDataSamples;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
@@ -35,10 +38,8 @@ import org.apache.poi.poifs.filesystem.O
  *
  * This is part 1 of 2 of the tests - it only does the POIDocuments
  *  which are part of the Main (not scratchpad)
- *
- * @author Nick Burch (nick at torchbox dot com)
  */
-public final class TestPOIDocumentMain extends TestCase {
+public final class TestPOIDocumentMain {
 	// The POI Documents to work on
 	private POIDocument doc;
 	private POIDocument doc2;
@@ -46,12 +47,14 @@ public final class TestPOIDocumentMain e
 	/**
 	 * Set things up, two spreadsheets for our testing
 	 */
-	public void setUp() {
+	@Before
+    public void setUp() {
 		doc = HSSFTestDataSamples.openSampleWorkbook("DateFormats.xls");
 		doc2 = HSSFTestDataSamples.openSampleWorkbook("StringFormulas.xls");
 	}
 
-	public void testReadProperties() {
+	@Test
+    public void readProperties() {
 		// We should have both sets
 		assertNotNull(doc.getDocumentSummaryInformation());
 		assertNotNull(doc.getSummaryInformation());
@@ -61,7 +64,8 @@ public final class TestPOIDocumentMain e
 		assertEquals(0, doc.getDocumentSummaryInformation().getByteCount());
 	}
 
-	public void testReadProperties2() {
+	@Test
+    public void readProperties2() {
 		// Check again on the word one
 		assertNotNull(doc2.getDocumentSummaryInformation());
 		assertNotNull(doc2.getSummaryInformation());
@@ -71,7 +75,8 @@ public final class TestPOIDocumentMain e
 		assertEquals(0, doc2.getDocumentSummaryInformation().getByteCount());
 	}
 
-	public void testWriteProperties() throws Exception {
+	@Test
+    public void writeProperties() throws Exception {
 		// Just check we can write them back out into a filesystem
 		NPOIFSFileSystem outFS = new NPOIFSFileSystem();
 		doc.readProperties();
@@ -86,7 +91,8 @@ public final class TestPOIDocumentMain e
 		);
 	}
 
-	public void testWriteReadProperties() throws Exception {
+	@Test
+    public void WriteReadProperties() throws Exception {
 		ByteArrayOutputStream baos = new ByteArrayOutputStream();
 
 		// Write them out
@@ -104,10 +110,11 @@ public final class TestPOIDocumentMain e
 		doc.readProperties();
 
 		// Delegate test
-		testReadProperties();
+		readProperties();
 	}
 	
-	public void testCreateNewProperties() throws IOException {
+	@Test
+    public void createNewProperties() throws IOException {
 		POIDocument doc = new HSSFWorkbook();
 		
 		// New document won't have them
@@ -130,7 +137,8 @@ public final class TestPOIDocumentMain e
 		assertNotNull(doc.getDocumentSummaryInformation());
 	}
 	
-	public void testCreateNewPropertiesOnExistingFile() throws IOException {
+	@Test
+    public void createNewPropertiesOnExistingFile() throws IOException {
 		POIDocument doc = new HSSFWorkbook();
 		
 		// New document won't have them



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message