Program: 34549
Project: 34549
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. In this test case the following configuration will be used. 1. WAR 1 will use the LDAP Identity Store. 2. WAR 2 will use the LDAP2 Identity Store. </OL> <P> Multiple results are expected. <OL> <LI> </OL>
 */
@Mode(TestMode.LITE) @Test public void testEJBAppSecurity30() throws Exception {
  String response;
  String queryString;
  Log.info(logClass,getCurrentTestName(),"String_Node_Str" + getCurrentTestName());
  Log.info(logClass,getCurrentTestName(),"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","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","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,getCurrentTestName(),"String_Node_Str");
  Log.info(logClass,getCurrentTestName(),"String_Node_Str");
  startServer(XML_NAME,EJB_APP_NAME);
  assertNotNull("String_Node_Str",myServer.waitForStringInLog("String_Node_Str"));
  Log.info(logClass,getCurrentTestName(),"String_Node_Str");
  queryString=EJB_WAR_PATH + SIMPLE_SERVLET + "String_Node_Str";
  Log.info(logClass,getCurrentTestName(),"String_Node_Str");
  response=executeGetRequestBasicAuthCreds(httpclient,urlBase + queryString,LocalLdapServer.USER1,LocalLdapServer.PASSWORD,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 + LocalLdapServer.USER1);
  Log.info(logClass,getCurrentTestName(),"String_Node_Str");
  Log.info(logClass,getCurrentTestName(),"String_Node_Str");
  myServer.removeInstalledAppForValidation(EJB_APP_NAME);
  myServer.stopServer();
  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. In this test case the following configuration will be used. 1. WAR 1 will use the LDAP Identity Store. 2. WAR 2 will use the LDAP2 Identity Store. </OL> <P> Multiple results are expected. <OL> <LI> </OL>
 */
@Mode(TestMode.LITE) @Test public void testEJBAppSecurity30() throws Exception {
  String response;
  String queryString;
  Log.info(logClass,getCurrentTestName(),"String_Node_Str" + getCurrentTestName());
  Log.info(logClass,getCurrentTestName(),"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","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","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");
  Log.info(logClass,getCurrentTestName(),"String_Node_Str");
  startServer(XML_NAME,EJB_APP_NAME);
  Log.info(logClass,getCurrentTestName(),"String_Node_Str");
  queryString=EJB_WAR_PATH + SIMPLE_SERVLET + "String_Node_Str";
  Log.info(logClass,getCurrentTestName(),"String_Node_Str");
  response=executeGetRequestBasicAuthCreds(httpclient,urlBase + queryString,LocalLdapServer.USER1,LocalLdapServer.PASSWORD,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 + LocalLdapServer.USER1);
  Log.info(logClass,getCurrentTestName(),"String_Node_Str");
  Log.info(logClass,getCurrentTestName(),"String_Node_Str");
  myServer.removeInstalledAppForValidation(EJB_APP_NAME);
  myServer.stopServer();
  Log.info(logClass,getCurrentTestName(),"String_Node_Str" + getCurrentTestName());
}