Of course:
//+++++CODE++++++++++
package example1;
import org.testng.annotations.*;
public class SimpleTest {
@BeforeClass
public void setUp() {
// code that will be invoked when this test is instantiated
}
@Test(groups = { "fast" })
public void aFastTest() {
System.out.println("Fast test");
org.apache.log4j.Logger.getLogger(SimpleTest.class).info("This is a
test");
}
@Test(groups = { "slow" })
public void aSlowTest() {
System.out.println("Slow test");
}
}
//testng.xml
<suite name="Package suite">
<test name="test">
<packages>
<classes>
<class name="example1.SimpleTest" />
</classes>
</packages>
</test>
</suite>
//Command to run the test:
java -classpath .;..\lib\log4j-1.2.15.jar;..\lib\testng-5.10-
jdk15.jar
com.beust.testng.TestNG ../testng.xml
A lot of thanks Cédric,
On Oct 24, 11:49 pm, Cédric Beust ♔ <
cbe...@google.com> wrote:
> Can you post a short example with your code? Are you using the Reporter
> class?
>
> --
> Cedric
>
>
>
>
>
> On Sat, Oct 24, 2009 at 11:34 AM, Joan Pujol <
joanpu...@gmail.com> wrote:
>
> > I tested now and it doesn't works. In fact it's worse because I can't
> > either see the System.out messages in reorter output.
>
> > I tried the web example adding a log4j line (
http://testng.org/doc/
> > documentation-main.html <
http://testng.org/doc/%0Adocumentation-main.html>
> > )