Update test cases

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1165604 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sergey Vladimirov 2011-09-06 11:15:36 +00:00
parent dbfe0d76d0
commit 36bd0ba1a3
11 changed files with 37 additions and 19 deletions

View File

@ -63,7 +63,8 @@ public final class TestEscherChildAnchorRecord extends TestCase {
String expected = "org.apache.poi.ddf.EscherChildAnchorRecord:" + nl + String expected = "org.apache.poi.ddf.EscherChildAnchorRecord:" + nl +
" RecordId: 0xF00F" + nl + " RecordId: 0xF00F" + nl +
" Options: 0x0001" + nl + " Version: 0x0001" + nl +
" Instance: 0x0000" + nl +
" X1: 1" + nl + " X1: 1" + nl +
" Y1: 2" + nl + " Y1: 2" + nl +
" X2: 3" + nl + " X2: 3" + nl +

View File

@ -70,7 +70,8 @@ public class TestEscherClientAnchorRecord extends TestCase
String expected = "org.apache.poi.ddf.EscherClientAnchorRecord:" + nl + String expected = "org.apache.poi.ddf.EscherClientAnchorRecord:" + nl +
" RecordId: 0xF010" + nl + " RecordId: 0xF010" + nl +
" Options: 0x0001" + nl + " Version: 0x0001" + nl +
" Instance: 0x0000" + nl +
" Flag: 77" + nl + " Flag: 77" + nl +
" Col1: 55" + nl + " Col1: 55" + nl +
" DX1: 33" + nl + " DX1: 33" + nl +

View File

@ -53,7 +53,8 @@ public class TestEscherClientDataRecord extends TestCase
String expected = "org.apache.poi.ddf.EscherClientDataRecord:" + nl + String expected = "org.apache.poi.ddf.EscherClientDataRecord:" + nl +
" RecordId: 0xF011" + nl + " RecordId: 0xF011" + nl +
" Options: 0x0002" + nl + " Version: 0x0002" + nl +
" Instance: 0x0000" + nl +
" Extra Data:" + nl + " Extra Data:" + nl +
"No Data" + nl ; "No Data" + nl ;
assertEquals( expected, createRecord().toString() ); assertEquals( expected, createRecord().toString() );

View File

@ -76,27 +76,31 @@ public final class TestEscherContainerRecord extends TestCase {
String nl = System.getProperty("line.separator"); String nl = System.getProperty("line.separator");
assertEquals("org.apache.poi.ddf.EscherContainerRecord (SpContainer):" + nl + assertEquals("org.apache.poi.ddf.EscherContainerRecord (SpContainer):" + nl +
" isContainer: true" + nl + " isContainer: true" + nl +
" options: 0x000F" + nl + " version: 0x000F" + nl +
" instance: 0x0000" + nl +
" recordId: 0xF004" + nl + " recordId: 0xF004" + nl +
" numchildren: 0" + nl " numchildren: 0" + nl
, r.toString()); , r.toString());
EscherOptRecord r2 = new EscherOptRecord(); EscherOptRecord r2 = new EscherOptRecord();
r2.setOptions((short) 0x9876); // don't try to shoot in foot, please -- vlsergey
// r2.setOptions((short) 0x9876);
r2.setRecordId(EscherOptRecord.RECORD_ID); r2.setRecordId(EscherOptRecord.RECORD_ID);
String expected; String expected;
r.addChildRecord(r2); r.addChildRecord(r2);
expected = "org.apache.poi.ddf.EscherContainerRecord (SpContainer):" + nl + expected = "org.apache.poi.ddf.EscherContainerRecord (SpContainer):" + nl +
" isContainer: true" + nl + " isContainer: true" + nl +
" options: 0x000F" + nl + " version: 0x000F" + nl +
" instance: 0x0000" + nl +
" recordId: 0xF004" + nl + " recordId: 0xF004" + nl +
" numchildren: 1" + nl + " numchildren: 1" + nl +
" children: " + nl + " children: " + nl +
" Child 0:" + nl + " Child 0:" + nl +
" org.apache.poi.ddf.EscherOptRecord:" + nl + " org.apache.poi.ddf.EscherOptRecord:" + nl +
" isContainer: false" + nl + " isContainer: false" + nl +
" options: 0x0003" + nl + " version: 0x0003" + nl +
" instance: 0x0000" + nl +
" recordId: 0xF00B" + nl + " recordId: 0xF00B" + nl +
" numchildren: 0" + nl + " numchildren: 0" + nl +
" properties:" + nl + " properties:" + nl +
@ -106,14 +110,16 @@ public final class TestEscherContainerRecord extends TestCase {
r.addChildRecord(r2); r.addChildRecord(r2);
expected = "org.apache.poi.ddf.EscherContainerRecord (SpContainer):" + nl + expected = "org.apache.poi.ddf.EscherContainerRecord (SpContainer):" + nl +
" isContainer: true" + nl + " isContainer: true" + nl +
" options: 0x000F" + nl + " version: 0x000F" + nl +
" instance: 0x0000" + nl +
" recordId: 0xF004" + nl + " recordId: 0xF004" + nl +
" numchildren: 2" + nl + " numchildren: 2" + nl +
" children: " + nl + " children: " + nl +
" Child 0:" + nl + " Child 0:" + nl +
" org.apache.poi.ddf.EscherOptRecord:" + nl + " org.apache.poi.ddf.EscherOptRecord:" + nl +
" isContainer: false" + nl + " isContainer: false" + nl +
" options: 0x0003" + nl + " version: 0x0003" + nl +
" instance: 0x0000" + nl +
" recordId: 0xF00B" + nl + " recordId: 0xF00B" + nl +
" numchildren: 0" + nl + " numchildren: 0" + nl +
" properties:" + nl + " properties:" + nl +
@ -121,7 +127,8 @@ public final class TestEscherContainerRecord extends TestCase {
" Child 1:" + nl + " Child 1:" + nl +
" org.apache.poi.ddf.EscherOptRecord:" + nl + " org.apache.poi.ddf.EscherOptRecord:" + nl +
" isContainer: false" + nl + " isContainer: false" + nl +
" options: 0x0003" + nl + " version: 0x0003" + nl +
" instance: 0x0000" + nl +
" recordId: 0xF00B" + nl + " recordId: 0xF00B" + nl +
" numchildren: 0" + nl + " numchildren: 0" + nl +
" properties:" + nl + " properties:" + nl +

View File

@ -54,7 +54,8 @@ public final class TestEscherDgRecord extends TestCase {
public void testToString() { public void testToString() {
String expected = "org.apache.poi.ddf.EscherDgRecord:" + '\n' + String expected = "org.apache.poi.ddf.EscherDgRecord:" + '\n' +
" RecordId: 0xF008" + '\n' + " RecordId: 0xF008" + '\n' +
" Options: 0x0010" + '\n' + " Version: 0x0000" + '\n' +
" Instance: 0x0001" + '\n' +
" NumShapes: 2" + '\n' + " NumShapes: 2" + '\n' +
" LastMSOSPID: 1025" + '\n'; " LastMSOSPID: 1025" + '\n';
assertEquals( expected, createRecord().toString() ); assertEquals( expected, createRecord().toString() );

View File

@ -65,7 +65,8 @@ public final class TestEscherDggRecord extends TestCase {
public void testToString() { public void testToString() {
String expected = "org.apache.poi.ddf.EscherDggRecord:" + '\n' + String expected = "org.apache.poi.ddf.EscherDggRecord:" + '\n' +
" RecordId: 0xF006" + '\n' + " RecordId: 0xF006" + '\n' +
" Options: 0x0000" + '\n' + " Version: 0x0000" + '\n' +
" Instance: 0x0000" + '\n' +
" ShapeIdMax: 1026" + '\n' + " ShapeIdMax: 1026" + '\n' +
" NumIdClusters: 2" + '\n' + " NumIdClusters: 2" + '\n' +
" NumShapesSaved: 2" + '\n' + " NumShapesSaved: 2" + '\n' +

View File

@ -133,13 +133,15 @@ public final class TestEscherOptRecord extends TestCase {
public void testToString() { public void testToString() {
String nl = System.getProperty("line.separator"); String nl = System.getProperty("line.separator");
EscherOptRecord r = new EscherOptRecord(); EscherOptRecord r = new EscherOptRecord();
r.setOptions((short)0x000F); // don't try to shoot in foot, please -- vlsergey
// r.setOptions((short)0x000F);
r.setRecordId(EscherOptRecord.RECORD_ID); r.setRecordId(EscherOptRecord.RECORD_ID);
EscherProperty prop1 = new EscherBoolProperty((short)1, 1); EscherProperty prop1 = new EscherBoolProperty((short)1, 1);
r.addEscherProperty(prop1); r.addEscherProperty(prop1);
String expected = "org.apache.poi.ddf.EscherOptRecord:" + nl + String expected = "org.apache.poi.ddf.EscherOptRecord:" + nl +
" isContainer: true" + nl + " isContainer: false" + nl +
" options: 0x0013" + nl + " version: 0x0003" + nl +
" instance: 0x0001" + nl +
" recordId: 0x" + HexDump.toHex(EscherOptRecord.RECORD_ID) + nl + " recordId: 0x" + HexDump.toHex(EscherOptRecord.RECORD_ID) + nl +
" numchildren: 0" + nl + " numchildren: 0" + nl +
" properties:" + nl + " properties:" + nl +

View File

@ -57,7 +57,8 @@ public class TestEscherSpRecord extends TestCase
String expected = "org.apache.poi.ddf.EscherSpRecord:" + nl + String expected = "org.apache.poi.ddf.EscherSpRecord:" + nl +
" RecordId: 0xF00A" + nl + " RecordId: 0xF00A" + nl +
" Options: 0x0002" + nl + " Version: 0x0002" + nl +
" ShapeType: 0x0000" + nl +
" ShapeId: 1024" + nl + " ShapeId: 1024" + nl +
" Flags: GROUP|PATRIARCH (0x00000005)" + nl; " Flags: GROUP|PATRIARCH (0x00000005)" + nl;
assertEquals( expected, createRecord().toString() ); assertEquals( expected, createRecord().toString() );

View File

@ -61,7 +61,8 @@ public final class TestEscherSpgrRecord extends TestCase {
String expected = "org.apache.poi.ddf.EscherSpgrRecord:" + '\n' + String expected = "org.apache.poi.ddf.EscherSpgrRecord:" + '\n' +
" RecordId: 0xF009" + '\n' + " RecordId: 0xF009" + '\n' +
" Options: 0x0010" + '\n' + " Version: 0x0000" + '\n' +
" Instance: 0x0001" + '\n' +
" RectX: 1" + '\n' + " RectX: 1" + '\n' +
" RectY: 2" + '\n' + " RectY: 2" + '\n' +
" RectWidth: 3" + '\n' + " RectWidth: 3" + '\n' +

View File

@ -60,7 +60,8 @@ public final class TestEscherSplitMenuColorsRecord extends TestCase {
public void testToString() { public void testToString() {
String expected = "org.apache.poi.ddf.EscherSplitMenuColorsRecord:" + '\n' + String expected = "org.apache.poi.ddf.EscherSplitMenuColorsRecord:" + '\n' +
" RecordId: 0xF11E" + '\n' + " RecordId: 0xF11E" + '\n' +
" Options: 0x0040" + '\n' + " Version: 0x0000" + '\n' +
" Instance: 0x0004" + '\n' +
" Color1: 0x00000402" + '\n' + " Color1: 0x00000402" + '\n' +
" Color2: 0x00000002" + '\n' + " Color2: 0x00000002" + '\n' +
" Color3: 0x00000002" + '\n' + " Color3: 0x00000002" + '\n' +

View File

@ -146,7 +146,8 @@ public final class TestUnknownEscherRecord extends TestCase {
assertEquals( "org.apache.poi.ddf.UnknownEscherRecord:" + '\n' + assertEquals( "org.apache.poi.ddf.UnknownEscherRecord:" + '\n' +
" isContainer: false" + '\n' + " isContainer: false" + '\n' +
" options: 0x1234" + '\n' + " version: 0x0004" + '\n' +
" instance: 0x0123" + '\n' +
" recordId: 0xF112" + '\n' + " recordId: 0xF112" + '\n' +
" numchildren: 0" + '\n' + " numchildren: 0" + '\n' +
": 0" ": 0"