From: Javen O'Neal Date: Mon, 2 Nov 2015 08:55:45 +0000 (+0000) Subject: upgrade spreadsheet Hyperlink unit tests from junit3 to junit4 X-Git-Tag: REL_3_14_BETA1~172 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b6b74d8f111f216986945acec50586107eebe535;p=poi.git upgrade spreadsheet Hyperlink unit tests from junit3 to junit4 git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1711909 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFHyperlink.java b/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFHyperlink.java index 9cad4c10cf..51aa9959ba 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFHyperlink.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFHyperlink.java @@ -19,6 +19,8 @@ package org.apache.poi.xssf.streaming; +import org.junit.After; + import org.apache.poi.ss.usermodel.BaseTestHyperlink; import org.apache.poi.xssf.SXSSFITestDataProvider; @@ -34,7 +36,7 @@ public class TestSXSSFHyperlink extends BaseTestHyperlink { } - @Override + @After public void tearDown(){ SXSSFITestDataProvider.instance.cleanup(); } diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFHyperlink.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFHyperlink.java index 6f8c3f087c..a10b373de7 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFHyperlink.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFHyperlink.java @@ -19,6 +19,10 @@ package org.apache.poi.xssf.usermodel; import java.io.IOException; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.fail; + import org.apache.poi.openxml4j.opc.PackageRelationship; import org.apache.poi.openxml4j.opc.PackageRelationshipCollection; import org.apache.poi.ss.usermodel.BaseTestHyperlink; diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFHyperlink.java b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFHyperlink.java index ad90fd8a77..885328ff33 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFHyperlink.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFHyperlink.java @@ -17,12 +17,18 @@ package org.apache.poi.hssf.usermodel; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import org.junit.Test; + import java.io.IOException; import org.apache.poi.hssf.HSSFITestDataProvider; import org.apache.poi.hssf.HSSFTestDataSamples; import org.apache.poi.ss.usermodel.BaseTestHyperlink; + /** * Tests HSSFHyperlink. * @@ -36,6 +42,7 @@ public final class TestHSSFHyperlink extends BaseTestHyperlink { /** * Test that we can read hyperlinks. */ + @Test public void testRead() { HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("HyperlinksOnManySheets.xls"); diff --git a/src/testcases/org/apache/poi/ss/usermodel/BaseTestHyperlink.java b/src/testcases/org/apache/poi/ss/usermodel/BaseTestHyperlink.java index e0be21b0fd..51148f8041 100644 --- a/src/testcases/org/apache/poi/ss/usermodel/BaseTestHyperlink.java +++ b/src/testcases/org/apache/poi/ss/usermodel/BaseTestHyperlink.java @@ -17,7 +17,8 @@ package org.apache.poi.ss.usermodel; -import junit.framework.TestCase; +import static org.junit.Assert.assertEquals; +import org.junit.Test; import org.apache.poi.ss.ITestDataProvider; @@ -26,7 +27,7 @@ import org.apache.poi.ss.ITestDataProvider; * * @author Yegor Kozlov */ -public abstract class BaseTestHyperlink extends TestCase { +public abstract class BaseTestHyperlink { private final ITestDataProvider _testDataProvider; @@ -34,6 +35,7 @@ public abstract class BaseTestHyperlink extends TestCase { _testDataProvider = testDataProvider; } + @Test public final void testBasicTypes(){ Workbook wb = _testDataProvider.createWorkbook(); CreationHelper createHelper = wb.getCreationHelper();