diff options
author | Andreas Beeker <kiwiwings@apache.org> | 2015-09-11 00:56:16 +0000 |
---|---|---|
committer | Andreas Beeker <kiwiwings@apache.org> | 2015-09-11 00:56:16 +0000 |
commit | 17d8c71a657e79b204fe0675edfab305251b0e4f (patch) | |
tree | b210dd2aa1f73c788e4e3d646b64dce16cddd584 /src/testcases/org/apache/poi/hssf/model | |
parent | 9f26731f44ba4eccabdb82f0a23f91eb755787fc (diff) | |
download | poi-17d8c71a657e79b204fe0675edfab305251b0e4f.tar.gz poi-17d8c71a657e79b204fe0675edfab305251b0e4f.zip |
More forbidden apis fixes (added main-tests to the check)
and a few junit4 upgrades
... hopefully this doesn't crash the build again ... :|
to simulate the tests on jenkins on the local developer box, uncomment the UTC lines in the build.xml
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1702356 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases/org/apache/poi/hssf/model')
-rw-r--r-- | src/testcases/org/apache/poi/hssf/model/AllModelTests.java | 38 | ||||
-rw-r--r-- | src/testcases/org/apache/poi/hssf/model/TestRowBlocksReader.java | 17 |
2 files changed, 28 insertions, 27 deletions
diff --git a/src/testcases/org/apache/poi/hssf/model/AllModelTests.java b/src/testcases/org/apache/poi/hssf/model/AllModelTests.java index a243226867..0d140ab7d3 100644 --- a/src/testcases/org/apache/poi/hssf/model/AllModelTests.java +++ b/src/testcases/org/apache/poi/hssf/model/AllModelTests.java @@ -17,30 +17,26 @@ package org.apache.poi.hssf.model; -import junit.framework.Test; -import junit.framework.TestSuite; +import org.junit.runner.RunWith; +import org.junit.runners.Suite; /** * Collects all tests for <tt>org.apache.poi.hssf.model</tt>. - * - * @author Josh Micich */ +@RunWith(Suite.class) +@Suite.SuiteClasses({ + TestDrawingManager.class, + TestDrawingManager2.class, + TestFormulaParser.class, + TestFormulaParserEval.class, + TestFormulaParserIf.class, + TestLinkTable.class, + TestOperandClassTransformer.class, + TestRowBlocksReader.class, + TestRVA.class, + TestSheet.class, + TestSheetAdditional.class, + TestWorkbook.class +}) public final class AllModelTests { - - public static Test suite() { - TestSuite result = new TestSuite(AllModelTests.class.getName()); - result.addTestSuite(TestDrawingManager.class); - result.addTestSuite(TestDrawingManager2.class); - result.addTestSuite(TestFormulaParser.class); - result.addTestSuite(TestFormulaParserEval.class); - result.addTestSuite(TestFormulaParserIf.class); - result.addTestSuite(TestLinkTable.class); - result.addTestSuite(TestOperandClassTransformer.class); - result.addTestSuite(TestRowBlocksReader.class); - result.addTestSuite(TestRVA.class); - result.addTestSuite(TestSheet.class); - result.addTestSuite(TestSheetAdditional.class); - result.addTestSuite(TestWorkbook.class); - return result; - } } diff --git a/src/testcases/org/apache/poi/hssf/model/TestRowBlocksReader.java b/src/testcases/org/apache/poi/hssf/model/TestRowBlocksReader.java index 3dd24aeeea..bf1fce7996 100644 --- a/src/testcases/org/apache/poi/hssf/model/TestRowBlocksReader.java +++ b/src/testcases/org/apache/poi/hssf/model/TestRowBlocksReader.java @@ -17,10 +17,12 @@ package org.apache.poi.hssf.model; -import java.util.Arrays; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; -import junit.framework.AssertionFailedError; -import junit.framework.TestCase; +import java.util.Arrays; import org.apache.poi.hssf.record.NumberRecord; import org.apache.poi.hssf.record.Record; @@ -28,27 +30,30 @@ import org.apache.poi.hssf.record.RowRecord; import org.apache.poi.hssf.record.UnknownRecord; import org.apache.poi.hssf.record.WindowTwoRecord; import org.apache.poi.hssf.record.pivottable.ViewDefinitionRecord; +import org.apache.poi.util.LocaleUtil; +import org.junit.Test; /** * Tests for {@link RowBlocksReader} * * @author Josh Micich */ -public final class TestRowBlocksReader extends TestCase { +public final class TestRowBlocksReader { + @Test public void testAbnormalPivotTableRecords_bug46280() { int SXVIEW_SID = ViewDefinitionRecord.sid; Record[] inRecs = { new RowRecord(0), new NumberRecord(), // normally MSODRAWING(0x00EC) would come here before SXVIEW - new UnknownRecord(SXVIEW_SID, "dummydata (SXVIEW: View Definition)".getBytes()), + new UnknownRecord(SXVIEW_SID, "dummydata (SXVIEW: View Definition)".getBytes(LocaleUtil.CHARSET_1252)), new WindowTwoRecord(), }; RecordStream rs = new RecordStream(Arrays.asList(inRecs), 0); RowBlocksReader rbr = new RowBlocksReader(rs); if (rs.peekNextClass() == WindowTwoRecord.class) { // Should have stopped at the SXVIEW record - throw new AssertionFailedError("Identified bug 46280b"); + fail("Identified bug 46280b"); } RecordStream rbStream = rbr.getPlainRecordStream(); assertEquals(inRecs[0], rbStream.getNext()); |