diff options
author | Josh Micich <josh@apache.org> | 2009-02-20 01:55:47 +0000 |
---|---|---|
committer | Josh Micich <josh@apache.org> | 2009-02-20 01:55:47 +0000 |
commit | f67a432970c16886a2e9c55cd049090ad17f0119 (patch) | |
tree | 700f786a37e973e6ebf319600ccb4af882a2cb7a /src/testcases | |
parent | 83359062e7dfeba041086f81eff73a3c5609d9e8 (diff) | |
download | poi-f67a432970c16886a2e9c55cd049090ad17f0119.tar.gz poi-f67a432970c16886a2e9c55cd049090ad17f0119.zip |
More fixes to allow EscherContainerRecord to exclusively maintain 'child records' field. (due to r745976 / r746018)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@746085 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases')
-rwxr-xr-x | src/testcases/org/apache/poi/ddf/TestEscherBlipRecord.java | 8 | ||||
-rw-r--r-- | src/testcases/org/apache/poi/hssf/record/TestEscherAggregate.java | 18 |
2 files changed, 10 insertions, 16 deletions
diff --git a/src/testcases/org/apache/poi/ddf/TestEscherBlipRecord.java b/src/testcases/org/apache/poi/ddf/TestEscherBlipRecord.java index f7fecb666e..9d067d6eaf 100755 --- a/src/testcases/org/apache/poi/ddf/TestEscherBlipRecord.java +++ b/src/testcases/org/apache/poi/ddf/TestEscherBlipRecord.java @@ -44,8 +44,8 @@ public class TestEscherBlipRecord extends TestCase EscherContainerRecord record = new EscherContainerRecord();
record.fillFields(data, 0, new DefaultEscherRecordFactory());
- EscherContainerRecord bstore = (EscherContainerRecord)record.getChildRecords().get(1);
- EscherBSERecord bse1 = (EscherBSERecord)bstore.getChildRecords().get(0);
+ EscherContainerRecord bstore = (EscherContainerRecord)record.getChild(1);
+ EscherBSERecord bse1 = (EscherBSERecord)bstore.getChild(0);
assertEquals(EscherBSERecord.BT_PNG, bse1.getBlipTypeWin32());
assertEquals(EscherBSERecord.BT_PNG, bse1.getBlipTypeMacOS());
assertTrue(Arrays.equals(new byte[]{
@@ -89,8 +89,8 @@ public class TestEscherBlipRecord extends TestCase EscherContainerRecord record = new EscherContainerRecord();
record.fillFields(data, 0, new DefaultEscherRecordFactory());
- EscherContainerRecord bstore = (EscherContainerRecord)record.getChildRecords().get(1);
- EscherBSERecord bse1 = (EscherBSERecord)bstore.getChildRecords().get(1);
+ EscherContainerRecord bstore = (EscherContainerRecord)record.getChild(1);
+ EscherBSERecord bse1 = (EscherBSERecord)bstore.getChild(1);
//System.out.println(bse1);
assertEquals(EscherBSERecord.BT_WMF, bse1.getBlipTypeWin32());
assertEquals(EscherBSERecord.BT_PICT, bse1.getBlipTypeMacOS());
diff --git a/src/testcases/org/apache/poi/hssf/record/TestEscherAggregate.java b/src/testcases/org/apache/poi/hssf/record/TestEscherAggregate.java index 593290b337..a70f166a1d 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestEscherAggregate.java +++ b/src/testcases/org/apache/poi/hssf/record/TestEscherAggregate.java @@ -34,15 +34,11 @@ import java.util.List; * * @author Glen Stampoultzis (glens at apache.org) */ -public class TestEscherAggregate extends TestCase -{ +public final class TestEscherAggregate extends TestCase { /** * Tests that the create aggregate method correctly rejoins escher records together. - * - * @throws Exception */ - public void testCreateAggregate() throws Exception - { + public void testCreateAggregate() { String msoDrawingRecord1 = "0F 00 02 F0 20 01 00 00 10 00 08 F0 08 00 00 00 \n" + "03 00 00 00 02 04 00 00 0F 00 03 F0 08 01 00 00 \n" + @@ -76,7 +72,7 @@ public class TestEscherAggregate extends TestCase ObjRecord r2 = new ObjRecord(); - List records = new ArrayList(); + List<Record> records = new ArrayList<Record>(); records.add( d1 ); records.add( r1 ); records.add( d2 ); @@ -92,8 +88,7 @@ public class TestEscherAggregate extends TestCase // System.out.println( "aggregate = " + aggregate ); } - public void testSerialize() throws Exception - { + public void testSerialize() { EscherContainerRecord container1 = new EscherContainerRecord(); EscherContainerRecord spContainer1 = new EscherContainerRecord(); @@ -127,8 +122,8 @@ public class TestEscherAggregate extends TestCase EscherAggregate aggregate = new EscherAggregate(null); aggregate.addEscherRecord( container1 ); - aggregate.assoicateShapeToObjRecord( d2, new ObjRecord() ); - aggregate.assoicateShapeToObjRecord( d3, new ObjRecord() ); + aggregate.associateShapeToObjRecord( d2, new ObjRecord() ); + aggregate.associateShapeToObjRecord( d3, new ObjRecord() ); byte[] data = new byte[112]; int bytesWritten = aggregate.serialize( 0, data ); @@ -136,5 +131,4 @@ public class TestEscherAggregate extends TestCase assertEquals( "[EC, 00, 40, 00, 0F, 00, 00, 00, 58, 00, 00, 00, 0F, 00, 04, F0, 10, 00, 00, 00, 00, 00, 0A, F0, 08, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 0F, 00, 04, F0, 18, 00, 00, 00, 00, 00, 0A, F0, 08, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 11, F0, 00, 00, 00, 00, 5D, 00, 00, 00, EC, 00, 20, 00, 0F, 00, 04, F0, 18, 00, 00, 00, 00, 00, 0A, F0, 08, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 11, F0, 00, 00, 00, 00, 5D, 00, 00, 00]", HexDump.toHex( data ) ); } - } |