Return-Path: X-Original-To: apmail-poi-commits-archive@minotaur.apache.org Delivered-To: apmail-poi-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6432218B25 for ; Fri, 6 Nov 2015 17:02:35 +0000 (UTC) Received: (qmail 52096 invoked by uid 500); 6 Nov 2015 17:02:35 -0000 Delivered-To: apmail-poi-commits-archive@poi.apache.org Received: (qmail 52056 invoked by uid 500); 6 Nov 2015 17:02:35 -0000 Mailing-List: contact commits-help@poi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@poi.apache.org Delivered-To: mailing list commits@poi.apache.org Received: (qmail 52047 invoked by uid 99); 6 Nov 2015 17:02:35 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Nov 2015 17:02:35 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 2A3F4C84A1 for ; Fri, 6 Nov 2015 17:02:34 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.99 X-Spam-Level: X-Spam-Status: No, score=0.99 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id JEikCCbRUi8G for ; Fri, 6 Nov 2015 17:02:19 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTP id 5B6AE23801 for ; Fri, 6 Nov 2015 17:02:19 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id D82ADE0044 for ; Fri, 6 Nov 2015 17:02:18 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id B25F83A00E5 for ; Fri, 6 Nov 2015 17:02:18 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1712984 - /poi/trunk/src/testcases/org/apache/poi/TestPOIDocumentMain.java Date: Fri, 06 Nov 2015 17:02:18 -0000 To: commits@poi.apache.org From: nick@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20151106170218.B25F83A00E5@svn01-us-west.apache.org> 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