From 4aee13442d80aff4ca4478d44aa74ce767a95023 Mon Sep 17 00:00:00 2001 From: Avik Sengupta Date: Mon, 6 Oct 2003 10:16:28 +0000 Subject: [PATCH] Testcase for bug 15353 git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/branches/REL_2_BRANCH@353374 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/poi/hssf/usermodel/TestBugs.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java b/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java index 43073ac2d..57bd28622 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java @@ -121,7 +121,24 @@ extends TestCase { wb.write(out); out.close(); } - + + /* test hyperlinks + * open resulting file in excel, and check that there is a link to Google + **/ + public void test15353() throws Exception { + HSSFWorkbook wb = new HSSFWorkbook(); + HSSFSheet sheet = wb.createSheet("My sheet"); + + HSSFRow row = sheet.createRow( (short) 0 ); + HSSFCell cell = row.createCell( (short) 0 ); + cell.setCellFormula("HYPERLINK(\"http://google.com\",\"Google\")"); + + // Write out the workbook + File f = File.createTempFile("test15353",".xls"); + FileOutputStream fileOut = new FileOutputStream(f); + wb.write(fileOut); + fileOut.close(); + }