From: Nick Burch Date: Wed, 17 Jan 2007 17:12:26 +0000 (+0000) Subject: Add ExHyperlink tests against a real file X-Git-Tag: REL_3_0_RC1~14 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5850fe049c83557150ff739f56a2ec962444aba7;p=poi.git Add ExHyperlink tests against a real file git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@497090 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/RecordTypes.java b/src/scratchpad/src/org/apache/poi/hslf/record/RecordTypes.java index e2194ab7bc..5e69dcead1 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/RecordTypes.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/RecordTypes.java @@ -59,7 +59,7 @@ public class RecordTypes { public static final Type DocRoutingSlip = new Type(1030,null); public static final Type OutlineViewInfo = new Type(1031,null); public static final Type SorterViewInfo = new Type(1032,null); - public static final Type ExObjList = new Type(1033,null); + public static final Type ExObjList = new Type(1033,DummyRecordWithChildren.class); public static final Type ExObjListAtom = new Type(1034,null); public static final Type PPDrawingGroup = new Type(1035,PPDrawingGroup.class); public static final Type PPDrawing = new Type(1036,PPDrawing.class); diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExHyperlink.java b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExHyperlink.java index 64a5dd30d4..ad489a5d50 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExHyperlink.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExHyperlink.java @@ -24,8 +24,12 @@ package org.apache.poi.hslf.record; import junit.framework.TestCase; import java.io.ByteArrayOutputStream; import java.text.SimpleDateFormat; +import java.util.ArrayList; import java.util.Date; +import org.apache.poi.hslf.HSLFSlideShow; +import org.apache.poi.hslf.usermodel.SlideShow; + /** * Tests that ExHyperlink works properly. * @@ -95,6 +99,46 @@ public class TestExHyperlink extends TestCase { } public void testRealFile() throws Exception { - // TODO + String dirname = System.getProperty("HSLF.testdata.path"); + HSLFSlideShow hss = new HSLFSlideShow(dirname + "WithLinks.ppt"); + SlideShow ss = new SlideShow(hss); + + // Get the document + Document doc = ss.getDocumentRecord(); + // Get the ExObjList + RecordContainer exObjList = null; + for(int i=0; i