Program: 147443
Project: 147443
Buggy source:
/** 
 * Test case 1 1. Start a Durable subscriber from a normal tenant (Not super tenant) (Topic - topictenant1.com/durableTenantTopic) 2. Send 200 messages to the the topic 3. Durable subscriber should receive all 200 messages
 * @throws AndesClientConfigurationException
 * @throws JMSException
 * @throws NamingException
 * @throws IOException
 * @throws AndesClientException
 */
@Test(groups="String_Node_Str",description="String_Node_Str") public void performSingleTenantMultipleUserDurableTopicTestCase() throws AndesClientConfigurationException, JMSException, NamingException, IOException, AndesClientException, XPathExpressionException, URISyntaxException, SAXException, LoginAuthenticationExceptionException, XMLStreamException, LogoutAuthenticationExceptionException, AndesAdminServiceBrokerManagerAdminException, TopicManagerAdminServiceEventAdminExceptionException, AutomationUtilException {
  String destinationName="String_Node_Str";
  int sendMessageCount=200;
  int expectedMessageCount=200;
  AndesJMSConsumerClientConfiguration adminConsumerConfig=new AndesJMSConsumerClientConfiguration("String_Node_Str","String_Node_Str",ExchangeType.TOPIC,destinationName);
  adminConsumerConfig.setUnSubscribeAfterEachMessageCount(expectedMessageCount);
  adminConsumerConfig.setPrintsPerMessageCount(expectedMessageCount / 10L);
  adminConsumerConfig.setDurable(true,"String_Node_Str");
  AndesClient adminConsumerClient=new AndesClient(adminConsumerConfig,true);
  adminConsumerClient.startClient();
  TopicRolePermission topicRolePermission=new TopicRolePermission();
  topicRolePermission.setRoleName(PUBLISHER_ROLE);
  topicRolePermission.setAllowedToSubscribe(true);
  topicRolePermission.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();
  TopicAdminClient topicAdminClient=new TopicAdminClient(super.backendURL,sessionCookie,ConfigurationContextProvider.getInstance().getConfigurationContext());
  topicAdminClient.updatePermissionForTopic(destinationName,topicRolePermission);
  loginLogoutClient.logout();
  AndesJMSPublisherClientConfiguration tenantPublisherConfig=new AndesJMSPublisherClientConfiguration("String_Node_Str","String_Node_Str",ExchangeType.TOPIC,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" + "String_Node_Str");
  Assert.assertEquals(adminConsumerClient.getReceivedMessageCount(),expectedMessageCount,"String_Node_Str" + "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Test case 1 1. Start a Durable subscriber from a normal tenant (Not super tenant) (Topic - topictenant1.com/durableTenantTopic) 2. Send 200 messages to the the topic 3. Durable subscriber should receive all 200 messages
 * @throws AndesClientConfigurationException
 * @throws JMSException
 * @throws NamingException
 * @throws IOException
 * @throws AndesClientException
 */
@Test(groups="String_Node_Str",description="String_Node_Str") public void performSingleTenantMultipleUserDurableTopicTestCase() throws AndesClientConfigurationException, JMSException, NamingException, IOException, AndesClientException, XPathExpressionException, URISyntaxException, SAXException, LoginAuthenticationExceptionException, XMLStreamException, LogoutAuthenticationExceptionException, AndesAdminServiceBrokerManagerAdminException, TopicManagerAdminServiceEventAdminExceptionException, AutomationUtilException {
  String destinationName="String_Node_Str";
  int sendMessageCount=200;
  int expectedMessageCount=200;
  AndesJMSConsumerClientConfiguration adminConsumerConfig=new AndesJMSConsumerClientConfiguration("String_Node_Str","String_Node_Str",ExchangeType.TOPIC,destinationName);
  adminConsumerConfig.setUnSubscribeAfterEachMessageCount(expectedMessageCount);
  adminConsumerConfig.setPrintsPerMessageCount(expectedMessageCount / 10L);
  adminConsumerConfig.setDurable(true,"String_Node_Str");
  AndesClient adminConsumerClient=new AndesClient(adminConsumerConfig,true);
  adminConsumerClient.startClient();
  TopicRolePermission topicRolePermission=new TopicRolePermission();
  topicRolePermission.setRoleName(PUBLISHER_ROLE);
  topicRolePermission.setAllowedToSubscribe(true);
  topicRolePermission.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();
  TopicAdminClient topicAdminClient=new TopicAdminClient(super.backendURL,sessionCookie);
  topicAdminClient.updatePermissionForTopic(destinationName,topicRolePermission);
  loginLogoutClient.logout();
  AndesJMSPublisherClientConfiguration tenantPublisherConfig=new AndesJMSPublisherClientConfiguration("String_Node_Str","String_Node_Str",ExchangeType.TOPIC,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" + "String_Node_Str");
  Assert.assertEquals(adminConsumerClient.getReceivedMessageCount(),expectedMessageCount,"String_Node_Str" + "String_Node_Str");
}