attributes.setName("URL");
protocol.doMeta(buffer, attributes);
// Check the meta tag and attributes
Element nullElement = buffer.popElement();
Element element = (Element) nullElement.getHead();
// We need to get the content string from the buffer as it
// isn't encoded in the element.
String result = bufferToString(buffer);
int start = result.indexOf("content");
int end = result.indexOf("ing\"", start);
assertEquals("content=\"Test & encoding\"", result.substring(start, end + 4));
// For WML, there may be more than one meta generated, hence this loop.
do {
assertEquals("meta", element.getName());
if(element.getAttributeValue("http-equiv") != null) {
assertEquals("refresh", element.getAttributeValue("http-equiv"));
}
if(element.getAttributeValue("name") != null) {
assertEquals("URL", element.getAttributeValue("name"));
}
} while((element = (Element) element.getNext()) != null);
}