Test Class:
@Test()
public class Foo {
private static final Logger logger = Logger.getLogger(Foo.class);
private float item;
@BeforeClass
public void setUp() {
logger.info("BeforeClass");
}
@BeforeMethod
public void beforeMethod() {
this.item = new Random().nextFloat();
logger.info(format("Setup {0}", this.item));
}
public void test01() {
logger.info(format("Run {0}", this.item));
}
public void test02() {
logger.info(format("Run {0}", this.item));
}
public void test03() {
logger.info(format("Run {0}", this.item));
}
}
TestNG XML:
<suite name="fooSuite" verbose="1" parallel="methods">
<test verbose="2" name="fooTest" annotations="JDK">
<classes>
<class name="Foo"/>
</classes>
</test>
</suite>
Logger Output:
2011-05-05 16:57:48,928 INFO (Foo:25) - BeforeClass
2011-05-05 16:57:48,937 INFO (Foo:31) - Setup 0.266
2011-05-05 16:57:48,937 INFO (Foo:31) - Setup 0.445
2011-05-05 16:57:48,939 INFO (Foo:31) - Setup 0.641
2011-05-05 16:57:48,946 INFO (Foo:35) - Run 0.266
2011-05-05 16:57:48,946 INFO (Foo:39) - Run 0.266
2011-05-05 16:57:48,948 INFO (Foo:43) - Run 0.266
--
Josh
--
You received this message because you are subscribed to the Google Groups "testng-users" group.
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.
Cool, and thanks. I guess no immediately plans to instantiate new test
classes in each thread then, eh? Keep up the good work.