poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r682769 - in /poi/branches/ooxml/src: ooxml/testcases/org/apache/poi/xssf/extractor/TestXSSFExcelExtractor.java testcases/org/apache/poi/hssf/data/45544.xlsx
Date Tue, 05 Aug 2008 16:03:51 GMT
Author: nick
Date: Tue Aug  5 09:03:51 2008
New Revision: 682769

URL: http://svn.apache.org/viewvc?rev=682769&view=rev
Log:
Test to show that bug #45544 is incorrect

Added:
    poi/branches/ooxml/src/testcases/org/apache/poi/hssf/data/45544.xlsx   (with props)
Modified:
    poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/extractor/TestXSSFExcelExtractor.java

Modified: poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/extractor/TestXSSFExcelExtractor.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/extractor/TestXSSFExcelExtractor.java?rev=682769&r1=682768&r2=682769&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/extractor/TestXSSFExcelExtractor.java
(original)
+++ poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/extractor/TestXSSFExcelExtractor.java
Tue Aug  5 09:03:51 2008
@@ -212,4 +212,29 @@
 	        assertTrue("Unable to find expected word in text\n" + text, text.contains("test
phrase")); 
 		}
 	}
+
+	/**
+	 * From bug #45544
+	 */
+	public void testComments() throws Exception {
+		File xml = new File(
+				System.getProperty("HSSF.testdata.path") +
+				File.separator + "45544.xlsx"
+		);
+		assertTrue(xml.exists());
+		
+		XSSFExcelExtractor extractor = 
+			new XSSFExcelExtractor(new XSSFWorkbook(xml.toString()));
+		String text = extractor.getText();
+
+		// No comments there yet
+		assertFalse("Unable to find expected word in text\n" + text, text.contains("testdoc"));
+		assertFalse("Unable to find expected word in text\n" + text, text.contains("test phrase"));
+
+		// Turn on comment extraction, will then be
+		extractor.setIncludeCellComments(true);
+		text = extractor.getText();
+		assertTrue("Unable to find expected word in text\n" + text, text.contains("testdoc"));
+		assertTrue("Unable to find expected word in text\n" + text, text.contains("test phrase"));
+	}
 }

Added: poi/branches/ooxml/src/testcases/org/apache/poi/hssf/data/45544.xlsx
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/testcases/org/apache/poi/hssf/data/45544.xlsx?rev=682769&view=auto
==============================================================================
Binary file - no diff available.

Propchange: poi/branches/ooxml/src/testcases/org/apache/poi/hssf/data/45544.xlsx
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message