From f2bfa9df289e2d03b9d1a71fbbfb77a246524970 Mon Sep 17 00:00:00 2001 From: Ugo Cei Date: Tue, 29 Jan 2008 13:48:17 +0000 Subject: [PATCH] Fix test so it loads data file from the correct place. git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@616314 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/xssf/io/TestLoadSaveXSSF.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/ooxml/testcases/org/apache/poi/xssf/io/TestLoadSaveXSSF.java b/src/ooxml/testcases/org/apache/poi/xssf/io/TestLoadSaveXSSF.java index 18d0034f83..6127a63567 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/io/TestLoadSaveXSSF.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/io/TestLoadSaveXSSF.java @@ -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 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook; 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)); } -- 2.39.5