Program: 41697
Project: 41697
Buggy source:
@Test(timeout=2000) public void testReceiveMessageWithApplicationProperties() throws Exception {
  try (TestAmqpPeer testPeer=new TestAmqpPeer(IntegrationTestFixture.PORT)){
    Connection connection=testFixture.establishConnecton(testPeer);
    connection.start();
    testPeer.expectBegin(true);
    Session session=connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
    Queue queue=session.createQueue("String_Node_Str");
    PropertiesDescribedType props=new PropertiesDescribedType();
    props.setMessageId("String_Node_Str");
    ApplicationPropertiesDescribedType appProperties=new ApplicationPropertiesDescribedType();
    appProperties.setApplicationProperty(STRING_PROP,STRING_PROP_VALUE);
    appProperties.setApplicationProperty(NULL_STRING_PROP,NULL_STRING_PROP_VALUE);
    appProperties.setApplicationProperty(BOOLEAN_PROP,BOOLEAN_PROP_VALUE);
    appProperties.setApplicationProperty(BYTE_PROP,BYTE_PROP_VALUE);
    appProperties.setApplicationProperty(SHORT_PROP,SHORT_PROP_VALUE);
    appProperties.setApplicationProperty(INT_PROP,INT_PROP_VALUE);
    appProperties.setApplicationProperty(LONG_PROP,LONG_PROP_VALUE);
    appProperties.setApplicationProperty(FLOAT_PROP,FLOAT_PROP_VALUE);
    appProperties.setApplicationProperty(DOUBLE_PROP,DOUBLE_PROP_VALUE);
    DescribedType amqpValueNullContent=new AmqpValueDescribedType(null);
    testPeer.expectReceiverAttach();
    testPeer.expectLinkFlowRespondWithTransfer(null,null,props,appProperties,amqpValueNullContent);
    testPeer.expectDispositionThatIsAcceptedAndSettled();
    MessageConsumer messageConsumer=session.createConsumer(queue);
    Message receivedMessage=messageConsumer.receive(1000);
    testPeer.waitForAllHandlersToComplete(3000);
    assertTrue(receivedMessage.propertyExists(STRING_PROP));
    assertTrue(receivedMessage.propertyExists(NULL_STRING_PROP));
    assertTrue(receivedMessage.propertyExists(BYTE_PROP));
    assertTrue(receivedMessage.propertyExists(BOOLEAN_PROP));
    assertTrue(receivedMessage.propertyExists(SHORT_PROP));
    assertTrue(receivedMessage.propertyExists(INT_PROP));
    assertTrue(receivedMessage.propertyExists(LONG_PROP));
    assertTrue(receivedMessage.propertyExists(FLOAT_PROP));
    assertTrue(receivedMessage.propertyExists(DOUBLE_PROP));
    assertNull(receivedMessage.getStringProperty(NULL_STRING_PROP));
    assertEquals(STRING_PROP_VALUE,receivedMessage.getStringProperty(STRING_PROP));
    assertEquals(STRING_PROP_VALUE,receivedMessage.getStringProperty(STRING_PROP));
    assertEquals(BOOLEAN_PROP_VALUE,receivedMessage.getBooleanProperty(BOOLEAN_PROP));
    assertEquals(BYTE_PROP_VALUE,receivedMessage.getByteProperty(BYTE_PROP));
    assertEquals(SHORT_PROP_VALUE,receivedMessage.getShortProperty(SHORT_PROP));
    assertEquals(INT_PROP_VALUE,receivedMessage.getIntProperty(INT_PROP));
    assertEquals(LONG_PROP_VALUE,receivedMessage.getLongProperty(LONG_PROP));
    assertEquals(FLOAT_PROP_VALUE,receivedMessage.getFloatProperty(FLOAT_PROP),0.0);
    assertEquals(DOUBLE_PROP_VALUE,receivedMessage.getDoubleProperty(DOUBLE_PROP),0.0);
  }
 }

Fixed version (ground truth):
@Test(timeout=2000) public void testReceiveMessageWithApplicationProperties() throws Exception {
  try (TestAmqpPeer testPeer=new TestAmqpPeer(testFixture.getAvailablePort())){
    Connection connection=testFixture.establishConnecton(testPeer);
    connection.start();
    testPeer.expectBegin(true);
    Session session=connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
    Queue queue=session.createQueue("String_Node_Str");
    PropertiesDescribedType props=new PropertiesDescribedType();
    props.setMessageId("String_Node_Str");
    ApplicationPropertiesDescribedType appProperties=new ApplicationPropertiesDescribedType();
    appProperties.setApplicationProperty(STRING_PROP,STRING_PROP_VALUE);
    appProperties.setApplicationProperty(NULL_STRING_PROP,NULL_STRING_PROP_VALUE);
    appProperties.setApplicationProperty(BOOLEAN_PROP,BOOLEAN_PROP_VALUE);
    appProperties.setApplicationProperty(BYTE_PROP,BYTE_PROP_VALUE);
    appProperties.setApplicationProperty(SHORT_PROP,SHORT_PROP_VALUE);
    appProperties.setApplicationProperty(INT_PROP,INT_PROP_VALUE);
    appProperties.setApplicationProperty(LONG_PROP,LONG_PROP_VALUE);
    appProperties.setApplicationProperty(FLOAT_PROP,FLOAT_PROP_VALUE);
    appProperties.setApplicationProperty(DOUBLE_PROP,DOUBLE_PROP_VALUE);
    DescribedType amqpValueNullContent=new AmqpValueDescribedType(null);
    testPeer.expectReceiverAttach();
    testPeer.expectLinkFlowRespondWithTransfer(null,null,props,appProperties,amqpValueNullContent);
    testPeer.expectDispositionThatIsAcceptedAndSettled();
    MessageConsumer messageConsumer=session.createConsumer(queue);
    Message receivedMessage=messageConsumer.receive(1000);
    testPeer.waitForAllHandlersToComplete(3000);
    assertTrue(receivedMessage.propertyExists(STRING_PROP));
    assertTrue(receivedMessage.propertyExists(NULL_STRING_PROP));
    assertTrue(receivedMessage.propertyExists(BYTE_PROP));
    assertTrue(receivedMessage.propertyExists(BOOLEAN_PROP));
    assertTrue(receivedMessage.propertyExists(SHORT_PROP));
    assertTrue(receivedMessage.propertyExists(INT_PROP));
    assertTrue(receivedMessage.propertyExists(LONG_PROP));
    assertTrue(receivedMessage.propertyExists(FLOAT_PROP));
    assertTrue(receivedMessage.propertyExists(DOUBLE_PROP));
    assertNull(receivedMessage.getStringProperty(NULL_STRING_PROP));
    assertEquals(STRING_PROP_VALUE,receivedMessage.getStringProperty(STRING_PROP));
    assertEquals(STRING_PROP_VALUE,receivedMessage.getStringProperty(STRING_PROP));
    assertEquals(BOOLEAN_PROP_VALUE,receivedMessage.getBooleanProperty(BOOLEAN_PROP));
    assertEquals(BYTE_PROP_VALUE,receivedMessage.getByteProperty(BYTE_PROP));
    assertEquals(SHORT_PROP_VALUE,receivedMessage.getShortProperty(SHORT_PROP));
    assertEquals(INT_PROP_VALUE,receivedMessage.getIntProperty(INT_PROP));
    assertEquals(LONG_PROP_VALUE,receivedMessage.getLongProperty(LONG_PROP));
    assertEquals(FLOAT_PROP_VALUE,receivedMessage.getFloatProperty(FLOAT_PROP),0.0);
    assertEquals(DOUBLE_PROP_VALUE,receivedMessage.getDoubleProperty(DOUBLE_PROP),0.0);
  }
 }