[testng-dev] Dependent methods executed out-of-order if method names match across classes

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[testng-dev] Dependent methods executed out-of-order if method names match across classes

Raghu-26
Hi,

Below is the summary of my test files
  • There are two classes "ClassA" and "ClassB".
  • ClassA has two test methods test1() and test2()
    •  Test method "test2 ()" depends on "test1 ()".
  • ClassB has three test mehtods test1(), test2() and testX()
    • Test method "test1 ()" depends on "test2 ()".
    • Test method "test2 ()" depends on "testX ()".
I have an XML file that includes the above two classes with "preserve-order" set to "true". Upon execution I get the following output.

Output:
____________

[ClassA] Test-1
[ClassA] Test-2
[ClassB] Test-X
[ClassB] Test-1
[ClassB] Test-2
____________

Please note that in ClassB "test1()" depends on "test2()". So, "test2()" should have executed before "test1()". We find this behaviour only if the same function names ( That is "test1" and "test2" ) is used in both "ClassA" and "ClassB".

Please find the MyTestNG.zip (attached) having the source files.

Thanks,
Raghu

--
You received this message because you are subscribed to the Google Groups "testng-dev" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/testng-dev?hl=en.

MyTestNG.zip (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

[testng-dev] Re: Dependent methods executed out-of-order if method names match across classes

Raghu-26
Hi,

I am using testng-6.4.jar.

Thanks,
Raghu

On Feb 20, 3:20 pm, Raghu Nandan <[hidden email]> wrote:

> Hi,
>
> Below is the summary of my test files
>
>    - There are two classes "ClassA" and "ClassB".
>    - ClassA has two test methods test1() and test2()
>       -  Test method "test2 ()" depends on "test1 ()".
>    - ClassB has three test mehtods test1(), test2() and testX()
>       - Test method "test1 ()" depends on "test2 ()".
>       - Test method "test2 ()" depends on "testX ()".
>
> I have an XML file that includes the above two classes with
> "preserve-order" set to "true". Upon execution I get the following output.
>
> Output:
> ____________
>
> [ClassA] Test-1
> [ClassA] Test-2
> [ClassB] Test-X
> [ClassB] Test-1
> [ClassB] Test-2
> ____________
>
> Please note that in ClassB "test1()" depends on "test2()". So, "test2()"
> should have executed before "test1()". We find this behaviour only if the
> same function names ( That is "test1" and "test2" ) is used in both
> "ClassA" and "ClassB".
>
> Please find the MyTestNG.zip (attached) having the source files.
>
> Thanks,
> Raghu
>
>  MyTestNG.zip
> 1KViewDownload

--
You received this message because you are subscribed to the Google Groups "testng-dev" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/testng-dev?hl=en.