Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/visitorsTests
In directory sc8-pr-cvs1:/tmp/cvs-serv11047/tests/visitorsTests
Modified Files:
UrlModifyingVisitorTest.java
Log Message:
Fixed up the broken visitor logic.
Added some docos on NodeVisitor.
Index: UrlModifyingVisitorTest.java
===================================================================
RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/visitorsTests/UrlModifyingVisitorTest.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** UrlModifyingVisitorTest.java 22 Sep 2003 02:40:15 -0000 1.9
--- UrlModifyingVisitorTest.java 28 Sep 2003 19:30:04 -0000 1.10
***************
*** 37,48 ****
"<HTML><BODY>" +
"<A HREF=\"mylink.html\"><IMG SRC=\"mypic.jpg\">" +
! "</A><IMG SRC=\"mysecondimage.gif\">" +
"</BODY></HTML>";
private static final String MODIFIED_HTML =
"<HTML><BODY>" +
! "<A HREF=\"localhost://mylink.html\">" +
! "<IMG SRC=\"localhost://mypic.jpg\"></A>" +
! "<IMG SRC=\"localhost://mysecondimage.gif\">" +
"</BODY></HTML>";
--- 37,49 ----
"<HTML><BODY>" +
"<A HREF=\"mylink.html\"><IMG SRC=\"mypic.jpg\">" +
! "</A><IMG SRC=\"my second image.gif\">" +
"</BODY></HTML>";
+ // Note: links are only quoted if needed
private static final String MODIFIED_HTML =
"<HTML><BODY>" +
! "<A HREF=localhost://mylink.html>" +
! "<IMG SRC=localhost://mypic.jpg></A>" +
! "<IMG SRC=\"localhost://my second image.gif\">" +
"</BODY></HTML>";
***************
*** 56,62 ****
new UrlModifyingVisitor(parser, "localhost://");
parser.visitAllNodesWith(visitor);
assertStringEquals("Expected HTML",
MODIFIED_HTML,
! visitor.getModifiedResult());
}
}
--- 57,64 ----
new UrlModifyingVisitor(parser, "localhost://");
parser.visitAllNodesWith(visitor);
+ String result = visitor.getModifiedResult();
assertStringEquals("Expected HTML",
MODIFIED_HTML,
! result);
}
}
|