Load test FileNet Content Engine using IBM Rational Performance Tester

This article explains how to configure IBM Rational Performance Tester to load test document editing functionality of the IBM FileNet Content Engine. This approach is based on the learning from a customer benchmark that targeted large volumes of content, where Rational Performance Tester was used for the first time to simulate document editing functionality. This article is particularly useful to software developers and testers who are trying to evaluate FileNet Content Engine performance.

Share:

Venumadhav Vanagondi (venu.madhav@in.ibm.com), Software Performance Analyst, IBM

Photo of Venumadhav VanagondiVenumadhav Vanagondi has more than five years of experience as a software performance analyst. He has worked with several IBM customers in resolving performance problems and is proficient in using performance estimation, testing, and monitoring tools. He holds a master's degree in computer science from the Indian Institute of Technology Madras.



Sanjay Singh (sksingh6@in.ibm.com), Senior Software Architect, IBM

Photo of Sanjay SinghSanjay Singh has around 12 years of experience in designing and developing high-performance, scalable enterprise software in content management, telecom, and finance. He has been with IBM for last five years and is a senior member of the ECM team in the IBM India Software Lab. Sanjay has a B. Tech. degree from the Indian Institute of Technology Kanpur.



Sandeep Vedula (vedsande@in.ibm.com), Associate Software Engineer, IBM

Photo of Sandeep VedulaSandeep Vedula has around three years of experience in software development in content management, online learning, and supply chain management. He has been with IBM for the last two years, on the ECM team. Sandeep has a master’s degree in artificial intelligence from Central University, Hyderabad.



17 January 2012

Also available in Chinese Russian

Introduction to the process

IBM® FileNet® P8 software helps enterprises in storage and retrieval of content, business process automation and case management. FileNet Content Engine is the core component of the IBM FileNet ECM suite for enterprise-level content management. Of the many tasks that the FileNet P8 system performs, it works as a very robust document management system. A user interacts with FileNet Content Engine through Workplace, a Java Enterprise Edition (JEE) application that provides a web interface to the FileNet Content Engine.

In content management systems, document editing is one of the primary tasks. In the FileNet Content Engine, editing is performed through the following sequence of actions:

  1. Check out the document to a local file system from the server (analogous to document download).
  2. Edit and save the document using a document editor locally.
  3. Check the document back in to the Content Engine server (analogous to document upload).

In a content management system, check-in and checkout activity constitutes the bulk of the load on the system. Therefore, testing FileNet Content Engine for document check-in and checkout activity becomes critical in assessing the overall performance of the system.

In this article, we describe a method that configures IBM® Rational® Performance Tester to load-test FileNet P8 Content Engine.

The following steps are involved in configuring Rational Performance Tester for load testing the document editing process of the FileNet P8 Content Engine.

  1. Create the test script.
  2. Set test script parameters to add variability to the load test.
  3. Modify the test script for correct execution.
  4. Create a schedule and running the load test.

The sections that follow describe these steps in detail.


Create the test script

Create a test script in Rational Performance Tester:

  1. Open the Rational Performance Tester workbench.
  2. Create a new performance test project.

After creating the project, you will be prompted to create a new test script from a recording.

  1. In the pop-up window, select RPT HTTP Recording as the recorder type. Give an appropriate name to the test, and start the recording.

Rational Performance Tester will open the default browser, Microsoft Internet Explorer, to capture the requests.

  1. Access the Workplace application, perform the required actions in the browser, and stop recording by closing the browser.

This will generate the test script with the HTTP requests corresponding to these actions.

Tip:
Be sure to give meaningful names to HTTP requests in the test script. From Rational Performance Tester v8.1 onward, you can use the icon (white page with blue pencil, circled in Figure 1) in the Recorder Test Annotation toolbar to give appropriate names to requests while recording a test script.

Figure 1. Recorder Test Annotation toolbar
Toolbar view in Internet Explorer

Note:
Capture the actions related to checkout and check-in operations in the same test script. This approach makes it easier to incorporate the scripting logic that will ensure that a user is allowed to perform only a check-in operation on a document that he has already checked out.

The following actions should be carried out while recording the test script in Rational Performance Tester:

  1. Access Workplace by typing the relevant URL in the browser, for example:
    http://testhost:9080/Workplace
  2. Log in to Workplace with the relevant user credentials.
  3. Go to the folder containing the documents by selecting the relevant object store from the home page.
  4. To check out a document, select it and right-click to access the operations menu, and select the Check Out operation.
  5. In the new browser window that opens, download the checked-out document and close the window.
  6. Edit the downloaded document.
  7. To check in the modified document, select the checked-out document, right-click to access the operations menu, and select the Check In operation.
  8. In the check-in wizard that opens, perform these actions:
    1. In the Set Properties step, enable check-in as the major version and use the default values for all other properties.
    2. In the Set Security step, use the default security policies.
    3. In the Select File step, use the Local File option to browse and locate the modified document, and then click Finish.
    4. Click OK to confirm the changes. This will close the wizard and check in the document.
  9. Log out of Workplace.

Set test script parameters

You need to vary the version series ID in the checkout request to enable the test script to work with different documents.

The latest version of the document is always the one checked out. The test script will use the version series ID as a reference rather than the latest document version. The FileNet P8 Content Engine changes the reference from the version series ID to the latest doc version, and then checks that document out.

  1. Create a data pool in Rational Performance Tester with the version series IDs of different documents in the respective folder and object store.
  2. You can use the Java code snippet in Listing 1 to retrieve these values from the respective document objects by using the FileNet P8 Content Engine client API.
Listing 1. Code to retrieve the version series IDs
public Connection getConnection(String host, String port){
        //Build the FileNet connection URL
String filenetUrl = "http://" + host + ":" + port + "/wsi/FNCEWS40MTOM/";

 //Return the Connection to the caller 
 return Factory.Connection.getConnection(filenetUrl);
}

public void getDocAttributes(String host, String port, String userid,
 String passwd, String objStoreName, String folderPath)
{

 //FileNet P8 Admin user name and password
 String userName = userid;
 String password = passwd;
 boolean userPushed = false;

 try{
 /* Establish connection with the FileNet P8 Content Engine Server based
 * on host and port details
 */
 Connection conn = getConnection(host,port);
 Subject loginUser = UserContext.createSubject(conn,userName,
 password,"FileNetP8WSI");
 UserContext.get().pushSubject(loginUser);
 userPushed = true;

 //Access the Domain and ObjectStore information
 Domain gcd = Factory.Domain.fetchInstance(conn,null,null);
 String domainName = gcd.get_Name();
 ObjectStore objStore = Factory.ObjectStore.fetchInstance(gcd,objStoreName, null);

 /* Fetch the folder object that contains the documents
 * Get the document set in the folder and iterate
 */
 Folder folder = Factory.Folder.fetchInstance(objStore, folderPath, null);
 DocumentSet docSet = folder.get_ContainedDocuments();
 Iterator iter = docSet.iterator();
 Document currentDoc = null;
 String docTitle = null;
 String docId = null;
 String docVersionId = null;
 int majorVersion = -1;
 int minorVersion = -1;
 int versionStatus = -1;
 Versionable currentVersion = null;

 // versionid represents the version series id 
 System.out.println("doctitle,docid,versionid,majorversion,minorversion,
 versionstatus");

 //Retrieve the document properties from the current document object
 while (iter.hasNext()){
 currentDoc = (Document)iter.next();
 docTitle = currentDoc.get_Name();
 docId = currentDoc.get_Id().toString();
 currentVersion = currentDoc.get_CurrentVersion();
 majorVersion = currentVersion.get_MajorVersionNumber();
 minorVersion = currentVersion.get_MinorVersionNumber();
 docVersionId = currentVersion.get_VersionSeries().get_Id().toString();
 versionStatus = currentVersion.get_VersionStatus().getValue();
 System.out.println(docTitle + "," + docId + "," + docVersionId + ","+ 
 majorVersion + "," + minorVersion + "," + versionStatus);
 }
 }finally{
 if(userPushed)
 UserContext.get().popSubject();
 }
}

Figure 2 shows the checkout request in the test script that contains the version series ID.

Figure 2. Checkout request with the version series ID
jatarang.in.ibm.com:9080/Workplace/ooperations/...

In the checkout request, the vsId variable represents the version series ID (see Figure 3 the checkout request details).

  1. Substitute the value of this variable with the data pool that contains the version series IDs of different documents.
Figure 3. Checkout request details
Variable substitution in the checkout request

Tip:
To add more variation to the load tests, you can vary the values for user credentials, object store, and folder-related details in the test script.


Modify the test script

The check-in operation is always carried out on the reservation version of the document (The reservation version indicates a checked-out but not yet checked in version of a document.) For the check-in operation to work correctly, the document ID of the checked-out document should be used as an input to the check-in request. To ensure this, you can use the custom code feature in Rational Performance Tester to parse and retrieve the document ID from a URL in the response of the checkout request.

In the test script, the response of the checkout request that contains the argument to custom code is shown in Figure 4.

Figure 4. Checkout response containing the argument to the custom code
Response with argument to custom code

Listing 2 shows the URL that contains the document ID of the recently checked-out document in the response of the checkout request. This URL should be passed as an argument to the custom code.

Listing 2. URL details

http://jaltarang.in.ibm.com:9080/Workplace/getContent?mode=download&objectType=document&id={753DFAA1-3EE5-4C44-89E3-51DEFFB7E371}&objectStoreName=mcs1db2&returnUrl=http%3A%2F%2Fjaltarang.in.ibm.com%3A9080%2FWorkplace%2FWcmCloseWindow.jsp%3Fop%3Dcheckout%26refreshUrl%3Dhttp%253A%2F%2Fjaltarang.in.ibm.com%253A9080%2FWorkplace%2FBrowse.jsp%253FwindowId%253DmainWindow%26eventName%3DStateChanged

Listing 3 shows the custom code snippet to parse and retrieve the document ID.

Listing 3. Code to parse and retrieve the document ID
public String exec(ITestExecutionServices tes, String[] args)
{
 int startIndex = args[0].indexOf("id=") + 3;
 int endIndex = startIndex + 38;
 tes.getTestLogManager().reportMessage(args[0].substring(startIndex,endIndex));
 return args[0].substring(startIndex,endIndex);
}

The check-in request in the test script that contains the document ID is shown in Figure 5.

Figure 5. Check-in request with the document ID
Request in the test script with document ID

In the check-in request, the id variable represents the document ID (see Figure 6). The value of this variable should be substituted with the value returned by the custom code.

Figure 6. Check-in request details
Variable substitution in check-in request

Note:
To add more variety to the load tests, you can also vary the content of the document that gets checked in. Rational Performance Tester v8.1.1 and later has a built-in functionality to do this. See the IBM TechNote titled "Rational Performance Tester: Substituting request content from a file" (cited in the Resources section) for more information.


Create a schedule and run the load test

  1. After modifying the test script, create a schedule in Rational Performance Tester.
  2. Add the test script to this schedule.
  3. Specify the required number of users and the ramp-up rate, and run the test for the required duration.

Important:

It is important to run the cancel checkout operation on all of the relevant documents after running a load test. In most of the scenarios, when a load test finishes, the majority of virtual users would have exited without performing all of the actions in the test script. This results in a lot of documents being in the checked-out state. The next iteration of the load test will report a lot of errors if this clean-up activity is not carried out. You can use the Java code snippet shown in Listing 4 to automate running the cancel checkout operation on the documents.

Listing 4. Code to automate the cancel checkout operation
public void deleteReservation(String host, String port, String userid,
 String passwd, String objStoreName, String folderPath)
{
 //FileNet P8 Admin user name and password
 String userName = userid;
 String password = passwd;
 boolean userPushed = false;

 try{
 /* Establish Connection with the FileNet P8 Content Engine Server
 * based on host and port details
 */
 Connection conn = getConnection(host,port);
 Subject loginUser = UserContext.createSubject(conn,userName,
 password,"FileNetP8WSI");
 UserContext.get().pushSubject(loginUser);
 userPushed = true;

 Domain gcd = Factory.Domain.fetchInstance(conn,null,null);
 String domainName = gcd.get_Name();

 //Fetch Object store, Folder and document set in the folder
 ObjectStore objStore = Factory.ObjectStore.fetchInstance(gcd,objStoreName, null);
 Folder folder = Factory.Folder.fetchInstance(objStore, folderPath, null);
 DocumentSet docSet = folder.get_ContainedDocuments();
 Iterator iter = docSet.iterator();
 Document currentDoc = null;

 /* Iterate through the document set, run cancel check out on the documents
 * and save the changes
 */
 while (iter.hasNext())
        {
currentDoc = (Document)iter.next();
 docTitle = currentDoc.get_Name();
 VersionSeries vs = currentDoc.get_VersionSeries();
 if(vs.get_IsReserved ())
 {
 Document resv = (Document) vs.get_Reservation();
 Versionable versionable = resv.cancelCheckOut();
 ((Document)versionable).save(RefreshMode.NO_REFRESH);
 System.out.println("reservation deleted for docTitle:" + docTitle);
 }
 }
 }finally{
 if(userPushed)
 UserContext.get().popSubject();
 }
}

Use this process with other applications

The article walked you through the steps to configure IBM Rational Performance Tester to load test the document editing functionality of FileNet Content Engine. Although it focused on Rational Performance Tester, the key concepts and the artifacts included in this article can be used with other load-testing tools.

Resources

Learn

Get products and technologies

Discuss

Comments

developerWorks: Sign in

Required fields are indicated with an asterisk (*).


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name



The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


All information submitted is secure.

Dig deeper into Rational software on developerWorks


static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Rational
ArticleID=784601
ArticleTitle=Load test FileNet Content Engine using IBM Rational Performance Tester
publish-date=01172012