Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Test and Performance Tools Platform (TPTP) » Multiple instances for Verification Class
Multiple instances for Verification Class [message #129190] Sat, 26 April 2008 18:02 Go to next message
Pushparaj is currently offline PushparajFriend
Messages: 62
Registered: July 2009
Member
Hi All,

Why TPTP is creating multiple instances for same verification class?
For example if i am having 20 verification methods in Verification class,
TPTP is creating 20 instances at that time of test suite execution.

So i am not able to maintain some common variables which can be used in
all verification methods.

Is there any other way to solve this problem?


Thanks for your help.

Pushparaj
Re: Multiple instances for Verification Class [message #129379 is a reply to message #129190] Mon, 28 April 2008 12:11 Go to previous messageGo to next message
Paul Slauenwhite is currently offline Paul SlauenwhiteFriend
Messages: 975
Registered: July 2009
Senior Member
As with JUnit test classes, state for a test case method should be set in
the setUp() method. Variables that shared between invocations, should be
static.

PS
"Pushparaj" <pushparaj_94@yahoo.com> wrote in message
news:5dc637acd46b86a911435f5cc4d08d0b$1@www.eclipse.org...
> Hi All,
>
> Why TPTP is creating multiple instances for same verification class?
> For example if i am having 20 verification methods in Verification class,
> TPTP is creating 20 instances at that time of test suite execution.
>
> So i am not able to maintain some common variables which can be used in
> all verification methods.
>
> Is there any other way to solve this problem?
>
>
> Thanks for your help.
>
> Pushparaj
>
Re: Multiple instances for Verification Class [message #129466 is a reply to message #129379] Mon, 28 April 2008 18:11 Go to previous messageGo to next message
Pushparaj is currently offline PushparajFriend
Messages: 62
Registered: July 2009
Member
Hi Paul,

I tried using static variables but result is same. this is my verification
class

public class TestVerification extends AutoGUIVerificationHook {

public static LogWriter _logWriter = new LogWriter();

public IDETestVerification(String arg0, Class[] arg1, Object[] arg2) {
super(arg0, arg1, arg2);
}

..............
..............

}

I am using _logWriter variable in all my test verification methods. While
running my AGR test suites, this varibale is initialized for each test
cases. But i wants to initialize only once.

Thanks,
Pushparaj.
Re: Multiple instances for Verification Class [message #130840 is a reply to message #129379] Tue, 03 June 2008 16:48 Go to previous message
DuWayne Morris is currently offline DuWayne MorrisFriend
Messages: 36
Registered: July 2009
Member
Sorry for the delayed reply.

So, yes the AGR is working as designed, creating an instance of the
verification class each time it is invoked. Did you declare a static
variable as Paul suggested in the Setup method and that worked or did not
work?

If a static did not solve the problem, we'll think of some more elaborate
solution.
Previous Topic:Testing an application with Custom component
Next Topic:Reusable Thread Error in standard mode
Goto Forum:
  


Current Time: Sat Apr 20 01:19:06 GMT 2024

Powered by FUDForum. Page generated in 0.03066 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top