示例#1
0
 @Test
 public void test3() throws Exception {
   Iframe iframe = TagCreator.iframe();
   String iframeStr = m2e.saveToString(iframe);
   // log.info(iframeStr);
   assertThat(iframeStr.matches("<iframe>.*</iframe>"), is(true));
   // assertThat(m2e.saveToString(iframe).matches("<iframe/>"), is(true));
 }
示例#2
0
 @Test
 public void test4() throws Exception {
   Iframe iframe = TagCreator.iframe();
   iframe.setId("foo");
   String iframeStr = m2e.saveToString(iframe);
   assertThat(iframeStr.matches("<iframe id=\"foo\">.*</iframe>"), is(true));
   // assertThat(m2e.saveToString(iframe).matches("<iframe/>"), is(true));
 }
示例#3
0
 @Test
 public void test() throws Exception {
   StringBuilder sb = new StringBuilder();
   sb.append("<html xmlns=\"http://www.w3.org/1999/xhtml\">");
   sb.append("<head>");
   sb.append("<title>test</title>");
   sb.append("</head>");
   sb.append("<body>");
   sb.append("<iframe>");
   sb.append("</iframe>");
   sb.append("</body>");
   sb.append("</html>");
   String str = sb.toString();
   Html html = m2e.loadHtmlTemplate(str);
   String result = m2e.saveToString(html);
   // log.info(result);
   assertThat(result.contains("<iframe>"), is(true));
   assertThat(result.contains("</iframe>"), is(true));
 }