Program: 47571
Project: 47571
Buggy source:
@Test public void testList() throws Exception {
  try {
    service=new MetadataDatasourceService(new MockSessionAwareMetadataDomainRepository(),new AdministratorAuthorizationPolicy());
    service.add(new MetadataDatasource(getTestDomain("String_Node_Str"),"String_Node_Str",MetadataDatasourceService.TYPE));
    service.add(new MetadataDatasource(getTestDomain("String_Node_Str"),"String_Node_Str",MetadataDatasourceService.TYPE));
    service.add(new MetadataDatasource(getTestDomain("String_Node_Str"),"String_Node_Str",MetadataDatasourceService.TYPE));
    List<IGenericDatasource> domainList=service.getAll();
    assertNotNull(domainList);
    assertEquals(domainList.size(),3);
  }
 catch (  GenericDatasourceServiceException e) {
    assertFalse(true);
  }
  try {
    service.remove("String_Node_Str");
    service.remove("String_Node_Str");
    service.remove("String_Node_Str");
    service.add(new MetadataDatasource(getTestDomain("String_Node_Str"),"String_Node_Str",MetadataDatasourceService.TYPE));
    service.add(new MetadataDatasource(getTestDomain("String_Node_Str"),"String_Node_Str",MetadataDatasourceService.TYPE));
    service.add(new MetadataDatasource(getTestDomain("String_Node_Str"),"String_Node_Str",MetadataDatasourceService.TYPE));
    service=new MetadataDatasourceService(new MockSessionAwareMetadataDomainRepository(),new NonAdministratorAuthorizationPolicy());
    List<IGenericDatasource> domainList=service.getAll();
    assertFalse(true);
  }
 catch (  PentahoAccessControlException e) {
    assertTrue(true);
  }
}

Fixed version (ground truth):
@Test public void testList() throws Exception {
  try {
    service=new MetadataDatasourceService(new MockSessionAwareMetadataDomainRepository(),new AdministratorAuthorizationPolicy());
    service.add(new MetadataDatasource(getTestDomain("String_Node_Str"),"String_Node_Str","String_Node_Str",MetadataDatasourceService.TYPE));
    service.add(new MetadataDatasource(getTestDomain("String_Node_Str"),"String_Node_Str","String_Node_Str",MetadataDatasourceService.TYPE));
    service.add(new MetadataDatasource(getTestDomain("String_Node_Str"),"String_Node_Str","String_Node_Str",MetadataDatasourceService.TYPE));
    List<IGenericDatasource> domainList=service.getAll();
    assertNotNull(domainList);
    assertEquals(domainList.size(),3);
  }
 catch (  GenericDatasourceServiceException e) {
    assertFalse(true);
  }
  try {
    service.remove("String_Node_Str");
    service.remove("String_Node_Str");
    service.remove("String_Node_Str");
    service.add(new MetadataDatasource(getTestDomain("String_Node_Str"),"String_Node_Str","String_Node_Str",MetadataDatasourceService.TYPE));
    service.add(new MetadataDatasource(getTestDomain("String_Node_Str"),"String_Node_Str","String_Node_Str",MetadataDatasourceService.TYPE));
    service.add(new MetadataDatasource(getTestDomain("String_Node_Str"),"String_Node_Str","String_Node_Str",MetadataDatasourceService.TYPE));
    service=new MetadataDatasourceService(new MockSessionAwareMetadataDomainRepository(),new NonAdministratorAuthorizationPolicy());
    List<IGenericDatasource> domainList=service.getAll();
    assertFalse(true);
  }
 catch (  PentahoAccessControlException e) {
    assertTrue(true);
  }
}