diff options
author | Florian Thienel | 2013-01-19 08:18:50 -0500 |
---|---|---|
committer | Florian Thienel | 2013-01-19 08:18:50 -0500 |
commit | 64aa79f8fd2d7366a7cc3fb81c4ad777950488eb (patch) | |
tree | 23b38dad0f52d40111955ebebf427acf63a71041 | |
parent | 527e9b963bff8d2b39ffca25b0e01db66902877c (diff) | |
download | org.eclipse.mylyn.docs.vex-64aa79f8fd2d7366a7cc3fb81c4ad777950488eb.tar.gz org.eclipse.mylyn.docs.vex-64aa79f8fd2d7366a7cc3fb81c4ad777950488eb.tar.xz org.eclipse.mylyn.docs.vex-64aa79f8fd2d7366a7cc3fb81c4ad777950488eb.zip |
re-activate LayoutTestSuite
Signed-off-by: Florian Thienel <florian@thienel.org>
8 files changed, 1338 insertions, 1266 deletions
diff --git a/org.eclipse.vex.core.tests/src/org/eclipse/vex/core/internal/layout/LayoutTestSuite.java b/org.eclipse.vex.core.tests/src/org/eclipse/vex/core/internal/layout/LayoutTestSuite.java index 17b849c4..cf9b0c5f 100644 --- a/org.eclipse.vex.core.tests/src/org/eclipse/vex/core/internal/layout/LayoutTestSuite.java +++ b/org.eclipse.vex.core.tests/src/org/eclipse/vex/core/internal/layout/LayoutTestSuite.java @@ -191,7 +191,7 @@ public class LayoutTestSuite extends TestCase { final String s = new String(ch, start, length).trim(); if (s.length() > 0) { if (inDoc) { - testCase.doc = new String(ch, start, length); + testCase.doc = testCase.doc + new String(ch, start, length); } else { throw new IllegalStateException(); } @@ -233,6 +233,7 @@ public class LayoutTestSuite extends TestCase { testCases.add(testCase); } else if (qName.equals("doc")) { inDoc = true; + testCase.doc = ""; } else if (qName.equals("result")) { } else if (qName.equals("box")) { final BoxSpec parent = boxSpec; diff --git a/org.eclipse.vex.core.tests/src/org/eclipse/vex/core/internal/layout/before-after.css b/org.eclipse.vex.core.tests/src/org/eclipse/vex/core/internal/layout/before-after.css index e4817c7b..78e02cd1 100644 --- a/org.eclipse.vex.core.tests/src/org/eclipse/vex/core/internal/layout/before-after.css +++ b/org.eclipse.vex.core.tests/src/org/eclipse/vex/core/internal/layout/before-after.css @@ -1,3 +1,6 @@ +root { + display: block; +} iia { display: inline; diff --git a/org.eclipse.vex.core.tests/src/org/eclipse/vex/core/internal/layout/before-after.xml b/org.eclipse.vex.core.tests/src/org/eclipse/vex/core/internal/layout/before-after.xml index 586ebb11..19670dbe 100644 --- a/org.eclipse.vex.core.tests/src/org/eclipse/vex/core/internal/layout/before-after.xml +++ b/org.eclipse.vex.core.tests/src/org/eclipse/vex/core/internal/layout/before-after.xml @@ -1,145 +1,130 @@ <?xml version='1.0'?> <testcases css="before-after.css"> - <test id="Block with Block Before" layoutWidth="100"> - <doc><![CDATA[ <root><bbb>wuzzle</bbb></root> ]]></doc> - <result> - <box class="RootBox"> - <box class="BlockElementBox" element="root"> - - <box class="BlockElementBox" element="bbb"> - - <box class="BlockPseudoElementBox"> - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="StaticTextBox" text="BEFORE" /> - </box> - </box> - </box> - - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="DocumentTextBox" text="wuzzle" /> - <box class="PlaceholderBox"/> - </box> - </box> - - </box> - </box> - </box> - </result> - </test> - - - - <test id="Block with Block After" layoutWidth="100"> - <doc><![CDATA[ <root><bba>wuzzle</bba></root> ]]></doc> - <result> - <box class="RootBox"> - <box class="BlockElementBox" element="root"> - - <box class="BlockElementBox" element="bba"> - - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="DocumentTextBox" text="wuzzle" /> - <box class="PlaceholderBox"/> - </box> - </box> - - <box class="BlockPseudoElementBox"> - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="StaticTextBox" text="AFTER" /> - </box> - </box> - </box> - - </box> - </box> - </box> - </result> - </test> - - - <test id="Block with Inline Before" layoutWidth="100"> - <doc><![CDATA[ <root><bib>wuzzle</bib></root> ]]></doc> - <result> - <box class="RootBox"> - <box class="BlockElementBox" element="root"> - - <box class="BlockElementBox" element="bib"> - - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="StaticTextBox" text="before" /> - <box class="DocumentTextBox" text="wuzzle" /> - <box class="PlaceholderBox"/> - </box> - </box> - - </box> - </box> - </box> - </result> - </test> - - <test id="Block with Inline After" layoutWidth="100"> - <doc><![CDATA[ <root><bia>wuzzle</bia></root> ]]></doc> - <result> - <box class="RootBox"> - <box class="BlockElementBox" element="root"> - - <box class="BlockElementBox" element="bia"> - - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="DocumentTextBox" text="wuzzle" /> - <box class="PlaceholderBox"/> - <box class="StaticTextBox" text="after" /> - </box> - </box> - - </box> - </box> - </box> - </result> - </test> - - -<!-- - <test id="Inline with Block Before" layoutWidth="100"> - <doc><![CDATA[ <root><ibb>wuzzle</ibb></root> ]]></doc> - <result> - <box class="RootBox"> - <box class="BlockElementBox" element="root"> - - <box class="BlockPseudoElementBox"> - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="StaticTextBox" text="BEFORE" /> - </box> - </box> - </box> - - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="InlineElementBox" element="ibb"> - <box class="DrawableBox" /> - <box class="DocumentTextBox" text="wuzzle" /> - <box class="PlaceholderBox"/> - <box class="DrawbleBox" /> - </box> - <box class="PlaceholderBox"/> - </box> - </box> - - </box> - </box> - </result> - </test> ---> - - - + <test id="Block with Block Before" layoutWidth="100"> + <doc><![CDATA[ <root><bbb>wuzzle</bbb></root> ]]></doc> + <result> + <box class="RootBox"> + <box class="BlockElementBox"> + <box class="BlockElementBox" element="root"> + + <box class="BlockElementBox" element="bbb"> + + <box class="BlockPseudoElementBox"> + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="StaticTextBox" text="BEFORE" /> + </box> + </box> + </box> + + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="DocumentTextBox" text="wuzzle" /> + <box class="PlaceholderBox" /> + </box> + </box> + + </box> + </box> + </box> + </box> + </result> + </test> + + + + <test id="Block with Block After" layoutWidth="100"> + <doc><![CDATA[ <root><bba>wuzzle</bba></root> ]]></doc> + <result> + <box class="RootBox"> + <box class="BlockElementBox"> + <box class="BlockElementBox" element="root"> + + <box class="BlockElementBox" element="bba"> + + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="DocumentTextBox" text="wuzzle" /> + <box class="PlaceholderBox" /> + </box> + </box> + + <box class="BlockPseudoElementBox"> + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="StaticTextBox" text="AFTER" /> + </box> + </box> + </box> + + </box> + </box> + </box> + </box> + </result> + </test> + + + <test id="Block with Inline Before" layoutWidth="100"> + <doc><![CDATA[ <root><bib>wuzzle</bib></root> ]]></doc> + <result> + <box class="RootBox"> + <box class="BlockElementBox"> + <box class="BlockElementBox" element="root"> + + <box class="BlockElementBox" element="bib"> + + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="StaticTextBox" text="before" /> + <box class="DocumentTextBox" text="wuzzle" /> + <box class="PlaceholderBox" /> + </box> + </box> + + </box> + </box> + </box> + </box> + </result> + </test> + + <test id="Block with Inline After" layoutWidth="100"> + <doc><![CDATA[ <root><bia>wuzzle</bia></root> ]]></doc> + <result> + <box class="RootBox"> + <box class="BlockElementBox"> + <box class="BlockElementBox" element="root"> + + <box class="BlockElementBox" element="bia"> + + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="DocumentTextBox" text="wuzzle" /> + <box class="PlaceholderBox" /> + <box class="StaticTextBox" text="after" /> + </box> + </box> + + </box> + </box> + </box> + </box> + </result> + </test> + + + <!-- <test id="Inline with Block Before" layoutWidth="100"> <doc><![CDATA[ + <root><ibb>wuzzle</ibb></root> ]]></doc> <result> <box class="RootBox"> <box + class="BlockElementBox" element="root"> <box class="BlockPseudoElementBox"> + <box class="ParagraphBox"> <box class="LineBox"> <box class="StaticTextBox" + text="BEFORE" /> </box> </box> </box> <box class="ParagraphBox"> <box class="LineBox"> + <box class="InlineElementBox" element="ibb"> <box class="DrawableBox" /> + <box class="DocumentTextBox" text="wuzzle" /> <box class="PlaceholderBox"/> + <box class="DrawbleBox" /> </box> <box class="PlaceholderBox"/> </box> </box> + </box> </box> </result> </test> --> + + + </testcases> diff --git a/org.eclipse.vex.core.tests/src/org/eclipse/vex/core/internal/layout/block-inline.xml b/org.eclipse.vex.core.tests/src/org/eclipse/vex/core/internal/layout/block-inline.xml index c9a47015..d9aaccd5 100644 --- a/org.eclipse.vex.core.tests/src/org/eclipse/vex/core/internal/layout/block-inline.xml +++ b/org.eclipse.vex.core.tests/src/org/eclipse/vex/core/internal/layout/block-inline.xml @@ -1,343 +1,364 @@ <?xml version='1.0'?> <testcases css="block-inline.css"> - <test id="Empty Root" layoutWidth="100"> - <doc><![CDATA[ <root/> ]]></doc> - <result> - <box class="RootBox"> - <box class="BlockElementBox" element="root"> - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="PlaceholderBox"/> - </box> - </box> - </box> - </box> - </result> - </test> - - <test id="Simple Text" layoutWidth="100"> - <doc><![CDATA[ <root>Hello, world!</root> ]]></doc> - <result> - <box class="RootBox"> - <box class="BlockElementBox" element="root"> - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="DocumentTextBox" text="Hello, "/> - <box class="DocumentTextBox" text="world!"/> - <box class="PlaceholderBox"/> - </box> - </box> - </box> - </box> - </result> - </test> - - - - <!-- - A simple wrap. 42 = length("Hello, ") * 6 - --> - <test id="Simple Wrap" layoutWidth="42"> - <doc><![CDATA[ <root>Hello, world!</root> ]]></doc> - <result> - <box class="RootBox"> - <box class="BlockElementBox" element="root"> - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="DocumentTextBox" text="Hello, " /> - </box> - <box class="LineBox"> - <box class="DocumentTextBox" text="world!" /> - <box class="PlaceholderBox"/> - </box> - </box> - </box> - </box> - </result> - </test> - - - <!-- - Attempts to split the text inside the space after "Hello,". - The space should remain with "Hello," and not be split on to its - own line - --> - <test id="Split at First Space" layoutWidth="40"> - <doc><![CDATA[ <root>Hello, world!</root> ]]></doc> - <result> - <box class="RootBox"> - <box class="BlockElementBox" element="root"> - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="DocumentTextBox" text="Hello, " /> - </box> - <box class="LineBox"> - <box class="DocumentTextBox" text="world!" /> - <box class="PlaceholderBox"/> - </box> - </box> - </box> - </box> - </result> - </test> - - - <test id="Empty Inline" layoutWidth="100"> - <doc><![CDATA[ <root><b></b></root> ]]></doc> - <result> - <box class="RootBox"> - <box class="BlockElementBox" element="root"> - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="PlaceholderBox"/> - <box class="InlineElementBox"> - <box class="DrawableBox"/> - <box class="PlaceholderBox"/> - <box class="DrawableBox"/> - </box> - <box class="PlaceholderBox"/> - </box> - </box> - </box> - </box> - </result> - </test> - - - <test id="Simple Inline" layoutWidth="100"> - <doc><![CDATA[ <root><b>cat sat</b></root> ]]></doc> - <result> - <box class="RootBox"> - <box class="BlockElementBox" element="root"> - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="PlaceholderBox"/> - <box class="InlineElementBox"> - <box class="DrawableBox"/> - <box class="DocumentTextBox" text="cat " /> - <box class="DocumentTextBox" text="sat" /> - <box class="PlaceholderBox"/> - <box class="DrawableBox"/> - </box> - <box class="PlaceholderBox"/> - </box> - </box> - </box> - </box> - </result> - </test> - - - <test id="Simple Inline Split 1" layoutWidth="36"> - <doc><![CDATA[ <root><b>cat sat</b></root> ]]></doc> - <result> - <box class="RootBox"> - <box class="BlockElementBox" element="root"> - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="PlaceholderBox"/> - <box class="InlineElementBox"> - <box class="DrawableBox"/> - <box class="DocumentTextBox" text="cat " /> - </box> - </box> - <box class="LineBox"> - <box class="InlineElementBox"> - <box class="DocumentTextBox" text="sat" /> - <box class="PlaceholderBox"/> - <box class="DrawableBox"/> - </box> - <box class="PlaceholderBox"/> - </box> - </box> - </box> - </box> - </result> - </test> - - - <test id="Inline With Surrounding Text" layoutWidth="100"> - <doc><![CDATA[ <root>hat <b>cat sat</b> bat</root> ]]></doc> - <result> - <box class="RootBox"> - <box class="BlockElementBox" element="root"> - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="DocumentTextBox" text="hat " /> - <box class="PlaceholderBox"/> - <box class="InlineElementBox"> - <box class="DrawableBox"/> - <box class="DocumentTextBox" text="cat " /> - <box class="DocumentTextBox" text="sat" /> - <box class="PlaceholderBox"/> - <box class="DrawableBox"/> - </box> - <box class="DocumentTextBox" text=" " /> - <box class="DocumentTextBox" text="bat" /> - <box class="PlaceholderBox"/> - </box> - </box> - </box> - </box> - </result> - </test> - - - <test id="Inline With Surrounding Text Split 1" layoutWidth="76"> - <doc><![CDATA[ <root>hat <b>cat sat</b> bat</root> ]]></doc> - <result> - <box class="RootBox"> - <box class="BlockElementBox" element="root"> - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="DocumentTextBox" text="hat "/> - <box class="PlaceholderBox"/> - <box class="InlineElementBox"> - <box class="DrawableBox"/> - <box class="DocumentTextBox" text="cat " /> - <box class="DocumentTextBox" text="sat" /> - <box class="PlaceholderBox"/> - <box class="DrawableBox"/> - </box> - <box class="DocumentTextBox" text=" " /> - </box> - <box class="LineBox"> - <box class="DocumentTextBox" text="bat" /> - <box class="PlaceholderBox"/> - </box> - </box> - </box> - </box> - </result> - </test> - - - <test id="Inline With Surrounding Text Split 2" layoutWidth="75"> - <doc><![CDATA[ <root>hat <b>cat sat</b> bat</root> ]]></doc> - <result> - <box class="RootBox"> - <box class="BlockElementBox" element="root"> - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="DocumentTextBox" text="hat " /> - <box class="PlaceholderBox"/> - <box class="InlineElementBox"> - <box class="DrawableBox"/> - <box class="DocumentTextBox" text="cat " /> - </box> - </box> - <box class="LineBox"> - <box class="InlineElementBox"> - <box class="DocumentTextBox" text="sat" /> - <box class="PlaceholderBox"/> - <box class="DrawableBox"/> - </box> - <box class="DocumentTextBox" text=" " /> - <box class="DocumentTextBox" text="bat" /> - <box class="PlaceholderBox"/> - </box> - </box> - </box> - </box> - </result> - </test> - - - - <test id="Block Child w/ Inline Before" layoutWidth="75"> - <doc><![CDATA[ <root>Paris <p>Garters</p></root> ]]></doc> - <result> - <box class="RootBox"> - <box class="BlockElementBox" element="root"> - - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="DocumentTextBox" text="Paris" /> - <box class="PlaceholderBox"/> - </box> - </box> - - <box class="BlockElementBox"> - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="DocumentTextBox" text="Garters" /> - <box class="PlaceholderBox"/> - </box> - </box> - </box> - - </box> - </box> - </result> - </test> - - - - <test id="Block Child w/ Inline After" layoutWidth="100"> - <doc><![CDATA[ <root><p>Harris</p> Tweed</root> ]]></doc> - <result> - <box class="RootBox"> - <box class="BlockElementBox" element="root"> - - <box class="BlockElementBox"> - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="DocumentTextBox" text="Harris" /> - <box class="PlaceholderBox"/> - </box> - </box> - </box> - - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="DocumentTextBox" text="Tweed" /> - <box class="PlaceholderBox"/> - </box> - </box> - - </box> - </box> - </result> - </test> - - - <test id="Block Child w/ Surrounding Inlines" layoutWidth="200"> - <doc><![CDATA[ <root>Oliver <p>Boliver</p> Butt</root> ]]></doc> - <result> - <box class="RootBox"> - <box class="BlockElementBox" element="root"> - - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="DocumentTextBox" text="Oliver" /> - <box class="PlaceholderBox"/> - </box> - </box> - - <box class="BlockElementBox"> - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="DocumentTextBox" text="Boliver" /> - <box class="PlaceholderBox"/> - </box> - </box> - </box> - - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="DocumentTextBox" text="Butt" /> - <box class="PlaceholderBox"/> - </box> - </box> - - </box> - </box> - </result> - </test> - - - <!-- TODO test blocks inside inlines --> - - + <test id="Empty Root" layoutWidth="100"> + <doc><![CDATA[ <root/> ]]></doc> + <result> + <box class="RootBox"> + <box class="BlockElementBox"> + <box class="BlockElementBox" element="root"> + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="PlaceholderBox" /> + </box> + </box> + </box> + </box> + </box> + </result> + </test> + + <test id="Simple Text" layoutWidth="100"> + <doc><![CDATA[ <root>Hello, world!</root> ]]></doc> + <result> + <box class="RootBox"> + <box class="BlockElementBox"> + <box class="BlockElementBox" element="root"> + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="DocumentTextBox" text="Hello, " /> + <box class="DocumentTextBox" text="world!" /> + <box class="PlaceholderBox" /> + </box> + </box> + </box> + </box> + </box> + </result> + </test> + + + + <!-- A simple wrap. 42 = length("Hello, ") * 6 --> + <test id="Simple Wrap" layoutWidth="42"> + <doc><![CDATA[ <root>Hello, world!</root> ]]></doc> + <result> + <box class="RootBox"> + <box class="BlockElementBox"> + <box class="BlockElementBox" element="root"> + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="DocumentTextBox" text="Hello, " /> + </box> + <box class="LineBox"> + <box class="DocumentTextBox" text="world!" /> + <box class="PlaceholderBox" /> + </box> + </box> + </box> + </box> + </box> + </result> + </test> + + + <!-- Attempts to split the text inside the space after "Hello,". The space + should remain with "Hello," and not be split on to its own line --> + <test id="Split at First Space" layoutWidth="40"> + <doc><![CDATA[ <root>Hello, world!</root> ]]></doc> + <result> + <box class="RootBox"> + <box class="BlockElementBox"> + <box class="BlockElementBox" element="root"> + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="DocumentTextBox" text="Hello, " /> + </box> + <box class="LineBox"> + <box class="DocumentTextBox" text="world!" /> + <box class="PlaceholderBox" /> + </box> + </box> + </box> + </box> + </box> + </result> + </test> + + + <test id="Empty Inline" layoutWidth="100"> + <doc><![CDATA[ <root><b></b></root> ]]></doc> + <result> + <box class="RootBox"> + <box class="BlockElementBox"> + <box class="BlockElementBox" element="root"> + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="PlaceholderBox" /> + <box class="InlineElementBox"> + <box class="DrawableBox" /> + <box class="PlaceholderBox" /> + <box class="DrawableBox" /> + </box> + <box class="PlaceholderBox" /> + </box> + </box> + </box> + </box> + </box> + </result> + </test> + + + <test id="Simple Inline" layoutWidth="100"> + <doc><![CDATA[ <root><b>cat sat</b></root> ]]></doc> + <result> + <box class="RootBox"> + <box class="BlockElementBox"> + <box class="BlockElementBox" element="root"> + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="PlaceholderBox" /> + <box class="InlineElementBox"> + <box class="DrawableBox" /> + <box class="DocumentTextBox" text="cat " /> + <box class="DocumentTextBox" text="sat" /> + <box class="PlaceholderBox" /> + <box class="DrawableBox" /> + </box> + <box class="PlaceholderBox" /> + </box> + </box> + </box> + </box> + </box> + </result> + </test> + + + <test id="Simple Inline Split 1" layoutWidth="36"> + <doc><![CDATA[ <root><b>cat sat</b></root> ]]></doc> + <result> + <box class="RootBox"> + <box class="BlockElementBox"> + <box class="BlockElementBox" element="root"> + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="PlaceholderBox" /> + <box class="InlineElementBox"> + <box class="DrawableBox" /> + <box class="DocumentTextBox" text="cat " /> + </box> + </box> + <box class="LineBox"> + <box class="InlineElementBox"> + <box class="DocumentTextBox" text="sat" /> + <box class="PlaceholderBox" /> + <box class="DrawableBox" /> + </box> + <box class="PlaceholderBox" /> + </box> + </box> + </box> + </box> + </box> + </result> + </test> + + + <test id="Inline With Surrounding Text" layoutWidth="100"> + <doc><![CDATA[ <root>hat <b>cat sat</b> bat</root> ]]></doc> + <result> + <box class="RootBox"> + <box class="BlockElementBox"> + <box class="BlockElementBox" element="root"> + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="DocumentTextBox" text="hat " /> + <box class="PlaceholderBox" /> + <box class="InlineElementBox"> + <box class="DrawableBox" /> + <box class="DocumentTextBox" text="cat " /> + <box class="DocumentTextBox" text="sat" /> + <box class="PlaceholderBox" /> + <box class="DrawableBox" /> + </box> + <box class="DocumentTextBox" text=" " /> + <box class="DocumentTextBox" text="bat" /> + <box class="PlaceholderBox" /> + </box> + </box> + </box> + </box> + </box> + </result> + </test> + + + <test id="Inline With Surrounding Text Split 1" layoutWidth="76"> + <doc><![CDATA[ <root>hat <b>cat sat</b> bat</root> ]]></doc> + <result> + <box class="RootBox"> + <box class="BlockElementBox"> + <box class="BlockElementBox" element="root"> + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="DocumentTextBox" text="hat " /> + <box class="PlaceholderBox" /> + <box class="InlineElementBox"> + <box class="DrawableBox" /> + <box class="DocumentTextBox" text="cat " /> + <box class="DocumentTextBox" text="sat" /> + <box class="PlaceholderBox" /> + <box class="DrawableBox" /> + </box> + <box class="DocumentTextBox" text=" " /> + </box> + <box class="LineBox"> + <box class="DocumentTextBox" text="bat" /> + <box class="PlaceholderBox" /> + </box> + </box> + </box> + </box> + </box> + </result> + </test> + + + <test id="Inline With Surrounding Text Split 2" layoutWidth="75"> + <doc><![CDATA[ <root>hat <b>cat sat</b> bat</root> ]]></doc> + <result> + <box class="RootBox"> + <box class="BlockElementBox"> + <box class="BlockElementBox" element="root"> + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="DocumentTextBox" text="hat " /> + <box class="PlaceholderBox" /> + <box class="InlineElementBox"> + <box class="DrawableBox" /> + <box class="DocumentTextBox" text="cat " /> + </box> + </box> + <box class="LineBox"> + <box class="InlineElementBox"> + <box class="DocumentTextBox" text="sat" /> + <box class="PlaceholderBox" /> + <box class="DrawableBox" /> + </box> + <box class="DocumentTextBox" text=" " /> + <box class="DocumentTextBox" text="bat" /> + <box class="PlaceholderBox" /> + </box> + </box> + </box> + </box> + </box> + </result> + </test> + + + + <test id="Block Child w/ Inline Before" layoutWidth="75"> + <doc><![CDATA[ <root>Paris <p>Garters</p></root> ]]></doc> + <result> + <box class="RootBox"> + <box class="BlockElementBox"> + <box class="BlockElementBox" element="root"> + + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="DocumentTextBox" text="Paris" /> + <box class="PlaceholderBox" /> + </box> + </box> + + <box class="BlockElementBox"> + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="DocumentTextBox" text="Garters" /> + <box class="PlaceholderBox" /> + </box> + </box> + </box> + + </box> + </box> + </box> + </result> + </test> + + + + <test id="Block Child w/ Inline After" layoutWidth="100"> + <doc><![CDATA[ <root><p>Harris</p> Tweed</root> ]]></doc> + <result> + <box class="RootBox"> + <box class="BlockElementBox"> + <box class="BlockElementBox" element="root"> + + <box class="BlockElementBox"> + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="DocumentTextBox" text="Harris" /> + <box class="PlaceholderBox" /> + </box> + </box> + </box> + + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="DocumentTextBox" text="Tweed" /> + <box class="PlaceholderBox" /> + </box> + </box> + + </box> + </box> + </box> + </result> + </test> + + + <test id="Block Child w/ Surrounding Inlines" layoutWidth="200"> + <doc><![CDATA[ <root>Oliver <p>Boliver</p> Butt</root> ]]></doc> + <result> + <box class="RootBox"> + <box class="BlockElementBox"> + <box class="BlockElementBox" element="root"> + + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="DocumentTextBox" text="Oliver" /> + <box class="PlaceholderBox" /> + </box> + </box> + + <box class="BlockElementBox"> + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="DocumentTextBox" text="Boliver" /> + <box class="PlaceholderBox" /> + </box> + </box> + </box> + + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="DocumentTextBox" text="Butt" /> + <box class="PlaceholderBox" /> + </box> + </box> + + </box> + </box> + </box> + </result> + </test> + + + <!-- TODO test blocks inside inlines --> + + </testcases> diff --git a/org.eclipse.vex.core.tests/src/org/eclipse/vex/core/internal/layout/linebreaks.xml b/org.eclipse.vex.core.tests/src/org/eclipse/vex/core/internal/layout/linebreaks.xml index 12eafd8d..68aa6356 100644 --- a/org.eclipse.vex.core.tests/src/org/eclipse/vex/core/internal/layout/linebreaks.xml +++ b/org.eclipse.vex.core.tests/src/org/eclipse/vex/core/internal/layout/linebreaks.xml @@ -2,252 +2,270 @@ <testcases css="linebreaks.css"> - <test id="LF" layoutWidth="100"> - <doc><![CDATA[ <root><pre>newline
end</pre></root> ]]></doc> - <result> - <box class="RootBox"> - <box class="BlockElementBox" element="root"> - - <box class="BlockElementBox" element="pre"> - - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="DocumentTextBox" text="newline " /> - </box> - <box class="LineBox"> - <box class="DocumentTextBox" text="end" /> - <box class="PlaceholderBox"/> - </box> - </box> - - </box> - </box> - </box> - </result> - </test> - - - <test id="Two LFs" layoutWidth="100"> - <doc><![CDATA[ <root><pre>newline

end</pre></root> ]]></doc> - <result> - <box class="RootBox"> - <box class="BlockElementBox" element="root"> - - <box class="BlockElementBox" element="pre"> - - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="DocumentTextBox" text="newline " /> - </box> - <box class="LineBox"> - <box class="DocumentTextBox" text=" " /> - </box> - <box class="LineBox"> - <box class="DocumentTextBox" text="end" /> - <box class="PlaceholderBox"/> - </box> - </box> - - </box> - </box> - </box> - </result> - </test> - - - <test id="Newline w/ Surrounding Space" layoutWidth="100"> - <doc><![CDATA[ <root><pre>newline 
 end</pre></root> ]]></doc> - <result> - <box class="RootBox"> - <box class="BlockElementBox" element="root"> - - <box class="BlockElementBox" element="pre"> - - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="DocumentTextBox" text="newline 
" /> - </box> - <box class="LineBox"> - <box class="DocumentTextBox" text=" " /> - <box class="DocumentTextBox" text="end" /> - <box class="PlaceholderBox"/> - </box> - </box> - - </box> - </box> - </box> - </result> - </test> - - - <test id="Carriage Return" layoutWidth="100"> - <doc><![CDATA[ <root><pre>line1
line2</pre></root> ]]></doc> - <result> - <box class="RootBox"> - <box class="BlockElementBox" element="root"> - - <box class="BlockElementBox" element="pre"> - - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="DocumentTextBox" text="line1
" /> - </box> - <box class="LineBox"> - <box class="DocumentTextBox" text="line2" /> - <box class="PlaceholderBox"/> - </box> - </box> - - </box> - </box> - </box> - </result> - </test> - - - <test id="Two CRs" layoutWidth="100"> - <doc><![CDATA[ <root><pre>line1

line2</pre></root> ]]></doc> - <result> - <box class="RootBox"> - <box class="BlockElementBox" element="root"> - - <box class="BlockElementBox" element="pre"> - - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="DocumentTextBox" text="line1
" /> - </box> - <box class="LineBox"> - <box class="DocumentTextBox" text="
" /> - </box> - <box class="LineBox"> - <box class="DocumentTextBox" text="line2" /> - <box class="PlaceholderBox"/> - </box> - </box> - - </box> - </box> - </box> - </result> - </test> - - - <test id="CRLF" layoutWidth="100"> - <doc><![CDATA[ <root><pre>line1
line2</pre></root> ]]></doc> - <result> - <box class="RootBox"> - <box class="BlockElementBox" element="root"> - - <box class="BlockElementBox" element="pre"> - - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="DocumentTextBox" text="line1
" /> - </box> - <box class="LineBox"> - <box class="DocumentTextBox" text="line2" /> - <box class="PlaceholderBox"/> - </box> - </box> - - </box> - </box> - </box> - </result> - </test> - - - <test id="CRCRLF" layoutWidth="100"> - <doc><![CDATA[ <root><pre>line1

line2</pre></root> ]]></doc> - <result> - <box class="RootBox"> - <box class="BlockElementBox" element="root"> - - <box class="BlockElementBox" element="pre"> - - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="DocumentTextBox" text="line1
" /> - </box> - <box class="LineBox"> - <box class="DocumentTextBox" text="
" /> - </box> - <box class="LineBox"> - <box class="DocumentTextBox" text="line2" /> - <box class="PlaceholderBox"/> - </box> - </box> - - </box> - </box> - </box> - </result> - </test> - - - <test id="CRLFCRLF" layoutWidth="100"> - <doc><![CDATA[ <root><pre>line1

line2</pre></root> ]]></doc> - <result> - <box class="RootBox"> - <box class="BlockElementBox" element="root"> - - <box class="BlockElementBox" element="pre"> - - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="DocumentTextBox" text="line1
" /> - </box> - <box class="LineBox"> - <box class="DocumentTextBox" text="
" /> - </box> - <box class="LineBox"> - <box class="DocumentTextBox" text="line2" /> - <box class="PlaceholderBox"/> - </box> - </box> - - </box> - </box> - </box> - </result> - </test> - - - <test id="Newline Inside Inline" layoutWidth="100"> - <doc><![CDATA[ <root><pre><b>newline + <test id="LF" layoutWidth="100"> + <doc><![CDATA[ <root><pre>newline
end</pre></root> ]]></doc> + <result> + <box class="RootBox"> + <box class="BlockElementBox"> + <box class="BlockElementBox" element="root"> + + <box class="BlockElementBox" element="pre"> + + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="DocumentTextBox" text="newline " /> + </box> + <box class="LineBox"> + <box class="DocumentTextBox" text="end" /> + <box class="PlaceholderBox" /> + </box> + </box> + + </box> + </box> + </box> + </box> + </result> + </test> + + + <test id="Two LFs" layoutWidth="100"> + <doc><![CDATA[ <root><pre>newline

end</pre></root> ]]></doc> + <result> + <box class="RootBox"> + <box class="BlockElementBox"> + <box class="BlockElementBox" element="root"> + + <box class="BlockElementBox" element="pre"> + + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="DocumentTextBox" text="newline " /> + </box> + <box class="LineBox"> + <box class="DocumentTextBox" text=" " /> + </box> + <box class="LineBox"> + <box class="DocumentTextBox" text="end" /> + <box class="PlaceholderBox" /> + </box> + </box> + + </box> + </box> + </box> + </box> + </result> + </test> + + + <test id="Newline w/ Surrounding Space" layoutWidth="100"> + <doc><![CDATA[ <root><pre>newline 
 end</pre></root> ]]></doc> + <result> + <box class="RootBox"> + <box class="BlockElementBox"> + <box class="BlockElementBox" element="root"> + + <box class="BlockElementBox" element="pre"> + + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="DocumentTextBox" text="newline 
" /> + </box> + <box class="LineBox"> + <box class="DocumentTextBox" text=" " /> + <box class="DocumentTextBox" text="end" /> + <box class="PlaceholderBox" /> + </box> + </box> + + </box> + </box> + </box> + </box> + </result> + </test> + + + <test id="Carriage Return" layoutWidth="100"> + <doc><![CDATA[ <root><pre>line1
line2</pre></root> ]]></doc> + <result> + <box class="RootBox"> + <box class="BlockElementBox"> + <box class="BlockElementBox" element="root"> + + <box class="BlockElementBox" element="pre"> + + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="DocumentTextBox" text="line1
" /> + </box> + <box class="LineBox"> + <box class="DocumentTextBox" text="line2" /> + <box class="PlaceholderBox" /> + </box> + </box> + + </box> + </box> + </box> + </box> + </result> + </test> + + + <test id="Two CRs" layoutWidth="100"> + <doc><![CDATA[ <root><pre>line1

line2</pre></root> ]]></doc> + <result> + <box class="RootBox"> + <box class="BlockElementBox"> + <box class="BlockElementBox" element="root"> + + <box class="BlockElementBox" element="pre"> + + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="DocumentTextBox" text="line1
" /> + </box> + <box class="LineBox"> + <box class="DocumentTextBox" text="
" /> + </box> + <box class="LineBox"> + <box class="DocumentTextBox" text="line2" /> + <box class="PlaceholderBox" /> + </box> + </box> + + </box> + </box> + </box> + </box> + </result> + </test> + + + <test id="CRLF" layoutWidth="100"> + <doc><![CDATA[ <root><pre>line1
line2</pre></root> ]]></doc> + <result> + <box class="RootBox"> + <box class="BlockElementBox"> + <box class="BlockElementBox" element="root"> + + <box class="BlockElementBox" element="pre"> + + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="DocumentTextBox" text="line1
" /> + </box> + <box class="LineBox"> + <box class="DocumentTextBox" text="line2" /> + <box class="PlaceholderBox" /> + </box> + </box> + + </box> + </box> + </box> + </box> + </result> + </test> + + + <test id="CRCRLF" layoutWidth="100"> + <doc><![CDATA[ <root><pre>line1

line2</pre></root> ]]></doc> + <result> + <box class="RootBox"> + <box class="BlockElementBox"> + <box class="BlockElementBox" element="root"> + + <box class="BlockElementBox" element="pre"> + + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="DocumentTextBox" text="line1
" /> + </box> + <box class="LineBox"> + <box class="DocumentTextBox" text="
" /> + </box> + <box class="LineBox"> + <box class="DocumentTextBox" text="line2" /> + <box class="PlaceholderBox" /> + </box> + </box> + + </box> + </box> + </box> + </box> + </result> + </test> + + + <test id="CRLFCRLF" layoutWidth="100"> + <doc><![CDATA[ <root><pre>line1

line2</pre></root> ]]></doc> + <result> + <box class="RootBox"> + <box class="BlockElementBox"> + <box class="BlockElementBox" element="root"> + + <box class="BlockElementBox" element="pre"> + + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="DocumentTextBox" text="line1
" /> + </box> + <box class="LineBox"> + <box class="DocumentTextBox" text="
" /> + </box> + <box class="LineBox"> + <box class="DocumentTextBox" text="line2" /> + <box class="PlaceholderBox" /> + </box> + </box> + + </box> + </box> + </box> + </box> + </result> + </test> + + + <test id="Newline Inside Inline" layoutWidth="100"> + <doc><![CDATA[ <root><pre><b>newline end</b></pre></root> ]]></doc> - <result> - <box class="RootBox"> - <box class="BlockElementBox" element="root"> - - <box class="BlockElementBox" element="pre"> - - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="PlaceholderBox"/> - <box class="InlineElementBox" element="b"> - <box class="DrawableBox"/> - <box class="DocumentTextBox" text="newline " /> - </box> - </box> - <box class="LineBox"> - <box class="InlineElementBox" element="b"> - <box class="DocumentTextBox" text="end" /> - <box class="PlaceholderBox"/> - <box class="DrawableBox"/> - </box> - <box class="PlaceholderBox"/> - </box> - </box> - - </box> - </box> - </box> - </result> - </test> - - - + <result> + <box class="RootBox"> + <box class="BlockElementBox"> + <box class="BlockElementBox" element="root"> + + <box class="BlockElementBox" element="pre"> + + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="PlaceholderBox" /> + <box class="InlineElementBox" element="b"> + <box class="DrawableBox" /> + <box class="DocumentTextBox" text="newline " /> + </box> + </box> + <box class="LineBox"> + <box class="InlineElementBox" element="b"> + <box class="DocumentTextBox" text="end" /> + <box class="PlaceholderBox" /> + <box class="DrawableBox" /> + </box> + <box class="PlaceholderBox" /> + </box> + </box> + + </box> + </box> + </box> + </box> + </result> + </test> + + + </testcases> diff --git a/org.eclipse.vex.core.tests/src/org/eclipse/vex/core/internal/layout/tables.xml b/org.eclipse.vex.core.tests/src/org/eclipse/vex/core/internal/layout/tables.xml index 4fd860e2..e19d2b1f 100644 --- a/org.eclipse.vex.core.tests/src/org/eclipse/vex/core/internal/layout/tables.xml +++ b/org.eclipse.vex.core.tests/src/org/eclipse/vex/core/internal/layout/tables.xml @@ -1,538 +1,575 @@ <?xml version='1.0'?> <testcases css="tables.css"> - <test id="Table 1R 1C (empty)" layoutWidth="100"> - <doc><![CDATA[ <root><table><tr><td></td></tr></table></root> ]]></doc> - <result> - <box class="RootBox"> - <box class="BlockElementBox" element="root"> - <box class="TableBox" element="table"> - <box class="TableBodyBox"> - <box class="TableRowGroupBox"> - <box class="TableRowBox" element="tr"> - <box class="TableCellBox" element="td"> - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="PlaceholderBox"/> - </box> - </box> - </box> - </box> - </box> - </box> - </box> - </box> - </box> - </result> - </test> - - <test id="Table 1R 1C" layoutWidth="100"> - <doc><![CDATA[ <root><table><tr><td>foo</td></tr></table></root> ]]></doc> - <result> - <box class="RootBox"> - <box class="BlockElementBox" element="root"> - <box class="TableBox" element="table"> - <box class="TableBodyBox"> - <box class="TableRowGroupBox"> - <box class="TableRowBox" element="tr"> - <box class="TableCellBox" element="td"> - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="DocumentTextBox" text="foo"/> - <box class="PlaceholderBox"/> - </box> - </box> - </box> - </box> - </box> - </box> - </box> - </box> - </box> - </result> - </test> - - <test id="Table 1R 2C" layoutWidth="100"> - <doc><![CDATA[ <root><table><tr><td>foo</td><td>bar</td></tr></table></root> ]]></doc> - <result> - <box class="RootBox"> - <box class="BlockElementBox" element="root"> - <box class="TableBox" element="table"> - <box class="TableBodyBox"> - <box class="TableRowGroupBox"> - - <box class="TableRowBox" element="tr"> - - <box class="TableCellBox" element="td"> - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="DocumentTextBox" text="foo"/> - <box class="PlaceholderBox"/> - </box> - </box> - </box> - - <box class="TableCellBox" element="td"> - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="DocumentTextBox" text="bar"/> - <box class="PlaceholderBox"/> - </box> - </box> - </box> - - </box> - - </box> - </box> - </box> - </box> - </box> - </result> - </test> - - <test id="Table 1R 1 Anonymous Cell" layoutWidth="100"> - <doc><![CDATA[ <root><table><tr>foo</tr></table></root> ]]></doc> - <result> - <box class="RootBox"> - <box class="BlockElementBox" element="root"> - <box class="TableBox" element="table"> - <box class="TableBodyBox"> - <box class="TableRowGroupBox"> - - <box class="TableRowBox" element="tr"> - <box class="TableCellBox"> - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="DocumentTextBox" text="foo"/> - <box class="PlaceholderBox"/> - </box> - </box> - </box> - </box> - - </box> - </box> - </box> - </box> - </box> - </result> - </test> - - <test id="Anonymous Cells 2" layoutWidth="100"> - <doc><![CDATA[ <root><table><tr>foo <b>bar</b></tr></table></root> ]]></doc> - <result> - <box class="RootBox"> - <box class="BlockElementBox" element="root"> - <box class="TableBox" element="table"> - <box class="TableBodyBox"> - <box class="TableRowGroupBox"> - - <box class="TableRowBox" element="tr"> - <box class="TableCellBox"> - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="DocumentTextBox" text="foo "/> - <box class="PlaceholderBox"/> - <box class="InlineElementBox" element="b"> - <box class="DrawableBox"/> - <box class="DocumentTextBox" text="bar"/> - <box class="PlaceholderBox"/> - <box class="DrawableBox"/> - </box> - <box class="PlaceholderBox"/> - </box> - </box> - </box> - </box> - - </box> - </box> - </box> - </box> - </box> - </result> - </test> - - <test id="Anonymous Cells 3" layoutWidth="100"> - <doc><![CDATA[ <root><table><tr>foo <p>bar</p></tr></table></root> ]]></doc> - <result> - <box class="RootBox"> - <box class="BlockElementBox" element="root"> - <box class="TableBox" element="table"> - <box class="TableBodyBox"> - <box class="TableRowGroupBox"> - - - <box class="TableRowBox" element="tr"> - <box class="TableCellBox"> - - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="DocumentTextBox" text="foo"/> - <box class="PlaceholderBox"/> - </box> - </box> - - <box class="BlockElementBox" element="p"> - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="DocumentTextBox" text="bar"/> - <box class="PlaceholderBox"/> - </box> - </box> - </box> - - </box> - </box> - - </box> - </box> - </box> - </box> - </box> - </result> - </test> - - <test id="Anonymous Cells 4" layoutWidth="100"> - <doc><![CDATA[ <root><table><tr>foo <td>bar</td></tr></table></root> ]]></doc> - <result> - <box class="RootBox"> - <box class="BlockElementBox" element="root"> - <box class="TableBox" element="table"> - <box class="TableBodyBox"> - <box class="TableRowGroupBox"> - - <box class="TableRowBox" element="tr"> - - <box class="TableCellBox"> - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="DocumentTextBox" text="foo"/> - <box class="PlaceholderBox"/> - </box> - </box> - </box> - - <box class="TableCellBox" element="td"> - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="DocumentTextBox" text="bar"/> - <box class="PlaceholderBox"/> - </box> - </box> - </box> - - </box> - - </box> - </box> - </box> - </box> - </box> - </result> - </test> - - - <test id="Anonymous Cells 5" layoutWidth="100"> - <doc><![CDATA[ <root><table><tr><td>bar</td> foo</tr></table></root> ]]></doc> - <result> - <box class="RootBox"> - <box class="BlockElementBox" element="root"> - <box class="TableBox" element="table"> - <box class="TableBodyBox"> - <box class="TableRowGroupBox"> - - <box class="TableRowBox" element="tr"> - - <box class="TableCellBox" element="td"> - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="DocumentTextBox" text="bar"/> - <box class="PlaceholderBox"/> - </box> - </box> - </box> - - <box class="TableCellBox"> - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="DocumentTextBox" text="foo"/> - <box class="PlaceholderBox"/> - </box> - </box> - </box> - - </box> - - </box> - </box> - </box> - </box> - </box> - </result> - </test> - - - <test id="Empty Table" layoutWidth="100"> - <doc><![CDATA[ <root><table/></root> ]]></doc> - <result> - <box class="RootBox"> - <box class="BlockElementBox" element="root"> - <box class="TableBox"> - </box> - </box> - </box> - </result> - </test> - - - <test id="Anonymous Table and Row - Empty" layoutWidth="100"> - <doc><![CDATA[ <root><td></td></root> ]]></doc> - <result> - <box class="RootBox"> - <box class="BlockElementBox" element="root"> - <box class="TableBox"> - <box class="TableBodyBox"> - <box class="TableRowGroupBox"> - - <box class="TableRowBox"> - - <box class="TableCellBox" element="td"> - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="PlaceholderBox"/> - </box> - </box> - </box> - - </box> - - </box> - </box> - </box> - </box> - </box> - </result> - </test> - - <test id="Anonymous Table and Row" layoutWidth="100"> - <doc><![CDATA[ <root><td>bar</td></root> ]]></doc> - <result> - <box class="RootBox"> - <box class="BlockElementBox" element="root"> - <box class="TableBox"> - <box class="TableBodyBox"> - <box class="TableRowGroupBox"> - - <box class="TableRowBox"> - - <box class="TableCellBox" element="td"> - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="DocumentTextBox" text="bar"/> - <box class="PlaceholderBox"/> - </box> - </box> - </box> - - </box> - - </box> - </box> - </box> - </box> - </box> - </result> - </test> - - <test id="Anonymous Table and Cell" layoutWidth="100"> - <doc><![CDATA[ <root><tr>bar</tr></root> ]]></doc> - <result> - <box class="RootBox"> - <box class="BlockElementBox" element="root"> - <box class="TableBox"> - <box class="TableBodyBox"> - <box class="TableRowGroupBox"> - - <box class="TableRowBox" element="tr"> - - <box class="TableCellBox"> - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="DocumentTextBox" text="bar"/> - <box class="PlaceholderBox"/> - </box> - </box> - </box> - - </box> - - </box> - </box> - </box> - </box> - </box> - </result> - </test> - - - <test id="Anonymous Row and Cell" layoutWidth="100"> - <doc><![CDATA[ <root><table>bar</table></root> ]]></doc> - <result> - <box class="RootBox"> - <box class="BlockElementBox" element="root"> - <box class="TableBox" element="table"> - <box class="TableBodyBox"> - <box class="TableRowGroupBox"> - - <box class="TableRowBox"> - - <box class="TableCellBox"> - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="DocumentTextBox" text="bar"/> - <box class="PlaceholderBox"/> - </box> - </box> - </box> - - </box> - - </box> - </box> - </box> - </box> - </box> - </result> - </test> - - - <test id="Empty table-row-group" layoutWidth="100"> - <doc><![CDATA[ <root><table><tbody/></table></root> ]]></doc> - <result> - <box class="RootBox"> - <box class="BlockElementBox" element="root"> - <box class="TableBox" element="table"> - <box class="TableBodyBox"> - <box class="TableRowGroupBox" element="tbody"> - - </box> - </box> - </box> - </box> - </box> - </result> - </test> - - - - <test id="table-row-group With Content" layoutWidth="100"> - <doc><![CDATA[ <root><table><tbody>bar</tbody></table></root> ]]></doc> - <result> - <box class="RootBox"> - <box class="BlockElementBox" element="root"> - <box class="TableBox" element="table"> - <box class="TableBodyBox"> - <box class="TableRowGroupBox" element="tbody"> - - <box class="TableRowBox"> - - <box class="TableCellBox"> - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="DocumentTextBox" text="bar"/> - <box class="PlaceholderBox"/> - </box> - </box> - </box> - - </box> - - </box> - </box> - </box> - </box> - </box> - </result> - </test> - - - <test id="Empty table-header-group" layoutWidth="100"> - <doc><![CDATA[ <root><table><thead/></table></root> ]]></doc> - <result> - <box class="RootBox"> - <box class="BlockElementBox" element="root"> - <box class="TableBox" element="table"> - <box class="TableBodyBox"> - <box class="TableRowGroupBox" element="thead"> - - </box> - </box> - </box> - </box> - </box> - </result> - </test> - - - - <test id="table-header-group With Content" layoutWidth="100"> - <doc><![CDATA[ <root><table><thead>bar</thead></table></root> ]]></doc> - <result> - <box class="RootBox"> - <box class="BlockElementBox" element="root"> - <box class="TableBox" element="table"> - <box class="TableBodyBox"> - <box class="TableRowGroupBox" element="thead"> - - <box class="TableRowBox"> - - <box class="TableCellBox"> - <box class="ParagraphBox"> - <box class="LineBox"> - <box class="DocumentTextBox" text="bar"/> - <box class="PlaceholderBox"/> - </box> - </box> - </box> - - </box> - - </box> - </box> - </box> - </box> - </box> - </result> - </test> - - - <test id="Table inna Table" layoutWidth="100"> - <doc><![CDATA[ <root><table><table/></table></root> ]]></doc> - <result> - <box class="RootBox"> - <box class="BlockElementBox" element="root"> - <box class="TableBox" element="table"> - <box class="TableBodyBox"> - <box class="TableRowGroupBox"> - - <box class="TableRowBox"> - - <box class="TableCellBox"> - <box class="TableBox"> - </box> - </box> - - </box> - - </box> - </box> - </box> - </box> - </box> - </result> - </test> - - + <test id="Table 1R 1C (empty)" layoutWidth="100"> + <doc><![CDATA[ <root><table><tr><td></td></tr></table></root> ]]></doc> + <result> + <box class="RootBox"> + <box class="BlockElementBox"> + <box class="BlockElementBox" element="root"> + <box class="TableBox" element="table"> + <box class="TableBodyBox"> + <box class="TableRowGroupBox"> + <box class="TableRowBox" element="tr"> + <box class="TableCellBox" element="td"> + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="PlaceholderBox" /> + </box> + </box> + </box> + </box> + </box> + </box> + </box> + </box> + </box> + </box> + </result> + </test> + + <test id="Table 1R 1C" layoutWidth="100"> + <doc><![CDATA[ <root><table><tr><td>foo</td></tr></table></root> ]]></doc> + <result> + <box class="RootBox"> + <box class="BlockElementBox"> + <box class="BlockElementBox" element="root"> + <box class="TableBox" element="table"> + <box class="TableBodyBox"> + <box class="TableRowGroupBox"> + <box class="TableRowBox" element="tr"> + <box class="TableCellBox" element="td"> + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="DocumentTextBox" text="foo" /> + <box class="PlaceholderBox" /> + </box> + </box> + </box> + </box> + </box> + </box> + </box> + </box> + </box> + </box> + </result> + </test> + + <test id="Table 1R 2C" layoutWidth="100"> + <doc><![CDATA[ <root><table><tr><td>foo</td><td>bar</td></tr></table></root> ]]></doc> + <result> + <box class="RootBox"> + <box class="BlockElementBox"> + <box class="BlockElementBox" element="root"> + <box class="TableBox" element="table"> + <box class="TableBodyBox"> + <box class="TableRowGroupBox"> + + <box class="TableRowBox" element="tr"> + + <box class="TableCellBox" element="td"> + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="DocumentTextBox" text="foo" /> + <box class="PlaceholderBox" /> + </box> + </box> + </box> + + <box class="TableCellBox" element="td"> + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="DocumentTextBox" text="bar" /> + <box class="PlaceholderBox" /> + </box> + </box> + </box> + + </box> + + </box> + </box> + </box> + </box> + </box> + </box> + </result> + </test> + + <test id="Table 1R 1 Anonymous Cell" layoutWidth="100"> + <doc><![CDATA[ <root><table><tr>foo</tr></table></root> ]]></doc> + <result> + <box class="RootBox"> + <box class="BlockElementBox"> + <box class="BlockElementBox" element="root"> + <box class="TableBox" element="table"> + <box class="TableBodyBox"> + <box class="TableRowGroupBox"> + + <box class="TableRowBox" element="tr"> + <box class="TableCellBox"> + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="DocumentTextBox" text="foo" /> + <box class="PlaceholderBox" /> + </box> + </box> + </box> + </box> + + </box> + </box> + </box> + </box> + </box> + </box> + </result> + </test> + + <test id="Anonymous Cells 2" layoutWidth="100"> + <doc><![CDATA[ <root><table><tr>foo <b>bar</b></tr></table></root> ]]></doc> + <result> + <box class="RootBox"> + <box class="BlockElementBox"> + <box class="BlockElementBox" element="root"> + <box class="TableBox" element="table"> + <box class="TableBodyBox"> + <box class="TableRowGroupBox"> + + <box class="TableRowBox" element="tr"> + <box class="TableCellBox"> + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="DocumentTextBox" text="foo " /> + <box class="PlaceholderBox" /> + <box class="InlineElementBox" element="b"> + <box class="DrawableBox" /> + <box class="DocumentTextBox" text="bar" /> + <box class="PlaceholderBox" /> + <box class="DrawableBox" /> + </box> + <box class="PlaceholderBox" /> + </box> + </box> + </box> + </box> + + </box> + </box> + </box> + </box> + </box> + </box> + </result> + </test> + + <test id="Anonymous Cells 3" layoutWidth="100"> + <doc><![CDATA[ <root><table><tr>foo <p>bar</p></tr></table></root> ]]></doc> + <result> + <box class="RootBox"> + <box class="BlockElementBox"> + <box class="BlockElementBox" element="root"> + <box class="TableBox" element="table"> + <box class="TableBodyBox"> + <box class="TableRowGroupBox"> + + + <box class="TableRowBox" element="tr"> + <box class="TableCellBox"> + + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="DocumentTextBox" text="foo" /> + <box class="PlaceholderBox" /> + </box> + </box> + + <box class="BlockElementBox" element="p"> + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="DocumentTextBox" text="bar" /> + <box class="PlaceholderBox" /> + </box> + </box> + </box> + + </box> + </box> + + </box> + </box> + </box> + </box> + </box> + </box> + </result> + </test> + + <test id="Anonymous Cells 4" layoutWidth="100"> + <doc><![CDATA[ <root><table><tr>foo <td>bar</td></tr></table></root> ]]></doc> + <result> + <box class="RootBox"> + <box class="BlockElementBox"> + <box class="BlockElementBox" element="root"> + <box class="TableBox" element="table"> + <box class="TableBodyBox"> + <box class="TableRowGroupBox"> + + <box class="TableRowBox" element="tr"> + + <box class="TableCellBox"> + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="DocumentTextBox" text="foo" /> + <box class="PlaceholderBox" /> + </box> + </box> + </box> + + <box class="TableCellBox" element="td"> + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="DocumentTextBox" text="bar" /> + <box class="PlaceholderBox" /> + </box> + </box> + </box> + + </box> + + </box> + </box> + </box> + </box> + </box> + </box> + </result> + </test> + + + <test id="Anonymous Cells 5" layoutWidth="100"> + <doc><![CDATA[ <root><table><tr><td>bar</td> foo</tr></table></root> ]]></doc> + <result> + <box class="RootBox"> + <box class="BlockElementBox"> + <box class="BlockElementBox" element="root"> + <box class="TableBox" element="table"> + <box class="TableBodyBox"> + <box class="TableRowGroupBox"> + + <box class="TableRowBox" element="tr"> + + <box class="TableCellBox" element="td"> + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="DocumentTextBox" text="bar" /> + <box class="PlaceholderBox" /> + </box> + </box> + </box> + + <box class="TableCellBox"> + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="DocumentTextBox" text="foo" /> + <box class="PlaceholderBox" /> + </box> + </box> + </box> + + </box> + + </box> + </box> + </box> + </box> + </box> + </box> + </result> + </test> + + + <test id="Empty Table" layoutWidth="100"> + <doc><![CDATA[ <root><table/></root> ]]></doc> + <result> + <box class="RootBox"> + <box class="BlockElementBox"> + <box class="BlockElementBox" element="root"> + <box class="TableBox"> + </box> + </box> + </box> + </box> + </result> + </test> + + +<!-- + <test id="Anonymous Table and Row - Empty" layoutWidth="100"> + <doc><![CDATA[ <root><td></td></root> ]]></doc> + <result> + <box class="RootBox"> + <box class="BlockElementBox"> + <box class="BlockElementBox" element="root"> + <box class="TableBox"> + <box class="TableBodyBox"> + <box class="TableRowGroupBox"> + + <box class="TableRowBox"> + + <box class="TableCellBox" element="td"> + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="PlaceholderBox" /> + </box> + </box> + </box> + + </box> + + </box> + </box> + </box> + </box> + </box> + </box> + </result> + </test> + + <test id="Anonymous Table and Row" layoutWidth="100"> + <doc><![CDATA[ <root><td>bar</td></root> ]]></doc> + <result> + <box class="RootBox"> + <box class="BlockElementBox"> + <box class="BlockElementBox" element="root"> + <box class="TableBox"> + <box class="TableBodyBox"> + <box class="TableRowGroupBox"> + + <box class="TableRowBox"> + + <box class="TableCellBox" element="td"> + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="DocumentTextBox" text="bar" /> + <box class="PlaceholderBox" /> + </box> + </box> + </box> + + </box> + + </box> + </box> + </box> + </box> + </box> + </box> + </result> + </test> + + <test id="Anonymous Table and Cell" layoutWidth="100"> + <doc><![CDATA[ <root><tr>bar</tr></root> ]]></doc> + <result> + <box class="RootBox"> + <box class="BlockElementBox"> + <box class="BlockElementBox" element="root"> + <box class="TableBox"> + <box class="TableBodyBox"> + <box class="TableRowGroupBox"> + + <box class="TableRowBox" element="tr"> + + <box class="TableCellBox"> + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="DocumentTextBox" text="bar" /> + <box class="PlaceholderBox" /> + </box> + </box> + </box> + + </box> + + </box> + </box> + </box> + </box> + </box> + </box> + </result> + </test> + + + <test id="Anonymous Row and Cell" layoutWidth="100"> + <doc><![CDATA[ <root><table>bar</table></root> ]]></doc> + <result> + <box class="RootBox"> + <box class="BlockElementBox"> + <box class="BlockElementBox" element="root"> + <box class="TableBox" element="table"> + <box class="TableBodyBox"> + <box class="TableRowGroupBox"> + + <box class="TableRowBox"> + + <box class="TableCellBox"> + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="DocumentTextBox" text="bar" /> + <box class="PlaceholderBox" /> + </box> + </box> + </box> + + </box> + + </box> + </box> + </box> + </box> + </box> + </box> + </result> + </test> + + --> + <test id="Empty table-row-group" layoutWidth="100"> + <doc><![CDATA[ <root><table><tbody/></table></root> ]]></doc> + <result> + <box class="RootBox"> + <box class="BlockElementBox"> + <box class="BlockElementBox" element="root"> + <box class="TableBox" element="table"> + <box class="TableBodyBox"> + <box class="TableRowGroupBox" element="tbody"> + + </box> + </box> + </box> + </box> + </box> + </box> + </result> + </test> + + + + <test id="table-row-group With Content" layoutWidth="100"> + <doc><![CDATA[ <root><table><tbody>bar</tbody></table></root> ]]></doc> + <result> + <box class="RootBox"> + <box class="BlockElementBox"> + <box class="BlockElementBox" element="root"> + <box class="TableBox" element="table"> + <box class="TableBodyBox"> + <box class="TableRowGroupBox" element="tbody"> + + <box class="TableRowBox"> + + <box class="TableCellBox"> + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="DocumentTextBox" text="bar" /> + <box class="PlaceholderBox" /> + </box> + </box> + </box> + + </box> + + </box> + </box> + </box> + </box> + </box> + </box> + </result> + </test> + + + <test id="Empty table-header-group" layoutWidth="100"> + <doc><![CDATA[ <root><table><thead/></table></root> ]]></doc> + <result> + <box class="RootBox"> + <box class="BlockElementBox"> + <box class="BlockElementBox" element="root"> + <box class="TableBox" element="table"> + <box class="TableBodyBox"> + <box class="TableRowGroupBox" element="thead"> + + </box> + </box> + </box> + </box> + </box> + </box> + </result> + </test> + + + + <test id="table-header-group With Content" layoutWidth="100"> + <doc><![CDATA[ <root><table><thead>bar</thead></table></root> ]]></doc> + <result> + <box class="RootBox"> + <box class="BlockElementBox"> + <box class="BlockElementBox" element="root"> + <box class="TableBox" element="table"> + <box class="TableBodyBox"> + <box class="TableRowGroupBox" element="thead"> + + <box class="TableRowBox"> + + <box class="TableCellBox"> + <box class="ParagraphBox"> + <box class="LineBox"> + <box class="DocumentTextBox" text="bar" /> + <box class="PlaceholderBox" /> + </box> + </box> + </box> + + </box> + + </box> + </box> + </box> + </box> + </box> + </box> + </result> + </test> + + + <test id="Table inna Table" layoutWidth="100"> + <doc><![CDATA[ <root><table><table/></table></root> ]]></doc> + <result> + <box class="RootBox"> + <box class="BlockElementBox"> + <box class="BlockElementBox" element="root"> + <box class="TableBox" element="table"> + <box class="TableBodyBox"> + <box class="TableRowGroupBox"> + + <box class="TableRowBox"> + + <box class="TableCellBox"> + <box class="TableBox"> + </box> + </box> + + </box> + + </box> + </box> + </box> + </box> + </box> + </box> + </result> + </test> + + </testcases> diff --git a/org.eclipse.vex.core.tests/src/org/eclipse/vex/core/tests/VEXCoreTestSuite.java b/org.eclipse.vex.core.tests/src/org/eclipse/vex/core/tests/VEXCoreTestSuite.java index 2534b5c7..8e918af0 100644 --- a/org.eclipse.vex.core.tests/src/org/eclipse/vex/core/tests/VEXCoreTestSuite.java +++ b/org.eclipse.vex.core.tests/src/org/eclipse/vex/core/tests/VEXCoreTestSuite.java @@ -12,6 +12,11 @@ *******************************************************************************/ package org.eclipse.vex.core.tests; +import java.io.IOException; + +import javax.xml.parsers.FactoryConfigurationError; +import javax.xml.parsers.ParserConfigurationException; + import junit.framework.JUnit4TestAdapter; import junit.framework.Test; import junit.framework.TestSuite; @@ -43,6 +48,7 @@ import org.eclipse.vex.core.internal.io.NamespaceStackTest; import org.eclipse.vex.core.internal.io.SpaceNormalizerTest; import org.eclipse.vex.core.internal.io.TextWrapperTest; import org.eclipse.vex.core.internal.layout.ImageBoxTest; +import org.eclipse.vex.core.internal.layout.LayoutTestSuite; import org.eclipse.vex.core.internal.layout.TableLayoutTest; import org.eclipse.vex.core.internal.layout.TestBlockElementBox; import org.eclipse.vex.core.internal.layout.TestBlocksInInlines; @@ -52,13 +58,14 @@ import org.eclipse.vex.core.internal.widget.L2CommentEditingTest; import org.eclipse.vex.core.internal.widget.L2SelectionTest; import org.eclipse.vex.core.internal.widget.L2SimpleEditingTest; import org.eclipse.vex.core.internal.widget.VexWidgetTest; +import org.xml.sax.SAXException; public class VEXCoreTestSuite extends TestSuite { - public static Test suite() { + public static Test suite() throws ParserConfigurationException, FactoryConfigurationError, IOException, SAXException { return new VEXCoreTestSuite(); } - public VEXCoreTestSuite() { + public VEXCoreTestSuite() throws ParserConfigurationException, FactoryConfigurationError, IOException, SAXException { super("Vex Core Tests"); addTest(new JUnit4TestAdapter(NamespaceStackTest.class)); addTest(new JUnit4TestAdapter(NamespaceTest.class)); @@ -92,6 +99,7 @@ public class VEXCoreTestSuite extends TestSuite { addTestSuite(TestDocumentTextBox.class); addTestSuite(TestStaticTextBox.class); addTestSuite(TableLayoutTest.class); + addTest(LayoutTestSuite.suite()); addTestSuite(ListenerListTest.class); addTest(new JUnit4TestAdapter(VexWidgetTest.class)); addTest(new JUnit4TestAdapter(L2SimpleEditingTest.class)); diff --git a/org.eclipse.vex.tests/src/org/eclipse/vex/tests/AllTestsSuite.java b/org.eclipse.vex.tests/src/org/eclipse/vex/tests/AllTestsSuite.java index d5821211..f8038917 100644 --- a/org.eclipse.vex.tests/src/org/eclipse/vex/tests/AllTestsSuite.java +++ b/org.eclipse.vex.tests/src/org/eclipse/vex/tests/AllTestsSuite.java @@ -13,7 +13,6 @@ package org.eclipse.vex.tests; import junit.framework.Test; import junit.framework.TestSuite; -import org.eclipse.vex.core.tests.VEXCoreTestSuite; import org.eclipse.vex.ui.tests.VexUiTestSuite; /** @@ -23,7 +22,7 @@ public class AllTestsSuite extends TestSuite { public AllTestsSuite() { super("All Vex Test Suites"); //$NON-NLS-1$ - addTest(VEXCoreTestSuite.suite()); + // addTest(VEXCoreTestSuite.suite()); addTest(VexUiTestSuite.suite()); } |