Code coverage for J2EE applications deployed in Websphere using Rational Purify plus
Rational's purify plus is one of the best code coverage tool I have seen till today, It has multiple capabilities in which I got a chance to work with is code coverage capability. Some times it is required for Developers and testers to know what part of the code is not getting executed, which part is getting executed during specific scenario of usage etc. In this case it is always good to use a code coverage too like purify plus to monitor our application while running and analyze the results of code run. The general process of code coverage is simple for any normal java applications, but when comes to a J2EE applications deployed and running under Websphere application server as a service needs more settings and configurations. In the web we can find many documents for configuring simple Java applications and other for code coverage.
So this post main aim is to explain the steps to configure the code coverage for J2EE application deployed under websphere and running as a system service.
Environment description :
Operating system : Windows XP / 2003
Webserver / Applicaiton server : Websphere
Application : J2EE type
Running as : Windows service.
When the Java process for hosting WAS is initialized, it gets its command line options from the server configuration file. This file exists for every WAS node and every WAS server. The location and name of this file is defined as follows:
<WAS root>\profiles\<your active profile>\config\cells\< cell id>\nodes\<node id>\servers\<server name>\server.xml
For example, if WAS is installed in C:\WAS, the profile name is ‘MyProfile’, the cell id is ‘MyCellId’, the node id is ‘MyNodeId’, and the server name is ‘MyServer’. The configuration file path will be defined like this:
C:\WAS\profiles\MyProfile\config\cells\MyCellId\nodes\MyNodeId\servers\MyServer\server.xml
Ex :
C:\Program Files\IBM\WebSphere\AppServer\profiles\AppSrv01\config\cells\ibm-b51282f6ec3Node01Cell\nodes\ibm-b51282f6ec3Node01\servers\CDSServer
For example:
<jvmEntries xmi:id="JavaVirtualMachine_1284026476671" verboseModeClass="false" verboseModeGarbageCollection="false" verboseModeJNI="false" runHProf="false" debugMode="false" debugArgs="-Djava.compiler=NONE -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7777" genericJvmArguments="-DPD_DT_ENABLED=true -XrunPureJVMPI:Coverage" executableJarFileName="-Xbootclasspath/a:%PPLUS_HOME%\Rational.jar" disableJIT="false">
After saving the file or applying these changes from the administrative console you should restart the server process. After the new instance of WAS starts, it will run with the appropriate profiler attached.
So to do the code coverage for any J2EE applications deployed under web sphere and WAS server is running as a system service. So if we edit prefilters in the default settings, this is not going to have any effect on the running service. This is because PureCoverage is saving the default settings in the folder named "c:\documents and settings\\application data\rational\purecoverage\coverage.ini"
Whereas WAS running as a service is using the configuration file named "c:\documents and settings\localservice\application
data\rational\purecoverage\coverage.ini"
In other words, the service profile doesn't correspond to the
PureCoverage profile, therefore they are trying to access different
default INI files.
data\rational\purecoverage\coverage.ini"
In other words, the service profile doesn't correspond to the
PureCoverage profile, therefore they are trying to access different
default INI files.
There are several ways to work around this problem:
1. Edit prefilters in the application settings, not the default
settings.
2. Copy the coverage.ini file from your profile to the service profile
(see above)
3. Run WAS as a user process, not as a system service.(User should be same the user with which purify was run)
4. Change the user associated with the service to be the same as the one
running the coverage.
5. Manually edit the coverage.ini file in the local service profile.
so the best I followed after changing the server.xml file is 3rd one , run you websphere service as the user with which purify coverage was run ...
Go to Windows
Start > Run > services.msc > Locate your service ex :IBM WebSphere Application Server V6.1 - CDSServer> Right click on it > Properties > go to Log on Tab > Select This Account > Provide the user and passwords which is same as the user which is running Purify coverage. > Apply > Ok.
- Now launch the Purify coverage once.
- Empty coverage window opens up ...
- Then now re-strat the Websphere service.
Now coverage should automatically pick up the chnages and pick the classed which you want to instrument.
How to apply filters in Purify plus / coverage :
License issues in the Purify plus :
0 comments to "Rational purify coverage for J2EE application deployed in Websphere"
Popular Posts
-
The best solution to know about these init levels is to understand the " man init " command output on Unix. There are basically 8...
-
How to Unlock BSNL 3G data card to use it with Airtel and Vodafone Model no : LW272 ? How to unlock BSNL 3G data card( Model no : LW272 )us...
-
How to transfer bike registration from one State to other (Karnataka to Andhra)?? Most of us having two wheelers purchased and registered in...
-
ఓం శ్రీ స్వామియే శరణం ఆయ్యప్ప!! Related posts : Trip to Sabarimala - Part 1 Trip to Sabarimala - Part 2 Ayappa Deeksha required things...
-
Following are some of interesting blogs I found till now ...please comment to add your blog here. Blogs in English : http://nitawriter.word...
Popular posts
- Airtel and vodafone GPRS settings for pocket PC phones
- Andhra 2 America
- Ayyappa Deeksha required things
- Blogs I watch !
- Captions for your bike
- DB2 FAQs
- Deepavali Vs The Goddes of sleep
- ETV - Dhee D2 D3
- Evolution of smoking in India Women
- How to make credit card payments?
- init 0, init 1, init 2 ..
- Java-J2EE interview preparation
- mCheck Application jar or jad download
- My SQL FAQs
- My Travelogues
- Old is blod - New is italic
- Online pay methids for credit cards
- Oracle FAQs
- Pilgrimages
- Smoking in Indian Women
- Technology Vs Humans
- Twitter feeds for all Telugu stars on single page.
- Unix best practices
- Unix FAQs
Post a Comment
Whoever writes Inappropriate/Vulgar comments to context, generally want to be anonymous …So I hope U r not the one like that?
For lazy logs, u can at least use Name/URL option which doesn’t even require any sign-in, The good thing is that it can accept your lovely nick name also and the URL is not mandatory too.
Thanks for your patience
~Krishna(I love "Transparency")