Program: 152620
Project: 152620
Buggy source:
@Test public void testProcess() throws IOException, SAXException {
  HttpServletRequest httpServletRequest=mocksControl.createMock(HttpServletRequest.class);
  expect(serverRuntimeContext.getNextSessionId()).andReturn("String_Node_Str");
  expect(serverRuntimeContext.getServerEnitity()).andReturn(new EntityImpl(null,"String_Node_Str",null));
  expect(serverRuntimeContext.getDefaultXMLLang()).andReturn("String_Node_Str");
  Continuation continuation=mocksControl.createMock(Continuation.class);
  expect(httpServletRequest.getAttribute(Continuation.ATTRIBUTE)).andReturn(continuation);
  expectLastCall().atLeastOnce();
  continuation.setTimeout(anyLong());
  Capture<BoshRequest> br=new Capture<BoshRequest>();
  continuation.setAttribute(eq("String_Node_Str"),EasyMock.<BoshRequest>capture(br));
  continuation.addContinuationListener(EasyMock.<ContinuationListener>anyObject());
  continuation.suspend();
  ServerFeatures serverFeatures=mocksControl.createMock(ServerFeatures.class);
  expect(serverRuntimeContext.getServerFeatures()).andReturn(serverFeatures);
  expect(serverFeatures.getAuthenticationMethods()).andReturn(Collections.<SASLMechanism>emptyList());
  Capture<BoshResponse> captured=new Capture<BoshResponse>();
  continuation.setAttribute(eq("String_Node_Str"),EasyMock.<BoshResponse>capture(captured));
  continuation.resume();
  mocksControl.replay();
  Stanza boshRequest=createSessionRequest();
  boshHandler.process(httpServletRequest,boshRequest);
  mocksControl.verify();
  assertEquals(httpServletRequest,br.getValue().getHttpServletRequest());
  assertEquals(boshRequest,br.getValue().getBody());
  Stanza response=new XMLUtil(new String(captured.getValue().getContent())).parse();
  assertNotNull(response);
  assertEquals("String_Node_Str",response.getName());
  assertEquals(NamespaceURIs.XEP0124_BOSH,response.getNamespaceURI());
  assertEquals("String_Node_Str",response.getAttributeValue("String_Node_Str"));
  assertEquals("String_Node_Str",response.getAttributeValue("String_Node_Str"));
  assertEquals("String_Node_Str",response.getAttributeValue("String_Node_Str"));
  assertEquals("String_Node_Str",response.getAttributeValue("String_Node_Str"));
  assertEquals("String_Node_Str",response.getAttributeValue("String_Node_Str"));
  assertEquals(1,response.getInnerElements().size());
  XMLElement streamFeatures=response.getInnerElements().get(0);
  assertEquals("String_Node_Str",streamFeatures.getName());
  assertEquals(NamespaceURIs.HTTP_ETHERX_JABBER_ORG_STREAMS,streamFeatures.getNamespaceURI());
  assertEquals(1,streamFeatures.getInnerElements().size());
  XMLElement saslMechanisms=streamFeatures.getInnerElements().get(0);
  assertEquals("String_Node_Str",saslMechanisms.getName());
  assertEquals(NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_SASL,saslMechanisms.getNamespaceURI());
  mocksControl.reset();
  expect(httpServletRequest.getAttribute(Continuation.ATTRIBUTE)).andReturn(continuation);
  expectLastCall().atLeastOnce();
  continuation.setTimeout(anyLong());
  continuation.suspend();
  continuation.setAttribute(eq("String_Node_Str"),EasyMock.<BoshRequest>capture(br));
  continuation.addContinuationListener(EasyMock.<ContinuationListener>anyObject());
  StanzaProcessor stanzaProcessor=mocksControl.createMock(StanzaProcessor.class);
  expect(serverRuntimeContext.getStanzaProcessor()).andReturn(stanzaProcessor);
  Capture<Stanza> stanzaCaptured=new Capture<Stanza>();
  stanzaProcessor.processStanza(eq(serverRuntimeContext),EasyMock.<SessionContext>anyObject(),EasyMock.<Stanza>capture(stanzaCaptured),EasyMock.<SessionStateHolder>anyObject());
  mocksControl.replay();
  boshRequest=createSaslRequest();
  boshHandler.process(httpServletRequest,boshRequest);
  mocksControl.verify();
  assertEquals(httpServletRequest,br.getValue().getHttpServletRequest());
  assertEquals(boshRequest,br.getValue().getBody());
  Stanza stanza=stanzaCaptured.getValue();
  assertNotNull(stanza);
  assertEquals("String_Node_Str",stanza.getName());
  assertEquals(NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_SASL,stanza.getNamespaceURI());
  assertEquals("String_Node_Str",stanza.getAttributeValue("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testProcess() throws IOException, SAXException {
  HttpServletRequest httpServletRequest=mocksControl.createMock(HttpServletRequest.class);
  expect(serverRuntimeContext.getNextSessionId()).andReturn("String_Node_Str");
  expect(serverRuntimeContext.getServerEnitity()).andReturn(new EntityImpl(null,"String_Node_Str",null));
  expect(serverRuntimeContext.getDefaultXMLLang()).andReturn("String_Node_Str");
  Continuation continuation=mocksControl.createMock(Continuation.class);
  expect(httpServletRequest.getAttribute(Continuation.ATTRIBUTE)).andReturn(continuation);
  expectLastCall().atLeastOnce();
  continuation.setTimeout(anyLong());
  Capture<BoshRequest> br=new Capture<BoshRequest>();
  continuation.setAttribute(eq("String_Node_Str"),EasyMock.<BoshRequest>capture(br));
  continuation.addContinuationListener(EasyMock.<ContinuationListener>anyObject());
  continuation.suspend();
  ServerFeatures serverFeatures=mocksControl.createMock(ServerFeatures.class);
  expect(serverRuntimeContext.getServerFeatures()).andReturn(serverFeatures);
  expect(serverFeatures.getAuthenticationMethods()).andReturn(Collections.<SASLMechanism>emptyList());
  expect(serverRuntimeContext.getModule(InBandRegistrationModule.class)).andReturn(null);
  Capture<BoshResponse> captured=new Capture<BoshResponse>();
  continuation.setAttribute(eq("String_Node_Str"),EasyMock.<BoshResponse>capture(captured));
  continuation.resume();
  mocksControl.replay();
  Stanza boshRequest=createSessionRequest();
  boshHandler.process(httpServletRequest,boshRequest);
  mocksControl.verify();
  assertEquals(httpServletRequest,br.getValue().getHttpServletRequest());
  assertEquals(boshRequest,br.getValue().getBody());
  Stanza response=new XMLUtil(new String(captured.getValue().getContent())).parse();
  assertNotNull(response);
  assertEquals("String_Node_Str",response.getName());
  assertEquals(NamespaceURIs.XEP0124_BOSH,response.getNamespaceURI());
  assertEquals("String_Node_Str",response.getAttributeValue("String_Node_Str"));
  assertEquals("String_Node_Str",response.getAttributeValue("String_Node_Str"));
  assertEquals("String_Node_Str",response.getAttributeValue("String_Node_Str"));
  assertEquals("String_Node_Str",response.getAttributeValue("String_Node_Str"));
  assertEquals("String_Node_Str",response.getAttributeValue("String_Node_Str"));
  assertEquals(1,response.getInnerElements().size());
  XMLElement streamFeatures=response.getInnerElements().get(0);
  assertEquals("String_Node_Str",streamFeatures.getName());
  assertEquals(NamespaceURIs.HTTP_ETHERX_JABBER_ORG_STREAMS,streamFeatures.getNamespaceURI());
  assertEquals(1,streamFeatures.getInnerElements().size());
  XMLElement saslMechanisms=streamFeatures.getInnerElements().get(0);
  assertEquals("String_Node_Str",saslMechanisms.getName());
  assertEquals(NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_SASL,saslMechanisms.getNamespaceURI());
  mocksControl.reset();
  expect(httpServletRequest.getAttribute(Continuation.ATTRIBUTE)).andReturn(continuation);
  expectLastCall().atLeastOnce();
  continuation.setTimeout(anyLong());
  continuation.suspend();
  continuation.setAttribute(eq("String_Node_Str"),EasyMock.<BoshRequest>capture(br));
  continuation.addContinuationListener(EasyMock.<ContinuationListener>anyObject());
  StanzaProcessor stanzaProcessor=mocksControl.createMock(StanzaProcessor.class);
  expect(serverRuntimeContext.getStanzaProcessor()).andReturn(stanzaProcessor);
  Capture<Stanza> stanzaCaptured=new Capture<Stanza>();
  stanzaProcessor.processStanza(eq(serverRuntimeContext),EasyMock.<SessionContext>anyObject(),EasyMock.<Stanza>capture(stanzaCaptured),EasyMock.<SessionStateHolder>anyObject());
  mocksControl.replay();
  boshRequest=createSaslRequest();
  boshHandler.process(httpServletRequest,boshRequest);
  mocksControl.verify();
  assertEquals(httpServletRequest,br.getValue().getHttpServletRequest());
  assertEquals(boshRequest,br.getValue().getBody());
  Stanza stanza=stanzaCaptured.getValue();
  assertNotNull(stanza);
  assertEquals("String_Node_Str",stanza.getName());
  assertEquals(NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_SASL,stanza.getNamespaceURI());
  assertEquals("String_Node_Str",stanza.getAttributeValue("String_Node_Str"));
}