Program: 147444
Project: 147444
Buggy source:
/** 
 * Test case 1 1. Start a client in a tenant(Normal tenant) which listens to a queue 2. Send 200 messages to the queue 3. Client should receive all 200 messages
 * @throws JMSException
 * @throws IOException
 * @throws NamingException
 * @throws AndesClientConfigurationException
 * @throws AndesClientException
 */
@Test(groups="String_Node_Str",description="String_Node_Str") public void performSingleTenantMultipleUserQueueTestCase() throws JMSException, IOException, NamingException, AndesClientConfigurationException, AndesClientException, LoginAuthenticationExceptionException, XPathExpressionException, AndesAdminServiceBrokerManagerAdminException, URISyntaxException, SAXException, LogoutAuthenticationExceptionException, XMLStreamException, AutomationUtilException {
  int sendMessageCount=200;
  int expectedMessageCount=200;
  String destinationName="String_Node_Str";
  AndesJMSConsumerClientConfiguration adminConsumerConfig=new AndesJMSConsumerClientConfiguration("String_Node_Str","String_Node_Str",ExchangeType.QUEUE,destinationName);
  adminConsumerConfig.setMaximumMessagesToReceived(expectedMessageCount);
  adminConsumerConfig.setPrintsPerMessageCount(expectedMessageCount / 10L);
  AndesClient adminConsumerClient=new AndesClient(adminConsumerConfig,true);
  adminConsumerClient.startClient();
  QueueRolePermission queueRolePermission=new QueueRolePermission();
  queueRolePermission.setRoleName(PUBLISHER_ROLE);
  queueRolePermission.setAllowedToConsume(true);
  queueRolePermission.setAllowedToPublish(true);
  AutomationContext tenantContext=new AutomationContext("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  LoginLogoutClient loginLogoutClient=new LoginLogoutClient(tenantContext);
  String sessionCookie=loginLogoutClient.login();
  AndesAdminClient andesAdminClient=new AndesAdminClient(super.backendURL,sessionCookie,ConfigurationContextProvider.getInstance().getConfigurationContext());
  andesAdminClient.updatePermissionForQueue(destinationName,queueRolePermission);
  loginLogoutClient.logout();
  AndesJMSPublisherClientConfiguration tenantPublisherConfig=new AndesJMSPublisherClientConfiguration("String_Node_Str","String_Node_Str",ExchangeType.QUEUE,destinationName);
  tenantPublisherConfig.setNumberOfMessagesToSend(sendMessageCount);
  tenantPublisherConfig.setPrintsPerMessageCount(sendMessageCount / 10L);
  AndesClient tenantPublisherClient=new AndesClient(tenantPublisherConfig,true);
  tenantPublisherClient.startClient();
  AndesClientUtils.waitForMessagesAndShutdown(adminConsumerClient,AndesClientConstants.DEFAULT_RUN_TIME);
  Assert.assertEquals(tenantPublisherClient.getSentMessageCount(),sendMessageCount,"String_Node_Str");
  Assert.assertEquals(adminConsumerClient.getReceivedMessageCount(),expectedMessageCount,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Test case 1 1. Start a client in a tenant(Normal tenant) which listens to a queue 2. Send 200 messages to the queue 3. Client should receive all 200 messages
 * @throws JMSException
 * @throws IOException
 * @throws NamingException
 * @throws AndesClientConfigurationException
 * @throws AndesClientException
 */
@Test(groups="String_Node_Str",description="String_Node_Str") public void performSingleTenantMultipleUserQueueTestCase() throws JMSException, IOException, NamingException, AndesClientConfigurationException, AndesClientException, LoginAuthenticationExceptionException, XPathExpressionException, AndesAdminServiceBrokerManagerAdminException, URISyntaxException, SAXException, LogoutAuthenticationExceptionException, XMLStreamException, AutomationUtilException {
  int sendMessageCount=200;
  int expectedMessageCount=200;
  String destinationName="String_Node_Str";
  AndesJMSConsumerClientConfiguration adminConsumerConfig=new AndesJMSConsumerClientConfiguration("String_Node_Str","String_Node_Str",ExchangeType.QUEUE,destinationName);
  adminConsumerConfig.setMaximumMessagesToReceived(expectedMessageCount);
  adminConsumerConfig.setPrintsPerMessageCount(expectedMessageCount / 10L);
  AndesClient adminConsumerClient=new AndesClient(adminConsumerConfig,true);
  adminConsumerClient.startClient();
  QueueRolePermission queueRolePermission=new QueueRolePermission();
  queueRolePermission.setRoleName(PUBLISHER_ROLE);
  queueRolePermission.setAllowedToConsume(true);
  queueRolePermission.setAllowedToPublish(true);
  AutomationContext tenantContext=new AutomationContext("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  LoginLogoutClient loginLogoutClient=new LoginLogoutClient(tenantContext);
  String sessionCookie=loginLogoutClient.login();
  AndesAdminClient andesAdminClient=new AndesAdminClient(super.backendURL,sessionCookie);
  andesAdminClient.updatePermissionForQueue(destinationName,queueRolePermission);
  loginLogoutClient.logout();
  AndesJMSPublisherClientConfiguration tenantPublisherConfig=new AndesJMSPublisherClientConfiguration("String_Node_Str","String_Node_Str",ExchangeType.QUEUE,destinationName);
  tenantPublisherConfig.setNumberOfMessagesToSend(sendMessageCount);
  tenantPublisherConfig.setPrintsPerMessageCount(sendMessageCount / 10L);
  AndesClient tenantPublisherClient=new AndesClient(tenantPublisherConfig,true);
  tenantPublisherClient.startClient();
  AndesClientUtils.waitForMessagesAndShutdown(adminConsumerClient,AndesClientConstants.DEFAULT_RUN_TIME);
  Assert.assertEquals(tenantPublisherClient.getSentMessageCount(),sendMessageCount,"String_Node_Str");
  Assert.assertEquals(adminConsumerClient.getReceivedMessageCount(),expectedMessageCount,"String_Node_Str");
}