Program: 41070
Project: 41070
Buggy source:
@Test(timeout=20000) public void testRemotelyCloseConnectionDuringSyncSend() throws Exception {
  final String BREAD_CRUMB="String_Node_Str";
  try (TestAmqpPeer testPeer=new TestAmqpPeer()){
    Connection connection=testFixture.establishConnecton(testPeer);
    testPeer.expectBegin();
    Session session=connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
    testPeer.expectSenderAttach();
    String text="String_Node_Str";
    MessageHeaderSectionMatcher headersMatcher=new MessageHeaderSectionMatcher(true).withDurable(equalTo(true));
    MessageAnnotationsSectionMatcher msgAnnotationsMatcher=new MessageAnnotationsSectionMatcher(true);
    MessagePropertiesSectionMatcher propsMatcher=new MessagePropertiesSectionMatcher(true);
    TransferPayloadCompositeMatcher messageMatcher=new TransferPayloadCompositeMatcher();
    messageMatcher.setHeadersMatcher(headersMatcher);
    messageMatcher.setMessageAnnotationsMatcher(msgAnnotationsMatcher);
    messageMatcher.setPropertiesMatcher(propsMatcher);
    messageMatcher.setMessageContentMatcher(new EncodedAmqpValueMatcher(text));
    testPeer.expectTransfer(messageMatcher,nullValue(),false,false,null,false);
    testPeer.remotelyCloseConnection(false,AmqpError.RESOURCE_LIMIT_EXCEEDED,BREAD_CRUMB);
    Queue queue=session.createQueue("String_Node_Str");
    final MessageProducer producer=session.createProducer(queue);
    Message message=session.createTextMessage(text);
    try {
      producer.send(message);
      fail("String_Node_Str");
    }
 catch (    JMSException jmse) {
      assertNotNull("String_Node_Str",jmse.getMessage());
      assertTrue("String_Node_Str",jmse.getMessage().contains(BREAD_CRUMB));
    }
    testPeer.waitForAllHandlersToComplete(3000);
  }
 }

Fixed version (ground truth):
@Test(timeout=20000) public void testRemotelyCloseConnectionDuringSyncSend() throws Exception {
  final String BREAD_CRUMB="String_Node_Str";
  try (TestAmqpPeer testPeer=new TestAmqpPeer()){
    Connection connection=testFixture.establishConnecton(testPeer);
    testPeer.expectBegin();
    Session session=connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
    testPeer.expectSenderAttach();
    String text="String_Node_Str";
    MessageHeaderSectionMatcher headersMatcher=new MessageHeaderSectionMatcher(true).withDurable(equalTo(true));
    MessageAnnotationsSectionMatcher msgAnnotationsMatcher=new MessageAnnotationsSectionMatcher(true);
    MessagePropertiesSectionMatcher propsMatcher=new MessagePropertiesSectionMatcher(true);
    TransferPayloadCompositeMatcher messageMatcher=new TransferPayloadCompositeMatcher();
    messageMatcher.setHeadersMatcher(headersMatcher);
    messageMatcher.setMessageAnnotationsMatcher(msgAnnotationsMatcher);
    messageMatcher.setPropertiesMatcher(propsMatcher);
    messageMatcher.setMessageContentMatcher(new EncodedAmqpValueMatcher(text));
    testPeer.expectTransfer(messageMatcher,nullValue(),false,false,null,false);
    testPeer.remotelyCloseConnection(true,AmqpError.RESOURCE_LIMIT_EXCEEDED,BREAD_CRUMB);
    Queue queue=session.createQueue("String_Node_Str");
    final MessageProducer producer=session.createProducer(queue);
    Message message=session.createTextMessage(text);
    try {
      producer.send(message);
      fail("String_Node_Str");
    }
 catch (    JMSException jmse) {
      assertNotNull("String_Node_Str",jmse.getMessage());
      assertTrue("String_Node_Str",jmse.getMessage().contains(BREAD_CRUMB));
    }
    testPeer.waitForAllHandlersToComplete(3000);
  }
 }