@throws Exception if something goes wrong
()
| 52 | * @throws Exception if something goes wrong |
| 53 | */ |
| 54 | @Test |
| 55 | public void asXml() throws Exception { |
| 56 | final String html = DOCTYPE_HTML |
| 57 | + "<html><head><title>foo</title></head>\n" |
| 58 | + "<body><div>Hello <b>HtmlUnit</b></div></body></html>"; |
| 59 | |
| 60 | try (WebClient webClient = new WebClient(getBrowserVersion(), false, null, -1)) { |
| 61 | final HtmlPage page = loadPage(webClient, html, null, URL_FIRST); |
| 62 | assertEquals("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\r\n<html>\r\n" |
| 63 | + " <head>\r\n" |
| 64 | + " <title>foo</title>\r\n" |
| 65 | + " </head>\r\n" |
| 66 | + " <body>\r\n" |
| 67 | + " <div>Hello <b>HtmlUnit</b>\r\n" |
| 68 | + " </div>\r\n" |
| 69 | + " </body>\r\n" |
| 70 | + "</html>", |
| 71 | page.asXml()); |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | /** |
| 76 | * @throws Exception if something goes wrong |
no test coverage detected