From vincent@massol.net Wed Jan 7 11:17:01 2009 From: Vincent Massol To: xwiki-devs@xwiki.org Subject: Re: [xwiki-devs] [xwiki-notifications] r15121 - =?utf-8?q?sandbox/x?= =?utf-8?q?wiki-officeimporter/src/test/java/org/xwiki/officeimporter/intern?= =?utf-8?q?al/cleaner?= Date: Wed, 07 Jan 2009 11:26:35 +0100 Message-ID: <34199209-747C-41A1-962D-5E500E96FA8F@massol.net> In-Reply-To: <20090107072513.77C5591C009@vsvn.xpertnet.biz> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3967833200905957965==" --===============3967833200905957965== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Asiri, you need to use JIRA issue references in your commits. You already have one open for the officeimporter work so why don't you use it? Thanks -Vincent On Jan 7, 2009, at 8:25 AM, asiri (SVN) wrote: > Author: asiri > Date: 2009-01-07 08:25:13 +0100 (Wed, 07 Jan 2009) > New Revision: 15121 > > Modified: > sandbox/xwiki-officeimporter/src/test/java/org/xwiki/ > officeimporter/internal/cleaner/OpenOfficeHTMLCleanerTest.java > Log: > * Added one more test case. > > Modified: sandbox/xwiki-officeimporter/src/test/java/org/xwiki/ > officeimporter/internal/cleaner/OpenOfficeHTMLCleanerTest.java > =================================================================== > --- sandbox/xwiki-officeimporter/src/test/java/org/xwiki/ > officeimporter/internal/cleaner/OpenOfficeHTMLCleanerTest.java > 2009-01-07 07:07:10 UTC (rev 15120) > +++ sandbox/xwiki-officeimporter/src/test/java/org/xwiki/ > officeimporter/internal/cleaner/OpenOfficeHTMLCleanerTest.java > 2009-01-07 07:25:13 UTC (rev 15121) > @@ -227,4 +227,32 @@ > assertEquals(Node.COMMENT_NODE, stopComment.getNodeType()); > assertTrue(stopComment.getNodeValue().equals("stopimage")); > } > + > + /** > + * Test handling of image links. > + */ > + public void testImageLinks() { > + String html = header + " \">" + footer; > + Document doc = cleaner.clean(new > StringReader(html),Collections.singletonMap("targetDocument", > "Import.Test")); > + NodeList nodes = doc.getElementsByTagName("img"); > + assertEquals(1, nodes.getLength()); > + Element image = (Element)nodes.item(0); > + Node startImageComment = image.getPreviousSibling(); > + Node stopImageComment = image.getNextSibling(); > + assertEquals(Node.COMMENT_NODE, > startImageComment.getNodeType()); > + > assertTrue > (startImageComment.getNodeValue().equals("startimage:foo.png")); > + assertEquals("/bridge/foo.png", image.getAttribute("src")); > + assertEquals(Node.COMMENT_NODE, > stopImageComment.getNodeType()); > + > assertTrue(stopImageComment.getNodeValue().equals("stopimage")); > + Element link = (Element) image.getParentNode(); > + assertEquals("a", link.getNodeName()); > + assertEquals("http://www.xwiki.org", > link.getAttribute("href")); > + Element span = (Element) link.getParentNode(); > + assertEquals("span", span.getNodeName()); > + assertEquals("wikiexternallink", span.getAttribute("class")); > + Node startLinkComment = span.getPreviousSibling(); > + > assertTrue > (startLinkComment.getNodeValue().startsWith("startwikilink")); > + Node stopLinkComment = span.getNextSibling(); > + > assertTrue(stopLinkComment.getNodeValue().startsWith("stopwikilink")); > + } > } --===============3967833200905957965==--