|
View:
New views
9 Messages
—
Rating Filter:
Alert me
|
|
|
Logger output not visible in test resultsHi, I'm runing my tests with maven surefire and the problem that I've is that I can't view my logger output in test results. When I run the tests I can see the logger output in the console where I run the command but I can't see it in the testng reporter ouptut. In the reporter output I only can see what I output using System.out. Someone knows what's happening? And why if my logger outputs to the console it isn't visible in the testng output? PD: I've tried to change surefire formMode to 'none' and it doesn't works. For the rest I have all default values. Cheers, --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "testng-users" group. To post to this group, send email to testng-users@... To unsubscribe from this group, send email to testng-users+unsubscribe@... For more options, visit this group at http://groups.google.com/group/testng-users?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Logger output not visible in test resultsHi Joan,
Did you try without Maven at all? This would help narrow down the suspects... -- Cedric On Sat, Oct 24, 2009 at 8:23 AM, Joan Pujol <joanpujol@...> wrote:
-- Cédric --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "testng-users" group. To post to this group, send email to testng-users@... To unsubscribe from this group, send email to testng-users+unsubscribe@... For more options, visit this group at http://groups.google.com/group/testng-users?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Logger output not visible in test resultsI 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) And ran it with: java -classpath .;..\lib\log4j-1.2.15.jar;..\lib\testng-5.10-jdk15.jar com.beust.testng.TestNG ../testng.xml I can see the log while running in the command line but I can't see nothing in the reporter output. I've never used testng before. I'm missing some parameter? Cheers, On Oct 24, 6:26 pm, Cédric Beust ♔ <cbe...@...> wrote: > Hi Joan, > > Did you try without Maven at all? This would help narrow down the > suspects... > > -- > Cedric > > > > > > On Sat, Oct 24, 2009 at 8:23 AM, Joan Pujol <joanpu...@...> wrote: > > > Hi, > > > I'm runing my tests with maven surefire and the problem that I've is > > that I can't view my logger output in test results. > > > When I run the tests I can see the logger output in the console where > > I run the command but I can't see it in the testng reporter ouptut. > > In the reporter output I only can see what I output using System.out. > > > Someone knows what's happening? And why if my logger outputs to the > > console it isn't visible in the testng output? > > > PD: I've tried to change surefire formMode to 'none' and it doesn't > > works. For the rest I have all default values. > > > Cheers, > > -- > Cédric You received this message because you are subscribed to the Google Groups "testng-users" group. To post to this group, send email to testng-users@... To unsubscribe from this group, send email to testng-users+unsubscribe@... For more options, visit this group at http://groups.google.com/group/testng-users?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Logger output not visible in test resultsCan 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 <joanpujol@...> wrote:
-- Cédric --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "testng-users" group. To post to this group, send email to testng-users@... To unsubscribe from this group, send email to testng-users+unsubscribe@... For more options, visit this group at http://groups.google.com/group/testng-users?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Logger output not visible in test resultsOf 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...@...> 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...@...> 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> > > ) > > And ran it with: > > java -classpath .;..\lib\log4j-1.2.15.jar;..\lib\testng-5.10-jdk15.jar > > com.beust.testng.TestNG ../testng.xml > > > I can see the log while running in the command line but I can't see > > nothing in the reporter output. > > > I've never used testng before. I'm missing some parameter? > > > Cheers, > > > On Oct 24, 6:26 pm, Cédric Beust ♔ <cbe...@...> wrote: > > > Hi Joan, > > > > Did you try without Maven at all? This would help narrow down the > > > suspects... > > > > -- > > > Cedric > > > > On Sat, Oct 24, 2009 at 8:23 AM, Joan Pujol <joanpu...@...> wrote: > > > > > Hi, > > > > > I'm runing my tests with maven surefire and the problem that I've is > > > > that I can't view my logger output in test results. > > > > > When I run the tests I can see the logger output in the console where > > > > I run the command but I can't see it in the testng reporter ouptut. > > > > In the reporter output I only can see what I output using System.out. > > > > > Someone knows what's happening? And why if my logger outputs to the > > > > console it isn't visible in the testng output? > > > > > PD: I've tried to change surefire formMode to 'none' and it doesn't > > > > works. For the rest I have all default values. > > > > > Cheers, > > > > -- > > > Cédric > > -- > Cédric You received this message because you are subscribed to the Google Groups "testng-users" group. To post to this group, send email to testng-users@... To unsubscribe from this group, send email to testng-users+unsubscribe@... For more options, visit this group at http://groups.google.com/group/testng-users?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Logger output not visible in test resultsJoan,
You need to use Reporter.log() if you want your logs to appear in the reports. -- Cedric On Sat, Oct 24, 2009 at 3:12 PM, Joan Pujol <joanpujol@...> wrote:
-- Cédric --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "testng-users" group. To post to this group, send email to testng-users@... To unsubscribe from this group, send email to testng-users+unsubscribe@... For more options, visit this group at http://groups.google.com/group/testng-users?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Logger output not visible in test resultsThis is the only way? There's no way to capture standard output messages writted by the code that is being tested? Or any workarround, because I've no problem in using Reporter in testing code but it's also interesting for me to put output from the code that is being tested. Cheers,
--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "testng-users" group. To post to this group, send email to testng-users@... To unsubscribe from this group, send email to testng-users+unsubscribe@... For more options, visit this group at http://groups.google.com/group/testng-users?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Logger output not visible in test resultsYes, it's the only way. TestNG doesn't capture System.out/err for a couple of reasons:
Does this answer your question? -- Cédric
On Sun, Oct 25, 2009 at 6:16 AM, Joan Pujol <joanpujol@...> wrote:
--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "testng-users" group. To post to this group, send email to testng-users@... To unsubscribe from this group, send email to testng-users+unsubscribe@... For more options, visit this group at http://groups.google.com/group/testng-users?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Logger output not visible in test resultsYes, now it's clear. Thanks you Cédric. 2009/10/25 Cédric Beust ♔ <cbeust@...>: > Yes, it's the only way. TestNG doesn't capture System.out/err for a couple > of reasons: > > The output would be mangled when you run your tests in parallel. > Capturing System.out/err can interfere with other tools, especially when > these tools already capture these outputs. > > If you want to capture this yourself, it's pretty easy: just assign out/err > to your own writer in a @BeforeSuite. > > Does this answer your question? > > -- > Cédric > > > > > On Sun, Oct 25, 2009 at 6:16 AM, Joan Pujol <joanpujol@...> wrote: >> >> This is the only way? >> There's no way to capture standard output messages writted by the code >> that is being tested? >> Or any workarround, because I've no problem in using Reporter in testing >> code but it's also interesting for me to put output from the code that is >> being tested. >> Cheers, >> El 25/10/2009, a les 1:21, Cédric Beust ♔ <cbeust@...> va escriure: >> >> Joan, >> >> You need to use Reporter.log() if you want your logs to appear in the >> reports. >> >> -- >> Cedric >> >> >> On Sat, Oct 24, 2009 at 3:12 PM, Joan Pujol <joanpujol@...> wrote: >>> >>> 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...@...> 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...@...> >>> > 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> >>> > > ) >>> > > And ran it with: >>> > > java -classpath >>> > > .;..\lib\log4j-1.2.15.jar;..\lib\testng-5.10-jdk15.jar >>> > > com.beust.testng.TestNG ../testng.xml >>> > >>> > > I can see the log while running in the command line but I can't see >>> > > nothing in the reporter output. >>> > >>> > > I've never used testng before. I'm missing some parameter? >>> > >>> > > Cheers, >>> > >>> > > On Oct 24, 6:26 pm, Cédric Beust ♔ <cbe...@...> wrote: >>> > > > Hi Joan, >>> > >>> > > > Did you try without Maven at all? This would help narrow down the >>> > > > suspects... >>> > >>> > > > -- >>> > > > Cedric >>> > >>> > > > On Sat, Oct 24, 2009 at 8:23 AM, Joan Pujol <joanpu...@...> >>> > > > wrote: >>> > >>> > > > > Hi, >>> > >>> > > > > I'm runing my tests with maven surefire and the problem that I've >>> > > > > is >>> > > > > that I can't view my logger output in test results. >>> > >>> > > > > When I run the tests I can see the logger output in the console >>> > > > > where >>> > > > > I run the command but I can't see it in the testng reporter >>> > > > > ouptut. >>> > > > > In the reporter output I only can see what I output using >>> > > > > System.out. >>> > >>> > > > > Someone knows what's happening? And why if my logger outputs to >>> > > > > the >>> > > > > console it isn't visible in the testng output? >>> > >>> > > > > PD: I've tried to change surefire formMode to 'none' and it >>> > > > > doesn't >>> > > > > works. For the rest I have all default values. >>> > >>> > > > > Cheers, >>> > >>> > > > -- >>> > > > Cédric >>> > >>> > -- >>> > Cédric >>> >> >> >> >> -- >> Cédric >> >> >> >> >> >> > > > > > > -- Joan Jesús Pujol Espinar http://www.joanpujol.cat http://lujop.deviantart.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "testng-users" group. To post to this group, send email to testng-users@... To unsubscribe from this group, send email to testng-users+unsubscribe@... For more options, visit this group at http://groups.google.com/group/testng-users?hl=en -~----------~----~----~----~------~----~------~--~--- |
| Free embeddable forum powered by Nabble | Forum Help |