}
public void testSerializableScanners()
throws IOException, ClassNotFoundException, ParserException
{
Parser parser;
Vector vector;
NodeIterator enumeration;
byte[] data;
parser =
new Parser("http://htmlparser.sourceforge.net/test/example.html");
parser.registerScanners();
enumeration = parser.elements();
vector = new Vector(50);
while (enumeration.hasMoreNodes())
vector.addElement(enumeration.nextNode());
data = pickle(parser);
parser = (Parser) unpickle(data);
enumeration = parser.elements();
while (enumeration.hasMoreNodes())
assertEquals(
"Nodes before and after serialization differ",
((Node) vector.remove(0)).toHtml(),
((Node) enumeration.nextNode()).toHtml());