Kaydet (Commit) e07492e1 authored tarafından jmzambon's avatar jmzambon Kaydeden (comit) Miklos Vajna

tdf#97362: TextPortionEnumerationTest partially migrated to python…

tdf#97362: TextPortionEnumerationTest partially migrated to python (test_portion_enumeration_test.py)

Add footnote tests:
- test_refmark_point
- test_refmark
- test_toxmark_point
- test_toxmark
- test_hyperlink
- test_hyperlink_empty
- test_ruby
- test_ruby_empty

Change-Id: I0920517b5e8806a5fc46708822fed33006f03fd5
Reviewed-on: https://gerrit.libreoffice.org/38418Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
üst 7f6a1775
......@@ -26,6 +26,7 @@ $(eval $(call gb_PythonTest_add_modules,sw_python,$(SRCDIR)/sw/qa/python,\
check_table \
get_expression \
set_expression \
text_portion_enumeration_test \
var_fields \
))
......
......@@ -1258,211 +1258,6 @@ public class TextPortionEnumerationTest
util.DesktopTools.closeDoc(m_xDoc);
}
@Test public void testText() throws Exception
{
TreeNode root = new TreeNode();
TreeNode text = new TextNode("abc");
root.appendChild(text);
doTest(root);
}
@Test public void testTextField() throws Exception
{
mkName("ruby");
TreeNode root = new TreeNode();
TreeNode txtf = new TextFieldNode("abc");
root.appendChild(txtf);
doTest(root);
}
/*@Test*/ public void testControlChar() throws Exception
{
//FIXME this is converted to a text portion: ControlCharacter is obsolete
TreeNode root = new TreeNode();
TreeNode cchr = new ControlCharacterNode(HARD_HYPHEN);
root.appendChild(cchr);
doTest(root);
}
/*@Test*/ public void testSoftPageBreak() throws Exception
{
//FIXME: insert a soft page break: not done
TreeNode root = new TreeNode();
TreeNode spbk = new SoftPageBreakNode();
TreeNode text = new TextNode("abc");
root.appendChild(spbk);
root.appendChild(text);
doTest(root);
}
@Test public void testFootnote() throws Exception
{
String name = mkName("ftn");
TreeNode root = new TreeNode();
TreeNode ftnd = new FootnoteNode(name);
root.appendChild(ftnd);
doTest(root);
}
@Test public void testFrameAs() throws Exception
{
String name = mkName("frame");
TreeNode root = new TreeNode();
TreeNode fram = new FrameNode(name, AS_CHARACTER);
root.appendChild(fram);
doTest(root);
}
@Test public void testFrameAt() throws Exception
{
String name = mkName("frame");
TreeNode root = new TreeNode();
TreeNode fram = new FrameNode(name, AT_CHARACTER);
root.appendChild(fram);
doTest(root);
}
@Test public void testBookmarkPoint() throws Exception
{
String name = mkName("mark");
TreeNode root = new TreeNode();
TreeNode bkmk = new BookmarkNode(name);
TreeNode text = new TextNode("abc");
root.appendChild(bkmk);
root.appendChild(text);
doTest(root);
}
@Test public void testBookmark() throws Exception
{
String name = mkName("mark");
TreeNode root = new TreeNode();
TreeNode bkm1 = new BookmarkStartNode(name);
TreeNode text = new TextNode("abc");
TreeNode bkm2 = new BookmarkEndNode(name);
root.appendChild(bkm1);
root.appendChild(text);
root.appendChild(bkm2);
doTest(root);
}
@Test public void testBookmarkPointXmlId() throws Exception
{
String name = mkName("mark");
StringPair id = mkId("id");
TreeNode root = new TreeNode();
TreeNode bkmk = new BookmarkNode(name, id);
TreeNode text = new TextNode("abc");
root.appendChild(bkmk);
root.appendChild(text);
doTest(root);
}
@Test public void testBookmarkXmlId() throws Exception
{
String name = mkName("mark");
StringPair id = mkId("id");
TreeNode root = new TreeNode();
TreeNode bkm1 = new BookmarkStartNode(name, id);
TreeNode text = new TextNode("abc");
TreeNode bkm2 = new BookmarkEndNode(name, id);
root.appendChild(bkm1);
root.appendChild(text);
root.appendChild(bkm2);
doTest(root);
}
@Test public void testRefmarkPoint() throws Exception
{
String name = mkName("refmark");
TreeNode root = new TreeNode();
TreeNode rfmk = new ReferenceMarkNode(name);
TreeNode text = new TextNode("abc");
root.appendChild(rfmk);
root.appendChild(text);
doTest(root);
}
@Test public void testRefmark() throws Exception
{
String name = mkName("refmark");
TreeNode root = new TreeNode();
TreeNode rfm1 = new ReferenceMarkStartNode(name);
TreeNode text = new TextNode("abc");
TreeNode rfm2 = new ReferenceMarkEndNode(name);
root.appendChild(rfm1);
root.appendChild(text);
root.appendChild(rfm2);
doTest(root);
}
@Test public void testToxmarkPoint() throws Exception
{
String name = mkName("toxmark");
TreeNode root = new TreeNode();
TreeNode txmk = new DocumentIndexMarkNode(name);
TreeNode text = new TextNode("abc");
root.appendChild(txmk);
root.appendChild(text);
doTest(root);
}
@Test public void testToxmark() throws Exception
{
String name = mkName("toxmark");
TreeNode root = new TreeNode();
TreeNode txm1 = new DocumentIndexMarkStartNode(name);
TreeNode text = new TextNode("abc");
TreeNode txm2 = new DocumentIndexMarkEndNode(name);
root.appendChild(txm1);
root.appendChild(text);
root.appendChild(txm2);
doTest(root);
}
@Test public void testHyperlink() throws Exception
{
String name = mkName("url");
TreeNode root = new TreeNode();
TreeNode href = new HyperlinkNode(name);
TreeNode text = new TextNode("abc");
href.appendChild(text);
root.appendChild(href);
doTest(root);
}
@Test public void testHyperlinkEmpty() throws Exception
{
String name = mkName("url");
TreeNode root = new TreeNode();
TreeNode href = new HyperlinkNode(name);
TreeNode text = new TextNode("");
href.appendChild(text);
root.appendChild(href);
doTest(root);
}
@Test public void testRuby() throws Exception
{
String name = mkName("ruby");
TreeNode root = new TreeNode();
TreeNode ruby = new RubyNode(name);
TreeNode text = new TextNode("abc");
ruby.appendChild(text);
root.appendChild(ruby);
doTest(root);
}
@Test public void testRubyEmpty() throws Exception
{
// BUG: #i91534#
String name = mkName("ruby");
TreeNode root = new TreeNode();
TreeNode ruby = new RubyNode(name);
root.appendChild(ruby);
doTest(root);
}
@Test public void testMeta() throws Exception
{
StringPair id = new StringPair("content.xml", mkName("id"));
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment