Skip to main content

developerWorks >  Rational  >  Forums  >  Rational Performance Testing  >  developerWorks

Custom code not executing    Point your RSS reader here for a feed of the latest messages in this thread


     

 
 

My developerWorks
 Welcome, Guest
Sign in or register
Permlink Replies: 5 - Pages: 1 - Last Post: Nov 5, 2009 8:38 AM Last Post By: kurtism Threads: [ Previous | Next ]

Posts: 2
Registered: Jul 15, 2007 11:32:50 PM
Custom code not executing
Posted: Jul 15, 2007 11:37:32 PM
Click to report abuse...   Click to reply to this thread Reply
Hello all

I am a new user of RPT. I have added some custom code to a test, the customary System.out.println("Hello world!") in the exec method of a class I have created.

However, I cannot see this outputted anywhere.

I then tried to write to a file. Once again, no file is created. It appears that my custom code is not executing at all.

Is there something that I need to "switch on" to get custom code up and running? Thanks.
m_adcock

Posts: 44
Registered: Jul 07, 2005 09:12:39 AM
Re: Custom code not executing
Posted: Jul 16, 2007 09:06:51 AM   in response to: in response to: 's post
Click to report abuse...   Click to reply to this thread Reply
Take advantage of the RPT Java API to output messages. Use the following example to write a message to the RPT Test Log.

=========================================

public String exec(ITestExecutionServices tes, String[] args) {

ITestLogManager myTestLog = tes.getTestLogManager();
myTestLog.reportMessage("This message is written to the Test Log");

return null;
}

=========================================

Regards,
Matthew Adcock

Posts: 2
Registered: Jul 15, 2007 11:32:50 PM
Re: Custom code not executing
Posted: Jul 17, 2007 04:27:17 AM   in response to: m_adcock in response to: m_adcock's post
Click to report abuse...   Click to reply to this thread Reply
Attachment 001.doc (129.5 KB)
Thanks Matthew.

I have tried what you have suggested and that seems to work fine.

However, now I have another problem. I have added custom code at two different points of my test. Within this custom code all I am simply doing is outputting the time in milliseconds.

However, when I view the test log it shows the output from my custom code one after the other. Please see 001.doc to see what I mean.

I am using two different classes for my custom code. Thanks.
Manjax

Posts: 4
Registered: Oct 27, 2009 10:37:00 PM
Re: Custom code not executing
Posted: Nov 04, 2009 10:47:27 PM   in response to: in response to: 's post
Click to report abuse...   Click to reply to this thread Reply
Hello,

How does one see the logs, where is the tes.getTestLogManager().reportMessage(
"BLAHBLAHBLAHBLAHBLAHBLAH"); log stored, do we have to configure anything to see the logs please help
bslauenwhite

Posts: 58
Registered: May 13, 2008 07:40:46 AM
Re: Custom code not executing
Posted: Nov 05, 2009 08:27:59 AM   in response to: Manjax in response to: Manjax's post
Click to report abuse...   Click to reply to this thread Reply
Hi,

Open the test log (see http://publib.boulder.ibm.com/infocenter/rpthelp/v8r1m0/topic/com.ibm.rational.test.lt.doc/topics/topenexechist.html) to the Events tab and search (CTRL+H -> Test Log Search) for your message events.

Paul
kurtism

Posts: 33
Registered: Apr 17, 2009 04:00:12 PM
Re: Custom code not executing
Posted: Nov 05, 2009 08:38:59 AM   in response to: Manjax in response to: Manjax's post
Click to report abuse...   Click to reply to this thread Reply
test.getTestLogManager... will place the messages in the RPT test log. Search the RPT help for "test log" to find out the details. But essentially you allow a run to complete, then right click the run results item in the Test Navigator and say "Display Test Log". Go to the events tab of the Test Log viewer and find your messages. For test runs all data is captured in the test log. For schedule runs, on a subset of the data is captured. This is controlled on the Test Log tab in the schedule editor. You may need to adjust your Test Log level for schedules, in order for your message to be present in the test log. See the help for more details.
 Tags
Help

Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular type of content or application that you're viewing.

My tags shows your tags for this particular type of content or application that you're viewing.

 

MoreLess 


Point your RSS reader here for a feed of the latest messages in all forums