From: Nick Burch Date: Sun, 19 Mar 2006 16:10:07 +0000 (+0000) Subject: Test for new Environment record X-Git-Tag: REL_3_0_ALPHA3~159 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=06117b145dfc4071dac9e638e3c0b10c7e0c0e09;p=poi.git Test for new Environment record git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@386987 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestDocument.java b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestDocument.java index 010e3ddc7c..cc1f642389 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestDocument.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestDocument.java @@ -28,6 +28,7 @@ import org.apache.poi.poifs.filesystem.*; /** * Tests that Document works properly + * (Also tests Environment while we're at it) * * @author Nick Burch (nick at torchbox dot com) */ @@ -66,7 +67,7 @@ public class TestDocument extends TestCase { assertTrue(dr.getDocumentAtom() instanceof DocumentAtom); assertNotNull(dr.getEnvironment()); - assertEquals(RecordTypes.Environment.typeID, dr.getEnvironment().getRecordType()); + assertTrue(dr.getEnvironment() instanceof Environment); assertNotNull(dr.getSlideListWithTexts()); assertEquals(3, dr.getSlideListWithTexts().length); @@ -78,5 +79,14 @@ public class TestDocument extends TestCase { assertTrue(dr.getSlideListWithTexts()[2] instanceof SlideListWithText); } + public void testEnvironment() throws Exception { + Document dr = getDocRecord(); + Environment env = dr.getEnvironment(); + + assertEquals(1010, env.getRecordType()); + assertNotNull(env.getFontCollection()); + assertTrue(env.getFontCollection() instanceof FontCollection); + } + // No need to check re-writing - hslf.TestReWrite does all that for us }