Program: 177201
Project: 177201
Buggy source:
/** 
 * tests the handleRESTOperation method.
 */
public void testHandleRESTOperation() throws Exception {
  RESTResource resource=new RESTResource("String_Node_Str");
  resource.addOperation(VerbType.update,new MockRESTEndpoint(),MockRESTEndpoint.class.getMethod("String_Node_Str",String.class,RootElementExample.class,Integer.TYPE,String[].class));
  RESTResourceXMLExporter controller=new RESTResourceXMLExporter("String_Node_Str","String_Node_Str",resource);
  HttpServletRequest request=createMock(HttpServletRequest.class);
  HttpServletResponse response=createMock(HttpServletResponse.class);
  response.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED,"String_Node_Str" + VerbType.create);
  replay(request,response);
  controller.handleRESTOperation("String_Node_Str",VerbType.create,request,response);
  verify(request,response);
  reset(request,response);
  JAXBContext context=JAXBContext.newInstance(RootElementExample.class);
  ByteArrayOutputStream bytes=new ByteArrayOutputStream();
  context.createMarshaller().marshal(new RootElementExample(),bytes);
  expect(request.getParameterValues("String_Node_Str")).andReturn(new String[]{"String_Node_Str"});
  expect(request.getParameterValues("String_Node_Str")).andReturn(new String[]{"String_Node_Str","String_Node_Str"});
  expect(request.getInputStream()).andReturn(new ByteArrayServletInputStream(bytes.toByteArray()));
  replay(request,response);
  ModelAndView modelAndView=controller.handleRESTOperation("String_Node_Str",VerbType.update,request,response);
  verify(request,response);
  RESTResultView view=(RESTResultView)modelAndView.getView();
  assertNotNull(view.getResult());
  assertTrue(view.getResult() instanceof RootElementExample);
  reset(request,response);
}

Fixed version (ground truth):
/** 
 * tests the handleRESTOperation method.
 */
public void testHandleRESTOperation() throws Exception {
  RESTResource resource=new RESTResource("String_Node_Str"){
    @Override public Set<VerbType> getSupportedVerbs(){
      return new TreeSet(Arrays.asList(VerbType.values()));
    }
  }
;
  resource.addOperation(VerbType.update,new MockRESTEndpoint(),MockRESTEndpoint.class.getMethod("String_Node_Str",String.class,RootElementExample.class,Integer.TYPE,String[].class));
  RESTResourceXMLExporter controller=new RESTResourceXMLExporter(resource);
  controller.setApplicationContext(new GenericApplicationContext());
  HttpServletRequest request=createMock(HttpServletRequest.class);
  HttpServletResponse response=createMock(HttpServletResponse.class);
  response.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED,"String_Node_Str" + VerbType.create);
  replay(request,response);
  controller.handleRESTOperation("String_Node_Str",VerbType.create,request,response);
  verify(request,response);
  reset(request,response);
  JAXBContext context=JAXBContext.newInstance(RootElementExample.class);
  ByteArrayOutputStream bytes=new ByteArrayOutputStream();
  context.createMarshaller().marshal(new RootElementExample(),bytes);
  expect(request.getParameterValues("String_Node_Str")).andReturn(new String[]{"String_Node_Str"});
  expect(request.getParameterValues("String_Node_Str")).andReturn(new String[]{"String_Node_Str","String_Node_Str"});
  expect(request.getInputStream()).andReturn(new ByteArrayServletInputStream(bytes.toByteArray()));
  replay(request,response);
  ModelAndView modelAndView=controller.handleRESTOperation("String_Node_Str",VerbType.update,request,response);
  verify(request,response);
  RESTResultView view=(RESTResultView)modelAndView.getView();
  assertNotNull(view.getResult());
  assertTrue(view.getResult() instanceof RootElementExample);
  reset(request,response);
}