public void testImgSerialization() { convertBackAndForth("<img src=\"http://www.example.com/image.png\"></img>"); convertBackAndForth( "<img src=\"http://www.example.com/image.png\" width=\"100\" height=\"20\"></img>"); Element element = createApiElementFromXml("<img src=\"http://www.example.com/image.png\"></img>"); assertTrue(element instanceof Image); assertEquals("http://www.example.com/image.png", ((Image) element).getUrl()); }
public void testImgSerialization() { convertBackAndForth("<img src=\"http://www.example.com/image.png\"></img>"); convertBackAndForth( "<img src=\"http://www.example.com/image.png\" width=\"100\" height=\"20\"></img>"); Element element = createApiElementFromXml("<img src=\"http://www.example.com/image.png\"></img>"); assertTrue(element instanceof Image); assertEquals("http://www.example.com/image.png", ((Image) element).getUrl()); }
public void testAttachmentSerialization() { convertBackAndForth("<image attachment=\"id\"></image>"); convertBackAndForth("<image attachment=\"id\"><caption>caption</caption></image>"); Element element = createApiElementFromXml( "<image attachment=\"id\"><gadge>something</gadge>" + "<caption>caption</caption><fake>fake</fake></image>", createWavelet("id")); assertTrue(element instanceof Attachment); assertEquals("caption", ((Attachment) element).getCaption()); assertEquals("id", ((Attachment) element).getAttachmentId()); assertEquals(ATTACHMENT_MIMETYPE, ((Attachment) element).getMimeType()); assertEquals(ATTACHMENT_URL, ((Attachment) element).getAttachmentUrl()); }
public void testAttachmentSerialization() { convertBackAndForth("<image attachment=\"id\"></image>"); convertBackAndForth("<image attachment=\"id\"><caption>caption</caption></image>"); Element element = createApiElementFromXml( "<image attachment=\"id\"><gadge>something</gadge>" + "<caption>caption</caption><fake>fake</fake></image>", createWavelet("id")); assertTrue(element instanceof Attachment); assertEquals("caption", ((Attachment) element).getCaption()); assertEquals("id", ((Attachment) element).getAttachmentId()); assertEquals(ATTACHMENT_MIMETYPE, ((Attachment) element).getMimeType()); assertEquals(ATTACHMENT_URL, ((Attachment) element).getAttachmentUrl()); }