]> source.dussan.org Git - poi.git/commitdiff
Minor junit fix after r674953 (bug 45354). Hooked up loose tests in suite.
authorJosh Micich <josh@apache.org>
Wed, 9 Jul 2008 02:15:52 +0000 (02:15 +0000)
committerJosh Micich <josh@apache.org>
Wed, 9 Jul 2008 02:15:52 +0000 (02:15 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@675086 13f79535-47bb-0310-9956-ffa450edef68

src/testcases/org/apache/poi/hssf/HSSFTests.java
src/testcases/org/apache/poi/hssf/eventusermodel/AllEventUserModelTests.java [new file with mode: 0644]
src/testcases/org/apache/poi/hssf/eventusermodel/TestEventWorkbookBuilder.java
src/testcases/org/apache/poi/hssf/record/formula/TestSheetNameFormatter.java

index 0a4fa66af7d58ce8922988cd5e7aa40556a32c95..ff15491d90400611c2b39ba49f1e0e91aed9075a 100644 (file)
@@ -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 (file)
index 0000000..41e3b86
--- /dev/null
@@ -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 <tt>org.apache.poi.hssf.eventusermodel</tt>.
+ * 
+ * @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;
+       }
+}
index adf084331a4f2f5c072a850587ef4833fcc888a5..215732deb5bd6b252bb3ee76df562a041d861253 100644 (file)
@@ -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 {
index b6dd1970e49bfb3b386298c70f4a2166877cf6a2..369c09583a57777c427985c781c9dac1e5ce8a2b 100644 (file)
@@ -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
        }