From 283c5f7c1e674c16538c2096d935c6629b3c7470 Mon Sep 17 00:00:00 2001 From: Josh Micich Date: Wed, 9 Jul 2008 02:15:52 +0000 Subject: [PATCH] Minor junit fix after r674953 (bug 45354). Hooked up loose tests in suite. git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@675086 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/hssf/HSSFTests.java | 2 + .../AllEventUserModelTests.java | 38 +++++++++++++++++++ .../TestEventWorkbookBuilder.java | 4 +- .../formula/TestSheetNameFormatter.java | 1 + 4 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 src/testcases/org/apache/poi/hssf/eventusermodel/AllEventUserModelTests.java diff --git a/src/testcases/org/apache/poi/hssf/HSSFTests.java b/src/testcases/org/apache/poi/hssf/HSSFTests.java index 0a4fa66af7..ff15491d90 100644 --- a/src/testcases/org/apache/poi/hssf/HSSFTests.java +++ b/src/testcases/org/apache/poi/hssf/HSSFTests.java @@ -22,6 +22,7 @@ import junit.framework.TestSuite; import org.apache.poi.hssf.eventmodel.TestEventRecordFactory; import org.apache.poi.hssf.eventmodel.TestModelFactory; +import org.apache.poi.hssf.eventusermodel.AllEventUserModelTests; import org.apache.poi.hssf.model.AllModelTests; import org.apache.poi.hssf.record.AllRecordTests; import org.apache.poi.hssf.usermodel.AllUserModelTests; @@ -48,6 +49,7 @@ public final class HSSFTests { TestSuite suite = new TestSuite("Tests for org.apache.poi.hssf"); // $JUnit-BEGIN$ + suite.addTest(AllEventUserModelTests.suite()); suite.addTest(AllModelTests.suite()); suite.addTest(AllUserModelTests.suite()); suite.addTest(AllRecordTests.suite()); diff --git a/src/testcases/org/apache/poi/hssf/eventusermodel/AllEventUserModelTests.java b/src/testcases/org/apache/poi/hssf/eventusermodel/AllEventUserModelTests.java new file mode 100644 index 0000000000..41e3b86322 --- /dev/null +++ b/src/testcases/org/apache/poi/hssf/eventusermodel/AllEventUserModelTests.java @@ -0,0 +1,38 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.hssf.eventusermodel; + +import junit.framework.Test; +import junit.framework.TestSuite; + +/** + * Collects all tests for org.apache.poi.hssf.eventusermodel. + * + * @author Josh Micich + */ +public class AllEventUserModelTests { + + public static Test suite() { + TestSuite result = new TestSuite(AllEventUserModelTests.class.getName()); + result.addTestSuite(TestEventWorkbookBuilder.class); + result.addTestSuite(TestFormatTrackingHSSFListener.class); + result.addTestSuite(TestHSSFEventFactory.class); + result.addTestSuite(TestMissingRecordAwareHSSFListener.class); + return result; + } +} diff --git a/src/testcases/org/apache/poi/hssf/eventusermodel/TestEventWorkbookBuilder.java b/src/testcases/org/apache/poi/hssf/eventusermodel/TestEventWorkbookBuilder.java index adf084331a..215732deb5 100644 --- a/src/testcases/org/apache/poi/hssf/eventusermodel/TestEventWorkbookBuilder.java +++ b/src/testcases/org/apache/poi/hssf/eventusermodel/TestEventWorkbookBuilder.java @@ -134,7 +134,7 @@ public final class TestEventWorkbookBuilder extends TestCase { fr = (FormulaRecord)mockListen._frecs.get(5); assertEquals(6, fr.getRow()); assertEquals(0, fr.getColumn()); - assertEquals("SUM('Sh3'!A1:A4)", FormulaParser.toFormulaString(stubHSSF, fr.getParsedExpression())); + assertEquals("SUM(Sh3!A1:A4)", FormulaParser.toFormulaString(stubHSSF, fr.getParsedExpression())); // Now, load via Usermodel and re-check @@ -142,7 +142,7 @@ public final class TestEventWorkbookBuilder extends TestCase { POIFSFileSystem fs = new POIFSFileSystem(is); HSSFWorkbook wb = new HSSFWorkbook(fs); assertEquals("Sheet1!A1", wb.getSheetAt(0).getRow(1).getCell(0).getCellFormula()); - assertEquals("SUM('Sh3'!A1:A4)", wb.getSheetAt(0).getRow(6).getCell(0).getCellFormula()); + assertEquals("SUM(Sh3!A1:A4)", wb.getSheetAt(0).getRow(6).getCell(0).getCellFormula()); } private static final class MockHSSFListener implements HSSFListener { diff --git a/src/testcases/org/apache/poi/hssf/record/formula/TestSheetNameFormatter.java b/src/testcases/org/apache/poi/hssf/record/formula/TestSheetNameFormatter.java index b6dd1970e4..369c09583a 100644 --- a/src/testcases/org/apache/poi/hssf/record/formula/TestSheetNameFormatter.java +++ b/src/testcases/org/apache/poi/hssf/record/formula/TestSheetNameFormatter.java @@ -71,6 +71,7 @@ public final class TestSheetNameFormatter extends TestCase { confirmCellNameMatch("aa1", true); confirmCellNameMatch("A1A", false); confirmCellNameMatch("A1A1", false); + confirmCellNameMatch("Sh3", false); confirmCellNameMatch("SALES20080101", false); // out of range } -- 2.39.5