Here is my code:
/**
* Creates request for testProcessRequest().
*/
public void beginTestProcessRequest(WebRequest request) throws IOException
{
Document document = DocumentHelper.createDocument();
Element xmlRoot = document.addElement("request");
Element subscribedTheme = xmlRoot.addElement("subscribedTheme");
subscribedTheme.addText("1");
PipedOutputStream out = new PipedOutputStream();
PipedInputStream in = new PipedInputStream(out);
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(out));
OutputFormat format = OutputFormat.createPrettyPrint();
XMLWriter xmlWriter = new XMLWriter(writer, format);
try
{
xmlWriter.write(document);
}
finally
{
xmlWriter.close();
}
out.close();
request.setUserData(in);
request.setContentType("application/xml");
Assert.assertEquals("application/xml", request.getContentType());
}
/**
* Test of processRequest method, of class com.be.desktopbeautifier.servlet.GetNextImages.
*/
public void testProcessRequest() throws ServletException, IOException
{
System.out.println("testProcessRequest");
Assert.assertEquals("application/xml", request.getContentType());
GetNextImages instance = new GetNextImages();
instance.init(config);
Session session = instance.openSession();
instance.processRequest(request, response, session);
instance.destroy();
}It dies with on Assert.assertEquals("application/xml", request.getContentType()) inside of testProcessRequest() but not inside beginTestProcessRequest(). I don't understand how it could possibly say the headers were set properly in the beginXXX() method but then change its mind in the testXXX() method. Ideas?
Gili
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
