import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.XSSFITestDataProvider;
import org.apache.poi.xssf.XSSFTestDataSamples;
+import org.junit.Test;
public final class TestXSSFHyperlink extends BaseTestHyperlink {
public TestXSSFHyperlink() {
super(XSSFITestDataProvider.instance);
}
+ @Test
public void testLoadExisting() {
XSSFWorkbook workbook = XSSFTestDataSamples.openSampleWorkbook("WithMoreVariousData.xlsx");
assertEquals(3, workbook.getNumberOfSheets());
doTestHyperlinkContents(sheet);
}
+ @Test
public void testCreate() throws Exception {
XSSFWorkbook workbook = new XSSFWorkbook();
XSSFSheet sheet = workbook.createSheet();
}
}
+ @Test
public void testInvalidURLs() throws IOException {
XSSFWorkbook workbook = new XSSFWorkbook();
XSSFCreationHelper createHelper = workbook.getCreationHelper();
workbook.close();
}
+ @Test
public void testLoadSave() {
XSSFWorkbook workbook = XSSFTestDataSamples.openSampleWorkbook("WithMoreVariousData.xlsx");
CreationHelper createHelper = workbook.getCreationHelper();
sheet.getRow(16).getCell(2).getHyperlink().getAddress());
}
+ @Test
public void test52716() {
XSSFWorkbook wb1 = XSSFTestDataSamples.openSampleWorkbook("52716.xlsx");
XSSFSheet sh1 = wb1.getSheetAt(0);
assertEquals("B1", l2.getCellRef());
}
+ @Test
public void test53734() {
XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("53734.xlsx");
XSSFHyperlink link = wb.getSheetAt(0).getRow(0).getCell(0).getHyperlink();
assertEquals("javascript:///", link.getAddress());
}
+ @Test
public void test53282() {
XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("53282.xlsx");
XSSFHyperlink link = wb.getSheetAt(0).getRow(0).getCell(14).getHyperlink();
assertEquals(HSSFHyperlink.LINK_DOCUMENT, link.getType());
}
+ @Test
public void testModify() {
HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("HyperlinksOnManySheets.xls");
* link.setAddress("'Target Sheet-1'!A1"); //common between XSSF and HSSF
* @throws IOException
*/
+ @Test
public void testCreateDocumentLink() throws IOException {
HSSFWorkbook wb = new HSSFWorkbook();
wbBack.close();
}
+ @Test
public void testCloneSheet() {
HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("HyperlinksOnManySheets.xls");
assertEquals("http://poi.apache.org/hssf/", link.getAddress());
}
+ @Test
public void testCreate() throws IOException {
HSSFWorkbook wb = new HSSFWorkbook();
* Test that HSSFSheet#shiftRows moves hyperlinks,
* see bugs #46445 and #29957
*/
+ @Test
public void testShiftRows(){
HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("46445.xls");