nus-yam/ex-repair huggingface dataset:
Program: 34521
Project: 34521
Buggy source:
/** 
 * Use the completeAsync method to complete a stage that is already running.
 */
@Test public void testCompleteAsyncWhileRunning() throws Exception {
  CountDownLatch beginLatch=new CountDownLatch(1);
  CountDownLatch continueLatch=new CountDownLatch(1);
  BlockableSupplier<String> blockingSupplier=new BlockableSupplier<String>("String_Node_Str",beginLatch,continueLatch);
  ManagedCompletableFuture<String> cf0;
  try {
    cf0=(ManagedCompletableFuture<String>)ManagedCompletableFuture.supplyAsync(blockingSupplier);
  }
 catch (  UnsupportedOperationException x) {
    if (AT_LEAST_JAVA_9)     throw x;
 else     return;
  }
  assertTrue(beginLatch.await(TIMEOUT_NS,TimeUnit.NANOSECONDS));
  CompletableFuture<String> cf1=cf0.completeAsync(() -> Thread.currentThread().getName());
  assertSame("String_Node_Str",cf0,cf1);
  String result=cf0.get(TIMEOUT_NS,TimeUnit.NANOSECONDS);
  assertTrue(result,result.startsWith("String_Node_Str"));
  assertTrue(result,!Thread.currentThread().getName().equals(result));
  for (long start=System.nanoTime(); blockingSupplier.executionThread != null && System.nanoTime() - start <= TIMEOUT_NS; TimeUnit.MILLISECONDS.sleep(200))   ;
  assertNull(blockingSupplier.executionThread);
}

Fixed version (ground truth):
/** 
 * Use the completeAsync method to complete a stage that is already running.
 */
@Test public void testCompleteAsyncWhileRunning() throws Exception {
  CountDownLatch beginLatch=new CountDownLatch(1);
  CountDownLatch continueLatch=new CountDownLatch(1);
  BlockableSupplier<String> blockingSupplier=new BlockableSupplier<String>("String_Node_Str",beginLatch,continueLatch);
  ManagedCompletableFuture<String> cf0=(ManagedCompletableFuture<String>)ManagedCompletableFuture.supplyAsync(blockingSupplier);
  assertTrue(beginLatch.await(TIMEOUT_NS,TimeUnit.NANOSECONDS));
  CompletableFuture<String> cf1;
  try {
    cf1=cf0.completeAsync(() -> Thread.currentThread().getName());
  }
 catch (  UnsupportedOperationException x) {
    continueLatch.countDown();
    if (AT_LEAST_JAVA_9)     throw x;
 else     return;
  }
  assertSame("String_Node_Str",cf0,cf1);
  String result=cf0.get(TIMEOUT_NS,TimeUnit.NANOSECONDS);
  assertTrue(result,result.startsWith("String_Node_Str"));
  assertTrue(result,!Thread.currentThread().getName().equals(result));
  for (long start=System.nanoTime(); blockingSupplier.executionThread != null && System.nanoTime() - start <= TIMEOUT_NS; TimeUnit.MILLISECONDS.sleep(200))   ;
  assertNull(blockingSupplier.executionThread);
}
Program: 34522
Project: 34522
Buggy source:
/** 
 * Verify that completeAsync can be used on an incomplete stage to cause it to complete.
 */
@Test public void testCompleteAsyncOfIncompleteStage() throws Exception {
  ManagedCompletableFuture<String> cf0;
  try {
    cf0=(ManagedCompletableFuture<String>)ManagedCompletableFuture.completedFuture("String_Node_Str");
  }
 catch (  UnsupportedOperationException x) {
    if (AT_LEAST_JAVA_9)     throw x;
 else     return;
  }
  ManagedCompletableFuture<String> cf1=(ManagedCompletableFuture<String>)cf0.newIncompleteFuture();
  CompletableFuture<String> cf2=cf1.completeAsync(() -> {
    StringBuilder s=new StringBuilder(Thread.currentThread().getName()).append(':');
    try {
      s.append(InitialContext.doLookup("String_Node_Str").toString());
    }
 catch (    NamingException x) {
      s.append("String_Node_Str");
    }
    return s.toString();
  }
,noContextExecutor);
  assertSame(cf1,cf2);
  String result=cf2.get(TIMEOUT_NS,TimeUnit.NANOSECONDS);
  assertTrue(result,result.startsWith("String_Node_Str"));
  assertTrue(result,!Thread.currentThread().getName().equals(result));
  assertTrue(result,result.endsWith("String_Node_Str"));
  assertTrue(cf2.isDone());
  assertFalse(cf2.isCancelled());
  assertFalse(cf2.isCompletedExceptionally());
}

Fixed version (ground truth):
/** 
 * Verify that completeAsync can be used on an incomplete stage to cause it to complete.
 */
@Test public void testCompleteAsyncOfIncompleteStage() throws Exception {
  ManagedCompletableFuture<String> cf0=(ManagedCompletableFuture<String>)ManagedCompletableFuture.completedFuture("String_Node_Str");
  ManagedCompletableFuture<String> cf1=(ManagedCompletableFuture<String>)cf0.newIncompleteFuture();
  CompletableFuture<String> cf2;
  try {
    cf2=cf1.completeAsync(() -> {
      StringBuilder s=new StringBuilder(Thread.currentThread().getName()).append(':');
      try {
        s.append(InitialContext.doLookup("String_Node_Str").toString());
      }
 catch (      NamingException x) {
        s.append("String_Node_Str");
      }
      return s.toString();
    }
,noContextExecutor);
  }
 catch (  UnsupportedOperationException x) {
    if (AT_LEAST_JAVA_9)     throw x;
 else     return;
  }
  assertSame(cf1,cf2);
  String result=cf2.get(TIMEOUT_NS,TimeUnit.NANOSECONDS);
  assertTrue(result,result.startsWith("String_Node_Str"));
  assertTrue(result,!Thread.currentThread().getName().equals(result));
  assertTrue(result,result.endsWith("String_Node_Str"));
  assertTrue(cf2.isDone());
  assertFalse(cf2.isCancelled());
  assertFalse(cf2.isCompletedExceptionally());
}
Program: 34523
Project: 34523
Buggy source:
/** 
 * Verify that completeAsync is a no-op on an already-completed stage
 */
@Test public void testCompleteAsyncOfCompletedStage() throws Exception {
  ManagedCompletableFuture<Integer> cf0;
  try {
    cf0=(ManagedCompletableFuture<Integer>)ManagedCompletableFuture.completedFuture(90);
  }
 catch (  UnsupportedOperationException x) {
    if (AT_LEAST_JAVA_9)     throw x;
 else     return;
  }
  CompletableFuture<Integer> cf1=cf0.completeAsync(() -> 900);
  assertSame(cf0,cf1);
  assertEquals(Integer.valueOf(90),cf0.join());
}

Fixed version (ground truth):
/** 
 * Verify that completeAsync is a no-op on an already-completed stage
 */
@Test public void testCompleteAsyncOfCompletedStage() throws Exception {
  ManagedCompletableFuture<Integer> cf0=(ManagedCompletableFuture<Integer>)ManagedCompletableFuture.completedFuture(90);
  CompletableFuture<Integer> cf1;
  try {
    cf1=cf0.completeAsync(() -> 900);
  }
 catch (  UnsupportedOperationException x) {
    if (AT_LEAST_JAVA_9)     throw x;
 else     return;
  }
  assertSame(cf0,cf1);
  assertEquals(Integer.valueOf(90),cf0.join());
}
Program: 34524
Project: 34524
Buggy source:
/** 
 * Tests that accessing a session prevents invalidation.
 */
@Test public void testRefreshInvalidation() throws Exception {
  int refreshes=TestModeFilter.FRAMEWORK_TEST_MODE == TestMode.FULL ? 15 : 3;
  for (int attempt=0; attempt < 5; attempt++) {
    List<String> session=newSession();
    app.sessionPut("String_Node_Str","String_Node_Str",session,true);
    long start=0;
    try {
      for (int i=0; i < refreshes; i++) {
        start=System.nanoTime();
        TimeUnit.SECONDS.sleep(3);
        app.sessionGet("String_Node_Str","String_Node_Str",session);
      }
      return;
    }
 catch (    AssertionError e) {
      long elapsed=System.nanoTime() - start;
      if (TimeUnit.NANOSECONDS.toMillis(elapsed) > 4500) {
        Log.info(c,testName.getMethodName(),"String_Node_Str");
        continue;
      }
 else {
        throw e;
      }
    }
  }
  fail("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Tests that accessing a session prevents invalidation.
 */
@Test public void testRefreshInvalidation() throws Exception {
  int refreshes=TestModeFilter.FRAMEWORK_TEST_MODE == TestMode.FULL ? 15 : 3;
  for (int attempt=0; attempt < 5; attempt++) {
    List<String> session=newSession();
    app.sessionPut("String_Node_Str","String_Node_Str",session,true);
    long start=0, prevStart=0;
    try {
      for (int i=0; i < refreshes; i++) {
        prevStart=start;
        start=System.nanoTime();
        TimeUnit.SECONDS.sleep(3);
        app.sessionGet("String_Node_Str","String_Node_Str",session);
      }
      return;
    }
 catch (    AssertionError e) {
      long elapsed=System.nanoTime() - start;
      if (TimeUnit.NANOSECONDS.toMillis(elapsed) > 4500 || prevStart > 0 && start - prevStart > TimeUnit.SECONDS.toNanos(4)) {
        Log.info(c,testName.getMethodName(),"String_Node_Str");
        continue;
      }
 else {
        throw e;
      }
    }
  }
  fail("String_Node_Str");
}
Program: 34525
Project: 34525
Buggy source:
/** 
 * This test will verify that we can't change the dataSourceLookup setting via an immediate EL expression. <ul> <li>DB_USER1 - authorized with default datasourc</li> <li>DB_USER2 - authorized with datasource</li> <li>DB_USER3 - unauthorized (never authorized)</li> </ul>
 * @throws Exception If the test failed for some unforeseen reason.
 */
@Test public void dataSourceLookup() throws Exception {
  Log.info(logClass,getCurrentTestName(),"String_Node_Str" + getCurrentTestName());
  Map<String,String> overrides=new HashMap<String,String>();
  overrides.put(JavaEESecConstants.DS_LOOKUP,"String_Node_Str");
  DatabaseSettingsBean.updateDatabaseSettingsBean(server.getServerRoot(),overrides);
  String msg="String_Node_Str";
  String msg2="String_Node_Str";
  String msg3="String_Node_Str";
  List<String> foundResults=myServer.findStringsInLogsAndTrace(msg3);
  assertEquals("String_Node_Str" + msg3,1,foundResults.size());
  verifyAuthorization(SC_OK,SC_OK,SC_FORBIDDEN);
  foundResults=myServer.findStringsInLogsAndTrace(msg);
  assertFalse("String_Node_Str" + msg,foundResults.isEmpty());
  foundResults=myServer.findStringsInLogs(msg2);
  assertTrue("String_Node_Str" + msg2,foundResults.isEmpty());
  Log.info(logClass,getCurrentTestName(),"String_Node_Str" + getCurrentTestName());
}

Fixed version (ground truth):
/** 
 * This test will verify that we can't change the dataSourceLookup setting via an immediate EL expression. <ul> <li>DB_USER1 - authorized with default datasourc</li> <li>DB_USER2 - authorized with datasource</li> <li>DB_USER3 - unauthorized (never authorized)</li> </ul>
 * @throws Exception If the test failed for some unforeseen reason.
 */
@Test public void dataSourceLookup() throws Exception {
  Log.info(logClass,getCurrentTestName(),"String_Node_Str" + getCurrentTestName());
  Map<String,String> overrides=new HashMap<String,String>();
  overrides.put(JavaEESecConstants.DS_LOOKUP,"String_Node_Str");
  DatabaseSettingsBean.updateDatabaseSettingsBean(server.getServerRoot(),overrides);
  String msg="String_Node_Str";
  String msg2="String_Node_Str";
  String msg3="String_Node_Str";
  verifyAuthorization(SC_OK,SC_OK,SC_FORBIDDEN);
  List<String> foundResults=myServer.findStringsInLogsAndTrace(msg3);
  assertEquals("String_Node_Str" + msg3,1,foundResults.size());
  foundResults=myServer.findStringsInLogsAndTrace(msg);
  assertFalse("String_Node_Str" + msg,foundResults.isEmpty());
  foundResults=myServer.findStringsInLogs(msg2);
  assertTrue("String_Node_Str" + msg2,foundResults.isEmpty());
  Log.info(logClass,getCurrentTestName(),"String_Node_Str" + getCurrentTestName());
}
Program: 34526
Project: 34526
Buggy source:
@Before public void setupConnection(){
  httpclient=new DefaultHttpClient();
}

Fixed version (ground truth):
@Before public void setupConnection(){
  HttpParams httpParams=new BasicHttpParams();
  httpParams.setParameter(ClientPNames.HANDLE_REDIRECTS,Boolean.FALSE);
  httpclient=new DefaultHttpClient(httpParams);
}
Program: 34528
Project: 34528
Buggy source:
/** 
 * Test method and field injection on custom state manager. No intercepter or constructor tests on this. Would like to do something more than look for message in logs, a future improvement.
 * @throws Exception
 */
protected void testCustomStateManagerInjectionsByApp(String app,LibertyServer server) throws Exception {
  String msg="String_Node_Str" + app;
  String isStateManagerMessage=server.waitForStringInLog(msg);
  assertNotNull("String_Node_Str" + msg,isStateManagerMessage);
}

Fixed version (ground truth):
/** 
 * Test method and field injection on custom state manager. No intercepter or constructor tests on this. Would like to do something more than look for message in logs, a future improvement.
 * @throws Exception
 */
protected void testCustomStateManagerInjectionsByApp(String contextRoot,LibertyServer server) throws Exception {
  WebClient webClient=new WebClient();
  URL url=JSFUtils.createHttpUrl(server,contextRoot,"String_Node_Str");
  HtmlPage page=(HtmlPage)webClient.getPage(url);
  if (page == null) {
    Assert.fail("String_Node_Str");
  }
  String msg="String_Node_Str" + contextRoot;
  String isStateManagerMessage=server.waitForStringInLog(msg);
  assertNotNull("String_Node_Str" + msg,isStateManagerMessage);
}
Program: 34529
Project: 34529
Buggy source:
/** 
 * Get the Destination Roles, it will be used for audit
 */
public String[] getDestinationRoles(Map<String,?> destinationPermissions,String dest,String user){
  SibTr.debug(tc,"String_Node_Str" + dest + "String_Node_Str"+ user);
  ArrayList<String> roleList=new ArrayList();
  int element=0;
  Set<String> destinations=destinationPermissions.keySet();
  for (  String destination : destinations) {
    SibTr.debug(tc,"String_Node_Str" + destination);
    if (destination.equals(dest)) {
      Permission permission=(Permission)destinationPermissions.get(destination);
      Map<String,Set<String>> userRoles=permission.getRoleToUserMap();
      Set<String> uRoles=userRoles.keySet();
      for (      String role : uRoles) {
        SibTr.debug(tc,"String_Node_Str" + role);
        SibTr.debug(tc,"String_Node_Str" + userRoles.get(role));
        Set<String> rs=userRoles.get(role);
        for (        String r : rs) {
          SibTr.debug(tc,"String_Node_Str" + r);
          if (r.equals(user)) {
            roleList.add(role);
          }
        }
      }
    }
  }
  if (roleList != null)   SibTr.debug(tc,"String_Node_Str" + roleList.toArray().toString());
 else   SibTr.debut(tc,"String_Node_Str" + user);
  Object[] roleListAsObjectArray=roleList.toArray();
  String[] roleListAsStrArray=Arrays.copyOf(roleListAsObjectArray,roleListAsObjectArray.length,String[].class);
  return (roleListAsStrArray);
}

Fixed version (ground truth):
/** 
 * Get the Destination Roles, it will be used for audit
 */
public String[] getDestinationRoles(Map<String,?> destinationPermissions,String dest,String user){
  SibTr.debug(tc,"String_Node_Str" + dest + "String_Node_Str"+ user);
  ArrayList<String> roleList=new ArrayList();
  int element=0;
  Set<String> destinations=destinationPermissions.keySet();
  for (  String destination : destinations) {
    SibTr.debug(tc,"String_Node_Str" + destination);
    if (destination.equals(dest)) {
      Permission permission=(Permission)destinationPermissions.get(destination);
      Map<String,Set<String>> userRoles=permission.getRoleToUserMap();
      Set<String> uRoles=userRoles.keySet();
      for (      String role : uRoles) {
        SibTr.debug(tc,"String_Node_Str" + role);
        SibTr.debug(tc,"String_Node_Str" + userRoles.get(role));
        Set<String> rs=userRoles.get(role);
        for (        String r : rs) {
          SibTr.debug(tc,"String_Node_Str" + r);
          if (r.equals(user)) {
            roleList.add(role);
          }
        }
      }
    }
  }
  if (roleList != null)   SibTr.debug(tc,"String_Node_Str" + roleList.toArray().toString());
 else   SibTr.debug(tc,"String_Node_Str" + user);
  Object[] roleListAsObjectArray=roleList.toArray();
  String[] roleListAsStrArray=Arrays.copyOf(roleListAsObjectArray,roleListAsObjectArray.length,String[].class);
  return (roleListAsStrArray);
}
Program: 34530
Project: 34530
Buggy source:
private static Provider getLongAdderProvider(){
  try {
    final JdkProvider jdkProvider=new JdkProvider();
    jdkProvider.get();
    return jdkProvider;
  }
 catch (  Throwable e) {
    return new InternalLongAdderProvider();
  }
}

Fixed version (ground truth):
private static Provider getLongAdderProvider(){
  return new InternalLongAdderProvider();
}
Program: 34531
Project: 34531
Buggy source:
/** 
 * Test that a FacesConverter, a FacesValidator and a FacesBehavior can be injected in a Managed Bean
 * @throws Exception
 */
@Test public void testConverterValidatorBehaviorObjectInjection() throws Exception {
  WebClient webClient=new WebClient();
  String contextRoot="String_Node_Str";
  URL url=JSFUtils.createHttpUrl(jsf23CDIServer,contextRoot,"String_Node_Str");
  HtmlPage page=(HtmlPage)webClient.getPage(url);
  Log.info(c,name.getMethodName(),page.asText());
  Log.info(c,name.getMethodName(),page.asXml());
  assertTrue(page.asText().contains("String_Node_Str"));
  assertTrue(page.asText().contains("String_Node_Str"));
  assertTrue(page.asText().contains("String_Node_Str"));
  assertTrue(page.asText().contains("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * Test that a FacesConverter, a FacesValidator and a FacesBehavior can be injected in a Managed Bean
 * @throws Exception
 */
@Test public void testConverterValidatorBehaviorObjectInjection() throws Exception {
  WebClient webClient=new WebClient();
  String contextRoot="String_Node_Str";
  URL url=JSFUtils.createHttpUrl(jsf23CDIServer,contextRoot,"String_Node_Str");
  HtmlPage page=(HtmlPage)webClient.getPage(url);
  Log.info(c,name.getMethodName(),page.asText());
  Log.info(c,name.getMethodName(),page.asXml());
  assertTrue(page.asText().contains("String_Node_Str"));
  assertTrue(page.asText().contains("String_Node_Str"));
}
Program: 34535
Project: 34535
Buggy source:
@Override public AuthenticationStatus notifyContainerAboutLogin(String callername,Set<String> groups){
  try {
    this.groups=Collections.unmodifiableSet(groups);
    Callback[] callbacks=new Callback[3];
    callbacks[0]=new CallerPrincipalCallback(clientSubject,callername);
    callbacks[1]=new GroupPrincipalCallback(clientSubject,groups.toArray(new String[]{}));
    handler.handle(callbacks);
  }
 catch (  Exception e) {
  }
  return AuthenticationStatus.SUCCESS;
}

Fixed version (ground truth):
@Override public AuthenticationStatus notifyContainerAboutLogin(String callername,Set<String> groups){
  try {
    this.groups=Collections.unmodifiableSet(groups);
    Callback[] callbacks=new Callback[2];
    callbacks[0]=new CallerPrincipalCallback(clientSubject,callername);
    callbacks[1]=new GroupPrincipalCallback(clientSubject,groups.toArray(new String[]{}));
    handler.handle(callbacks);
  }
 catch (  Exception e) {
  }
  return AuthenticationStatus.SUCCESS;
}
Program: 34536
Project: 34536
Buggy source:
public abstract SearchExpressionContextFactory getWrapped();

Fixed version (ground truth):
public SearchExpressionContextFactory getWrapped(){
  return this.delegate;
}
Program: 34537
Project: 34537
Buggy source:
protected void setMemberFactories(FaceletCache.MemberFactory<V> faceletFactory,FaceletCache.MemberFactory<V> viewMetadataFaceletFactory){
  if (faceletFactory == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (viewMetadataFaceletFactory == null) {
    throw new NullPointerException("String_Node_Str");
  }
  _faceletFactory=faceletFactory;
  _viewMetadataFaceletFactory=viewMetadataFaceletFactory;
}

Fixed version (ground truth):
@Deprecated protected void setMemberFactories(FaceletCache.MemberFactory<V> faceletFactory,FaceletCache.MemberFactory<V> viewMetadataFaceletFactory){
  if (faceletFactory == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (viewMetadataFaceletFactory == null) {
    throw new NullPointerException("String_Node_Str");
  }
  _faceletFactory=faceletFactory;
  _viewMetadataFaceletFactory=viewMetadataFaceletFactory;
}
Program: 34538
Project: 34538
Buggy source:
public CustomSearchExpressionContextFactory(SearchExpressionContextFactory wrapped){
  this.wrapped=wrapped;
}

Fixed version (ground truth):
public CustomSearchExpressionContextFactory(SearchExpressionContextFactory wrapped){
  super(wrapped);
  this.wrapped=wrapped;
}
Program: 34542
Project: 34542
Buggy source:
public JwtSsoTokenUtils(String consumer,AtomicServiceReference<TrustAssociationInterceptor> mpjwttaiserviceref){
  consumerId=consumer;
  mpjwttai=(MicroProfileJwtTAI)mpjwttaiserviceref.getService();
}

Fixed version (ground truth):
public JwtSsoTokenUtils(String consumer,AtomicServiceReference<TrustAssociationInterceptor> mpjwttaiserviceref){
  consumerId=consumer;
  TrustAssociationInterceptor service=mpjwttaiserviceref.getService();
  if (service instanceof MicroProfileJwtTAI) {
    mpjwttai=(MicroProfileJwtTAI)service;
  }
}
Program: 34546
Project: 34546
Buggy source:
/** 
 * Verify the following: <OL> <LI> An ear file that contains two war files. One war file contains two unprotected servlets, the other one contains one unprotected servlet. Each war files has one jar file. Test case tries to access unprotected servlet with invalid user. RunAs is expected to be called. </OL> <P> Expected Results: 200 OK and isCallerInRole(false). <OL> <LI> </OL>
 */
@Mode(TestMode.LITE) @Test public void testRunAsInvalidUserUnprotectedServletInRoleLDAPWar1() throws Exception {
  Log.info(logClass,getCurrentTestName(),"String_Node_Str" + getCurrentTestName());
  String queryString=EJB_WAR_PATH + RUNAS_SERVLET + "String_Node_Str";
  Log.info(logClass,getCurrentTestName(),"String_Node_Str");
  String response=executeGetRequestBasicAuthCreds(httpclient,urlBase + queryString,LocalLdapServer.INVALIDUSER,LocalLdapServer.PASSWORD,HttpServletResponse.SC_OK);
  Log.info(logClass,getCurrentTestName(),"String_Node_Str");
  Log.info(logClass,getCurrentTestName(),"String_Node_Str");
  verifyEjbRunAsUserResponse(response,Constants.ejb01Bean,Constants.getEjbBeanMethodName + Constants.ejbBeanMethodRunAsSpecified,Constants.getEjbCallerPrincipal + LocalLdapServer.INVALIDUSER,Constants.DB_USER2);
  Log.info(logClass,getCurrentTestName(),"String_Node_Str");
  Log.info(logClass,getCurrentTestName(),"String_Node_Str" + getCurrentTestName());
}

Fixed version (ground truth):
/** 
 * Verify the following: <OL> <LI> An ear file that contains two war files. One war file contains two unprotected servlets, the other one contains one unprotected servlet. Each war files has one jar file. Test case tries to access unprotected servlet with invalid user. RunAs is expected to be called. </OL> <P> Expected Results: 200 OK and isCallerInRole(false). <OL> <LI> </OL>
 */
@Mode(TestMode.LITE) @Test public void testRunAsInvalidUserUnprotectedServletInRoleLDAPWar1() throws Exception {
  Log.info(logClass,getCurrentTestName(),"String_Node_Str" + getCurrentTestName());
  String queryString=EJB_WAR_PATH + RUNAS_SERVLET + "String_Node_Str";
  Log.info(logClass,getCurrentTestName(),"String_Node_Str");
  String response=executeGetRequestBasicAuthCreds(httpclient,urlBase + queryString,LocalLdapServer.INVALIDUSER,LocalLdapServer.PASSWORD,HttpServletResponse.SC_OK);
  Log.info(logClass,getCurrentTestName(),"String_Node_Str");
  Log.info(logClass,getCurrentTestName(),"String_Node_Str");
  verifyEjbRunAsUserResponse(response,Constants.ejb01Bean,Constants.getEjbBeanMethodName + Constants.ejbBeanMethodRunAsSpecified,Constants.getEjbCallerPrincipal + Constants.DB_USER3,Constants.DB_USER2);
  Log.info(logClass,getCurrentTestName(),"String_Node_Str");
  Log.info(logClass,getCurrentTestName(),"String_Node_Str" + getCurrentTestName());
}
Program: 34547
Project: 34547
Buggy source:
/** 
 * Verify the following: <OL> <LI> An ear file that contains two war files. One war file contains two unprotected servlets, the other one contains one unprotected servlet. Each war files has one jar file. This test case uses EJB with the purpose of testing Basic Authentication with the use of LDAP and DB Identity Store. The user will try to authenticate as LDAPUser, authentication will suceed however the RunAs config will be picked up DB user will be used with employee access given. </OL> <P> Expected Results: 200 OK and isUserInRole(true). <OL> <LI> </OL>
 */
@Mode(TestMode.LITE) @Test public void testisRunAsUserInRoleLDAPtoDBWar1() throws Exception {
  Log.info(logClass,getCurrentTestName(),"String_Node_Str" + getCurrentTestName());
  String queryString=EJB_WAR_PATH + RUNAS_SERVLET + "String_Node_Str";
  Log.info(logClass,getCurrentTestName(),"String_Node_Str");
  String response=executeGetRequestBasicAuthCreds(httpclient,urlBase + queryString,LocalLdapServer.USER2,LocalLdapServer.PASSWORD,HttpServletResponse.SC_OK);
  Log.info(logClass,getCurrentTestName(),"String_Node_Str");
  Log.info(logClass,getCurrentTestName(),"String_Node_Str");
  verifyEjbRunAsUserResponse(response,Constants.ejb01Bean,Constants.getEjbBeanMethodName + Constants.ejbBeanMethodRunAsSpecified,Constants.getEjbCallerPrincipal + LocalLdapServer.USER2,Constants.DB_USER2);
  Log.info(logClass,getCurrentTestName(),"String_Node_Str");
  Log.info(logClass,getCurrentTestName(),"String_Node_Str" + getCurrentTestName());
}

Fixed version (ground truth):
/** 
 * Verify the following: <OL> <LI> An ear file that contains two war files. One war file contains two unprotected servlets, the other one contains one unprotected servlet. Each war files has one jar file. This test case uses EJB with the purpose of testing Basic Authentication with the use of LDAP and DB Identity Store. The user will try to authenticate as LDAPUser, authentication will succeed however the RunAs config will be picked up DB user will be used with employee access given. </OL> <P> Expected Results: 200 OK and isUserInRole(true). <OL> <LI> </OL>
 */
@Mode(TestMode.LITE) @Test public void testisRunAsUserInRoleLDAPtoDBWar1() throws Exception {
  Log.info(logClass,getCurrentTestName(),"String_Node_Str" + getCurrentTestName());
  String queryString=EJB_WAR_PATH + RUNAS_SERVLET + "String_Node_Str";
  Log.info(logClass,getCurrentTestName(),"String_Node_Str");
  String response=executeGetRequestBasicAuthCreds(httpclient,urlBase + queryString,LocalLdapServer.USER2,LocalLdapServer.PASSWORD,HttpServletResponse.SC_OK);
  Log.info(logClass,getCurrentTestName(),"String_Node_Str");
  Log.info(logClass,getCurrentTestName(),"String_Node_Str");
  verifyEjbRunAsUserResponse(response,Constants.ejb01Bean,Constants.getEjbBeanMethodName + Constants.ejbBeanMethodRunAsSpecified,Constants.getEjbCallerPrincipal + Constants.DB_USER3,Constants.DB_USER2);
  Log.info(logClass,getCurrentTestName(),"String_Node_Str");
  Log.info(logClass,getCurrentTestName(),"String_Node_Str" + getCurrentTestName());
}
Program: 34548
Project: 34548
Buggy source:
@BeforeClass public static void setUp() throws Exception {
  Log.info(logClass,"String_Node_Str","String_Node_Str");
  ldapServer=new LocalLdapServer();
  ldapServer.start();
  Log.info(logClass,"String_Node_Str","String_Node_Str");
  WCApplicationHelper.createWar(myServer,TEMP_DIR,EJB_WAR_NAME,true,EJB_BEAN_JAR_NAME,true,"String_Node_Str","String_Node_Str","String_Node_Str");
  WCApplicationHelper.createWar(myServer,TEMP_DIR,EJB_WAR_NAME2,true,EJB_BEAN_JAR_NAME,true,"String_Node_Str","String_Node_Str","String_Node_Str");
  WCApplicationHelper.packageWarsToEar(myServer,TEMP_DIR,EJB_EAR_NAME,true,EJB_WAR_NAME,EJB_WAR_NAME2);
  WCApplicationHelper.addEarToServerApps(myServer,TEMP_DIR,EJB_EAR_NAME);
  WCApplicationHelper.addWarToServerApps(myServer,"String_Node_Str",true,JAR_NAME,false,"String_Node_Str","String_Node_Str");
  Log.info(logClass,"String_Node_Str","String_Node_Str");
  startServer(XML_NAME,EJB_APP_NAME);
  assertNotNull("String_Node_Str",myServer.waitForStringInLog("String_Node_Str"));
}

Fixed version (ground truth):
@BeforeClass public static void setUp() throws Exception {
  Log.info(logClass,"String_Node_Str","String_Node_Str");
  ldapServer=new LocalLdapServer();
  ldapServer.start();
  Log.info(logClass,"String_Node_Str","String_Node_Str");
  WCApplicationHelper.createWar(myServer,TEMP_DIR,EJB_WAR_NAME,true,EJB_BEAN_JAR_NAME,true,"String_Node_Str","String_Node_Str","String_Node_Str");
  WCApplicationHelper.createWar(myServer,TEMP_DIR,EJB_WAR_NAME2,true,EJB_BEAN_JAR_NAME,true,"String_Node_Str","String_Node_Str","String_Node_Str");
  WCApplicationHelper.packageWarsToEar(myServer,TEMP_DIR,EJB_EAR_NAME,true,EJB_WAR_NAME,EJB_WAR_NAME2);
  WCApplicationHelper.addEarToServerApps(myServer,TEMP_DIR,EJB_EAR_NAME);
  WCApplicationHelper.addWarToServerApps(myServer,"String_Node_Str",true,JAR_NAME,false,"String_Node_Str","String_Node_Str");
  Log.info(logClass,"String_Node_Str","String_Node_Str");
  startServer(XML_NAME,EJB_APP_NAME);
}
Program: 34552
Project: 34552
Buggy source:
/** 
 * Verify the following: <OL> <LI> An ear file that contains two war files. One war file contains two servlets, the other one contains one servlet. Each war files has one jar file. This test case uses EJB with the purpose of testing Basic Authentication with DB Identity Store. The servlet for DB is designed to use RunAS. </OL> <P> Expected Results: 200 OK and isUserInRole(true). <OL> <LI> </OL>
 */
@Mode(TestMode.LITE) @Test public void testisUserInRoleDBWar1() throws Exception {
  Log.info(logClass,getCurrentTestName(),"String_Node_Str" + getCurrentTestName());
  String queryString=EJB_WAR_PATH + RUNAS_SERVLET + "String_Node_Str";
  Log.info(logClass,getCurrentTestName(),"String_Node_Str");
  String response=executeGetRequestBasicAuthCreds(httpclient,urlBase + queryString,Constants.DB_USER1,Constants.DB_USER1_PWD,HttpServletResponse.SC_OK);
  Log.info(logClass,getCurrentTestName(),"String_Node_Str");
  Log.info(logClass,getCurrentTestName(),"String_Node_Str");
  verifyEjbUserResponse(response,Constants.getEJBBeanResponse + Constants.ejb03Bean,Constants.getEjbBeanMethodName + Constants.ejbBeanMethodManager,Constants.getEjbCallerPrincipal + Constants.DB_USER1);
  Log.info(logClass,getCurrentTestName(),"String_Node_Str");
  Log.info(logClass,getCurrentTestName(),"String_Node_Str" + getCurrentTestName());
}

Fixed version (ground truth):
/** 
 * Verify the following: <OL> <LI> An ear file that contains two war files. One war file contains two servlets, the other one contains one servlet. Each war files has one jar file. This test case uses EJB with the purpose of testing Basic Authentication with DB Identity Store. The servlet for DB is designed to use RunAS. </OL> <P> Expected Results: 200 OK and isUserInRole(true). <OL> <LI> </OL>
 */
public void testisUserInRoleDBWar1() throws Exception {
  Log.info(logClass,getCurrentTestName(),"String_Node_Str" + getCurrentTestName());
  String queryString=EJB_WAR_PATH + RUNAS_SERVLET + "String_Node_Str";
  Log.info(logClass,getCurrentTestName(),"String_Node_Str");
  String response=executeGetRequestBasicAuthCreds(httpclient,urlBase + queryString,Constants.DB_USER1,Constants.DB_USER1_PWD,HttpServletResponse.SC_OK);
  Log.info(logClass,getCurrentTestName(),"String_Node_Str");
  Log.info(logClass,getCurrentTestName(),"String_Node_Str");
  verifyEjbUserResponse(response,Constants.getEJBBeanResponse + Constants.ejb03Bean,Constants.getEjbBeanMethodName + Constants.ejbBeanMethodManager,Constants.getEjbCallerPrincipal + Constants.DB_USER1);
  Log.info(logClass,getCurrentTestName(),"String_Node_Str");
  Log.info(logClass,getCurrentTestName(),"String_Node_Str" + getCurrentTestName());
}
Program: 34553
Project: 34553
Buggy source:
protected void verifyEjbUserResponse(String response,String ejbBean,String ejbBeanMethod,String getEjbUserPrincipal){
  Log.info(logClass,"String_Node_Str","String_Node_Str" + ejbBean + "String_Node_Str"+ ejbBeanMethod+ "String_Node_Str"+ getEjbUserPrincipal);
  mustContain(response,ejbBean);
  mustContain(response,ejbBeanMethod);
  mustContain(response,getEjbUserPrincipal);
}

Fixed version (ground truth):
protected void verifyEjbUserResponse(String response,String ejbBean,String ejbBeanMethod,String getEjbRemoteUser){
  Log.info(logClass,"String_Node_Str","String_Node_Str" + ejbBean + "String_Node_Str"+ ejbBeanMethod+ "String_Node_Str"+ getEjbRemoteUser);
  mustContain(response,ejbBean);
  mustContain(response,ejbBeanMethod);
  mustContain(response,getEjbRemoteUser);
}
Program: 34554
Project: 34554
Buggy source:
@Override protected SecurityContext getSecurityContext(){
  return null;
}

Fixed version (ground truth):
@Override protected SecurityContext getSecurityContext(){
  return securityContext;
}
Program: 34555
Project: 34555
Buggy source:
@BeforeClass public static void setUp() throws Exception {
  appA=new SessionCacheApp(serverA,true,"String_Node_Str");
  appB=new SessionCacheApp(serverB,true,"String_Node_Str","String_Node_Str","String_Node_Str");
  serverB.useSecondaryHTTPPort();
  String hazelcastConfigFile="String_Node_Str";
  if (FATSuite.isMulticastDisabled()) {
    Log.info(SessionCacheTwoServerTest.class,"String_Node_Str","String_Node_Str");
    hazelcastConfigFile="String_Node_Str";
  }
  String configLocation=new File(serverB.getUserDir() + "String_Node_Str" + hazelcastConfigFile).getAbsolutePath();
  String rand=UUID.randomUUID().toString();
  serverA.setJvmOptions(Arrays.asList("String_Node_Str" + rand,"String_Node_Str" + hazelcastConfigFile));
  serverB.setJvmOptions(Arrays.asList("String_Node_Str" + rand,"String_Node_Str" + configLocation));
  serverA.startServer();
  serverB.startServer();
}

Fixed version (ground truth):
@BeforeClass public static void setUp() throws Exception {
  appA=new SessionCacheApp(serverA,true,"String_Node_Str");
  appB=new SessionCacheApp(serverB,true,"String_Node_Str","String_Node_Str","String_Node_Str");
  serverB.useSecondaryHTTPPort();
  String hazelcastConfigFile="String_Node_Str";
  if (FATSuite.isMulticastDisabled()) {
    Log.info(SessionCacheTwoServerTest.class,"String_Node_Str","String_Node_Str");
    hazelcastConfigFile="String_Node_Str";
  }
  String configLocation=new File(serverB.getUserDir() + "String_Node_Str" + hazelcastConfigFile).getAbsolutePath();
  String rand=UUID.randomUUID().toString();
  serverA.setJvmOptions(Arrays.asList("String_Node_Str" + rand,"String_Node_Str" + hazelcastConfigFile));
  serverB.setJvmOptions(Arrays.asList("String_Node_Str" + rand,"String_Node_Str" + configLocation));
  serverA.startServer();
  List<String> sessionA=new ArrayList<>();
  appA.sessionPut("String_Node_Str","String_Node_Str",sessionA,true);
  appA.invalidateSession(sessionA);
  serverB.startServer();
}
Program: 34556
Project: 34556
Buggy source:
/** 
 * Configure httpSessionCache pointing at a library that lacks a valid JCache provider. Access a session before and after, verifying that a session attribute added afterward is persisted, whereas a session attribute added before is not.
 */
@AllowedFFDC(value={"String_Node_Str","String_Node_Str"}) @Test public void testLibraryWithoutJCacheProvider() throws Exception {
  ServerConfiguration config=savedConfig.clone();
  Library libraryWithoutJCacheProvider=new Library();
  libraryWithoutJCacheProvider.setId("String_Node_Str");
  File libraryWithoutJCacheProvider_file=new File();
  libraryWithoutJCacheProvider_file.setName("String_Node_Str");
  libraryWithoutJCacheProvider.setFile(libraryWithoutJCacheProvider_file);
  config.getLibraries().add(libraryWithoutJCacheProvider);
  config.getHttpSessionCaches().get(0).setLibraryRef("String_Node_Str");
  server.updateServerConfiguration(config);
  server.startServer(testName.getMethodName() + "String_Node_Str");
  try {
    List<String> session=new ArrayList<>();
    run("String_Node_Str",session);
    server.setMarkToEndOfLog();
    server.updateServerConfiguration(savedConfig);
    server.waitForConfigUpdateInLogUsingMark(APP_NAMES,EMPTY_RECYCLE_LIST);
    session=new ArrayList<>();
    run("String_Node_Str",session);
    run("String_Node_Str",session);
    run("String_Node_Str",session);
  }
  finally {
    server.stopServer("String_Node_Str","String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Configure httpSessionCache pointing at a library that lacks a valid JCache provider. Access a session before and after, verifying that a session attribute added afterward is persisted, whereas a session attribute added before is not.
 */
@AllowedFFDC(value={"String_Node_Str","String_Node_Str"}) @Test public void testLibraryWithoutJCacheProvider() throws Exception {
  ServerConfiguration config=savedConfig.clone();
  Library libraryWithoutJCacheProvider=new Library();
  libraryWithoutJCacheProvider.setId("String_Node_Str");
  File libraryWithoutJCacheProvider_file=new File();
  libraryWithoutJCacheProvider_file.setName("String_Node_Str");
  libraryWithoutJCacheProvider.setFile(libraryWithoutJCacheProvider_file);
  config.getLibraries().add(libraryWithoutJCacheProvider);
  config.getHttpSessionCaches().get(0).setLibraryRef("String_Node_Str");
  server.updateServerConfiguration(config);
  server.startServer(testName.getMethodName() + "String_Node_Str");
  try {
    List<String> session=new ArrayList<>();
    run("String_Node_Str",session);
    server.setMarkToEndOfLog();
    server.updateServerConfiguration(savedConfig);
    server.waitForConfigUpdateInLogUsingMark(APP_NAMES,EMPTY_RECYCLE_LIST);
    session=new ArrayList<>();
    run("String_Node_Str",session);
    run("String_Node_Str",session);
    run("String_Node_Str",session);
  }
  finally {
    server.stopServer("String_Node_Str","String_Node_Str","String_Node_Str");
  }
}
Program: 34557
Project: 34557
Buggy source:
/** 
 * Configure httpSessionCache lacking a libraryRef (or bell). Access a session before and after, verifying that a session attribute added afterward is persisted, whereas a session attribute added before is not (the OSGi service backing httpSessionCache config will be unable to activate in the absence of libraryRef).
 */
@AllowedFFDC("String_Node_Str") @Test public void testMissingLibraryRef() throws Exception {
  ServerConfiguration config=savedConfig.clone();
  config.getHttpSessionCaches().get(0).setLibraryRef(null);
  server.updateServerConfiguration(config);
  server.startServer(testName.getMethodName() + "String_Node_Str");
  assertEquals(1,server.findStringsInLogs("String_Node_Str").size());
  List<String> session=new ArrayList<>();
  run("String_Node_Str",session);
  server.setMarkToEndOfLog();
  server.updateServerConfiguration(savedConfig);
  server.waitForConfigUpdateInLogUsingMark(APP_NAMES,EMPTY_RECYCLE_LIST);
  run("String_Node_Str",session);
  run("String_Node_Str",session);
  run("String_Node_Str",session);
  run("String_Node_Str",session);
}

Fixed version (ground truth):
/** 
 * Configure httpSessionCache lacking a libraryRef (or bell). Access a session before and after, verifying that a session attribute added afterward is persisted, whereas a session attribute added before is not (the OSGi service backing httpSessionCache config will be unable to activate in the absence of libraryRef).
 */
@AllowedFFDC("String_Node_Str") @Test public void testMissingLibraryRef() throws Exception {
  try {
    LibertyServer.setValidateApps(false);
    ServerConfiguration config=savedConfig.clone();
    config.getHttpSessionCaches().get(0).setLibraryRef(null);
    server.updateServerConfiguration(config);
    server.startServer(testName.getMethodName() + "String_Node_Str");
    assertEquals(1,server.findStringsInLogs("String_Node_Str").size());
    List<String> session=new ArrayList<>();
    server.setMarkToEndOfLog();
    server.updateServerConfiguration(savedConfig);
    server.waitForConfigUpdateInLogUsingMark(APP_NAMES,EMPTY_RECYCLE_LIST);
    run("String_Node_Str",session);
    run("String_Node_Str",session);
    run("String_Node_Str",session);
  }
  finally {
    if (server.isStarted())     server.stopServer("String_Node_Str");
    LibertyServer.setValidateApps(true);
  }
}
Program: 34558
Project: 34558
Buggy source:
@AllowedFFDC(value={"String_Node_Str","String_Node_Str"}) @Test public void testModifyFileset() throws Exception {
  ServerConfiguration config=server.getServerConfiguration();
  com.ibm.websphere.simplicity.config.File hazelcastFile=config.getLibraries().getById("String_Node_Str").getNestedFile();
  String originalName=hazelcastFile.getName();
  server.startServer(testName.getMethodName() + "String_Node_Str");
  List<String> session=new ArrayList<>();
  run("String_Node_Str",session);
  run("String_Node_Str",session);
  hazelcastFile.setName("String_Node_Str");
  server.setMarkToEndOfLog();
  server.updateServerConfiguration(config);
  server.waitForConfigUpdateInLogUsingMark(APP_NAMES);
  run("String_Node_Str",session);
  hazelcastFile.setName(originalName);
  server.setMarkToEndOfLog();
  server.updateServerConfiguration(config);
  server.waitForConfigUpdateInLogUsingMark(APP_NAMES);
  run("String_Node_Str",session);
  run("String_Node_Str",session);
  server.stopServer("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@AllowedFFDC(value={"String_Node_Str","String_Node_Str"}) @Test public void testModifyFileset() throws Exception {
  ServerConfiguration config=server.getServerConfiguration();
  com.ibm.websphere.simplicity.config.File hazelcastFile=config.getLibraries().getById("String_Node_Str").getNestedFile();
  String originalName=hazelcastFile.getName();
  server.startServer(testName.getMethodName() + "String_Node_Str");
  List<String> session=new ArrayList<>();
  run("String_Node_Str",session);
  run("String_Node_Str",session);
  hazelcastFile.setName("String_Node_Str");
  server.setMarkToEndOfLog();
  server.updateServerConfiguration(config);
  server.waitForConfigUpdateInLogUsingMark(APP_NAMES);
  run("String_Node_Str",session);
  hazelcastFile.setName(originalName);
  server.setMarkToEndOfLog();
  server.updateServerConfiguration(config);
  server.waitForConfigUpdateInLogUsingMark(APP_NAMES);
  run("String_Node_Str",session);
  run("String_Node_Str",session);
  server.stopServer("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
}
Program: 34560
Project: 34560
Buggy source:
public static void handleExtensions(KeyValuePairList extensions,String extKey,String extValue){
  extKey=LogFieldConstants.EXT_PREFIX + extKey;
  if (extKey.indexOf('_',extKey.length() - 6) != -1) {
    if (extKey.endsWith(CollectorJsonHelpers.INT_SUFFIX)) {
      try {
        extensions.addPair(extKey,Integer.parseInt(extValue));
      }
 catch (      NumberFormatException e) {
      }
    }
 else     if (extKey.endsWith(CollectorJsonHelpers.FLOAT_SUFFIX)) {
      try {
        extensions.addPair(extKey,Float.parseFloat(extValue));
      }
 catch (      NumberFormatException e) {
      }
    }
 else     if (extKey.endsWith(CollectorJsonHelpers.BOOL_SUFFIX)) {
      if (extValue.toLowerCase().trim().equals(TRUE_BOOL)) {
        extensions.addPair(extKey,true);
      }
 else       if (extValue.toLowerCase().trim().equals(FALSE_BOOL)) {
        extensions.addPair(extKey,false);
      }
    }
 else     if (extKey.endsWith(CollectorJsonHelpers.LONG_SUFFIX)) {
      try {
        extensions.addPair(extKey,Long.parseLong(extValue));
      }
 catch (      NumberFormatException e) {
      }
    }
  }
 else {
    extensions.addPair(extKey,extValue);
  }
}

Fixed version (ground truth):
public static void handleExtensions(KeyValuePairList extensions,String extKey,String extValue){
  extKey=LogFieldConstants.EXT_PREFIX + extKey;
  if (extKey.indexOf('_',4) != -1) {
    if (extKey.endsWith(CollectorJsonHelpers.INT_SUFFIX)) {
      try {
        extensions.addPair(extKey,Integer.parseInt(extValue));
      }
 catch (      NumberFormatException e) {
      }
    }
 else     if (extKey.endsWith(CollectorJsonHelpers.FLOAT_SUFFIX)) {
      try {
        extensions.addPair(extKey,Float.parseFloat(extValue));
      }
 catch (      NumberFormatException e) {
      }
    }
 else     if (extKey.endsWith(CollectorJsonHelpers.BOOL_SUFFIX)) {
      if (extValue.toLowerCase().trim().equals(TRUE_BOOL)) {
        extensions.addPair(extKey,true);
      }
 else       if (extValue.toLowerCase().trim().equals(FALSE_BOOL)) {
        extensions.addPair(extKey,false);
      }
    }
 else     if (extKey.endsWith(CollectorJsonHelpers.LONG_SUFFIX)) {
      try {
        extensions.addPair(extKey,Long.parseLong(extValue));
      }
 catch (      NumberFormatException e) {
      }
    }
  }
 else {
    extensions.addPair(extKey,extValue);
  }
}
Program: 34565
Project: 34565
Buggy source:
/** 
 * Test method for   {@link com.ibm.ws.security.intfc.internal.UserRegistryWrapper#mapCertificate(java.security.cert.X509Certificate[])}.
 */
@Test public void mapCertificate() throws Exception {
  mock.checking(new Expectations(){
{
      one(wrappedUr).mapCertificate(CERT);
      will(returnValue(NAME));
    }
  }
);
  X509Certificate[] certs=new X509Certificate[]{CERT};
  assertEquals("String_Node_Str",NAME,wrapper.mapCertificate(certs));
}

Fixed version (ground truth):
/** 
 * Test method for   {@link com.ibm.ws.security.intfc.internal.UserRegistryWrapper#mapCertificate(java.security.cert.X509Certificate[])}.
 */
@Test public void mapCertificate() throws Exception {
  final X509Certificate[] certs=new X509Certificate[]{CERT};
  mock.checking(new Expectations(){
{
      one(wrappedUr).mapCertificate(certs);
      will(returnValue(NAME));
    }
  }
);
  assertEquals("String_Node_Str",NAME,wrapper.mapCertificate(certs));
}
Program: 34566
Project: 34566
Buggy source:
/** 
 * Test method for   {@link com.ibm.ws.security.intfc.internal.UserRegistryWrapper#mapCertificate(java.security.cert.X509Certificate[])}.
 */
@Test(expected=CustomRegistryException.class) public void mapCertificate_RegistryException() throws Exception {
  mock.checking(new Expectations(){
{
      one(wrappedUr).mapCertificate(CERT);
      will(throwException(new com.ibm.ws.security.registry.RegistryException("String_Node_Str")));
    }
  }
);
  X509Certificate[] certs=new X509Certificate[]{CERT};
  wrapper.mapCertificate(certs);
}

Fixed version (ground truth):
/** 
 * Test method for   {@link com.ibm.ws.security.intfc.internal.UserRegistryWrapper#mapCertificate(java.security.cert.X509Certificate[])}.
 */
@Test(expected=CustomRegistryException.class) public void mapCertificate_RegistryException() throws Exception {
  final X509Certificate[] certs=new X509Certificate[]{CERT};
  mock.checking(new Expectations(){
{
      one(wrappedUr).mapCertificate(certs);
      will(throwException(new com.ibm.ws.security.registry.RegistryException("String_Node_Str")));
    }
  }
);
  wrapper.mapCertificate(certs);
}
Program: 34567
Project: 34567
Buggy source:
/** 
 * Test method for   {@link com.ibm.ws.security.intfc.internal.UserRegistryWrapper#mapCertificate(java.security.cert.X509Certificate[])}.
 */
@Test(expected=CertificateMapNotSupportedException.class) public void mapCertificate_CertificateMapNotSupportedException() throws Exception {
  mock.checking(new Expectations(){
{
      one(wrappedUr).mapCertificate(CERT);
      will(throwException(new com.ibm.ws.security.registry.CertificateMapNotSupportedException("String_Node_Str")));
    }
  }
);
  X509Certificate[] certs=new X509Certificate[]{CERT};
  wrapper.mapCertificate(certs);
}

Fixed version (ground truth):
/** 
 * Test method for   {@link com.ibm.ws.security.intfc.internal.UserRegistryWrapper#mapCertificate(java.security.cert.X509Certificate[])}.
 */
@Test(expected=CertificateMapNotSupportedException.class) public void mapCertificate_CertificateMapNotSupportedException() throws Exception {
  final X509Certificate[] certs=new X509Certificate[]{CERT};
  mock.checking(new Expectations(){
{
      one(wrappedUr).mapCertificate(certs);
      will(throwException(new com.ibm.ws.security.registry.CertificateMapNotSupportedException("String_Node_Str")));
    }
  }
);
  wrapper.mapCertificate(certs);
}
Program: 34568
Project: 34568
Buggy source:
/** 
 * Test method for   {@link com.ibm.ws.security.intfc.internal.UserRegistryWrapper#mapCertificate(java.security.cert.X509Certificate[])}.
 */
@Test(expected=CertificateMapFailedException.class) public void mapCertificate_failed() throws Exception {
  mock.checking(new Expectations(){
{
      one(wrappedUr).mapCertificate(CERT);
      will(throwException(new com.ibm.ws.security.registry.CertificateMapFailedException("String_Node_Str")));
    }
  }
);
  X509Certificate[] certs=new X509Certificate[]{CERT};
  wrapper.mapCertificate(certs);
}

Fixed version (ground truth):
/** 
 * Test method for   {@link com.ibm.ws.security.intfc.internal.UserRegistryWrapper#mapCertificate(java.security.cert.X509Certificate[])}.
 */
@Test(expected=CertificateMapFailedException.class) public void mapCertificate_failed() throws Exception {
  final X509Certificate[] certs=new X509Certificate[]{CERT};
  mock.checking(new Expectations(){
{
      one(wrappedUr).mapCertificate(certs);
      will(throwException(new com.ibm.ws.security.registry.CertificateMapFailedException("String_Node_Str")));
    }
  }
);
  wrapper.mapCertificate(certs);
}