--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/testng-users/-/dB1gbwmYxSIJ.
To post to this group, send email to testng...@googlegroups.com.
To unsubscribe from this group, send email to testng-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.
When I create the following code in IntelliJ:,
---Abc.java---------------------------------------------------------------------
package org.familysearch.links.uitests;
import org.testng.annotations.*;
@Test(enabled = false, groups = "xyz")
public class Abc {
@BeforeClass(alwaysRun = true)
private void def () {
System.out.println( "Beginning of {def()}.");
String user = "me"
String password = "em";
String sessionId = pqr( user, password);
System.out.println( "End of {def()}.");
}
public void ghi () {
System.out.println( "In {ghi()}.");
}
public void jkl () {
System.out.println( "In {jkl()}.");
}
public void mno () {
System.out.println( "In {mno()}.");
}
public String pqr ( String username
, String password) {
System.out.println( "In {pqr()}.");
return "Success!";
}
}
--------------------------------------------------------------------------------
and right click outside of any method and click on <Run 'Abc'>, I get the following output:
--------------------------------------------------------------------------------
Beginning of {def()}.
In {pqr()}.
End of {def()}.
In {ghi()}.
In {jkl()}.
In {mno()}.
--------------------------------------------------------------------------------
So TestNG knows somehow that {ghi()}, {jkl()}, and {mno()} are test methods, and should be run independently of any other methods, and it knows somehow that {pqr()} is not a test method, and should only be run when it's called by {def()}. My question is, how does TestNG tell that {pqr()} is not a test method like the other three test methods? It's inside class {Abc}, and {Abc} has the {@Test} annotation right before it; why aren't all methods inside {Abc} test methods? Is it the fact that {pqr()} has parameters and doesn't have a data provider that distinguishes it from the other test methods?
Kevin S
NOTICE: This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.