* Test method for 'org.apache.lucene.gdata.server.GDataResponse.sendResponse(BaseEntry, ExtensionProfile)'
*/
public void testSendResponseBaseEntryExtensionProfile() throws IOException {
try{
Entry e = null;
this.response.sendResponse(e, new ProvidedServiceStub());
fail("Exception expected");
}catch (IllegalArgumentException e) {
//
}
try{
Entry e = createEntry();
this.response.sendResponse(e,null);
fail("Exception expected");
}catch (IllegalArgumentException e) {
//
}
// // test Atom output
StringWriter stringWriter = new StringWriter();
PrintWriter writer = new PrintWriter(stringWriter);
this.control.expectAndReturn(this.httpResponse.getWriter(),writer);
this.httpResponse.setContentType(GDataResponse.XMLMIME_ATOM);
this.response.setOutputFormat(OutputFormat.ATOM);
this.control.replay();
this.response.sendResponse(createEntry(), new ProvidedServiceStub());
assertEquals("Simple XML representation ATOM",stringWriter.toString(),generatedEntryAtom);
// test rss output
this.control.reset();
stringWriter = new StringWriter();
writer = new PrintWriter(stringWriter);
this.control.expectAndReturn(this.httpResponse.getWriter(),writer);
this.httpResponse.setContentType(GDataResponse.XMLMIME_RSS);
this.response.setOutputFormat(OutputFormat.RSS);
this.control.replay();
this.response.sendResponse(createEntry(), new ProvidedServiceStub());
assertEquals("Simple XML representation RSS",stringWriter.toString(),generatedEntryRSS);