@throws Exception if an error occurs
()
| 95 | * @throws Exception if an error occurs |
| 96 | */ |
| 97 | @Test |
| 98 | public void xpath2() throws Exception { |
| 99 | final String html = |
| 100 | "<html xmlns='http://www.w3.org/1999/xhtml' xmlns:xhtml='http://www.w3.org/1999/xhtml'>\n" |
| 101 | + "<body><xhtml:div>foo</xhtml:div></body></html>"; |
| 102 | |
| 103 | final MockWebConnection conn = new MockWebConnection(); |
| 104 | conn.setDefaultResponse(html, 200, "OK", "application/xhtml+xml"); |
| 105 | |
| 106 | final WebClient client = getWebClient(); |
| 107 | client.setWebConnection(conn); |
| 108 | final XHtmlPage page = client.getPage(URL_FIRST); |
| 109 | |
| 110 | assertEquals(1, page.getByXPath("//:body").size()); |
| 111 | assertEquals(0, page.getByXPath("//:BODY").size()); |
| 112 | assertEquals(0, page.getByXPath("//:bOdY").size()); |
| 113 | |
| 114 | assertEquals(1, page.getByXPath("//xhtml:body").size()); |
| 115 | assertEquals(0, page.getByXPath("//xhtml:BODY").size()); |
| 116 | assertEquals(0, page.getByXPath("//xhtml:bOdY").size()); |
| 117 | |
| 118 | assertEquals(1, page.getByXPath("//xhtml:div").size()); |
| 119 | assertEquals(0, page.getByXPath("//xhtml:DIV").size()); |
| 120 | assertEquals(0, page.getByXPath("//xhtml:dIv").size()); |
| 121 | } |
| 122 | |
| 123 | /** |
| 124 | * @throws Exception if an error occurs |
nothing calls this directly
no test coverage detected