poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From u..@apache.org
Subject svn commit: r616314 - /poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/io/TestLoadSaveXSSF.java
Date Tue, 29 Jan 2008 13:48:24 GMT
Author: ugo
Date: Tue Jan 29 05:48:17 2008
New Revision: 616314

URL: http://svn.apache.org/viewvc?rev=616314&view=rev
Log:
Fix test so it loads data file from the correct place.

Modified:
    poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/io/TestLoadSaveXSSF.java

Modified: poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/io/TestLoadSaveXSSF.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/io/TestLoadSaveXSSF.java?rev=616314&r1=616313&r2=616314&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/io/TestLoadSaveXSSF.java (original)
+++ poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/io/TestLoadSaveXSSF.java Tue
Jan 29 05:48:17 2008
@@ -17,7 +17,7 @@
 
 package org.apache.poi.xssf.io;
 
-import java.net.URL;
+import java.io.File;
 
 import junit.framework.TestCase;
 
@@ -25,10 +25,16 @@
 
 
 public class TestLoadSaveXSSF extends TestCase {
+
+    String filename;
+
+    protected void setUp() throws Exception {
+        super.setUp();
+        filename = System.getProperty("HSSF.testdata.path");
+    }
     
     public void testLoadSample() throws Exception {
-        URL url = this.getClass().getResource("sample.xlsx");
-        XSSFWorkbook workbook = new XSSFWorkbook(url.getFile());
+        XSSFWorkbook workbook = new XSSFWorkbook(new File(filename, "sample.xlsx").getAbsolutePath());
         assertEquals(3, workbook.getNumberOfSheets());
         assertEquals("Sheet1", workbook.getSheetName(0));
     }



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


Mime
View raw message