When is the testNG report get created

28 views
Skip to first unread message

las

unread,
Dec 21, 2009, 4:00:10 PM12/21/09
to testng-users
Hi,
I have a data file, say 100 test records, and 3 tests in one test
class.

when the testNG report get created:

a) as soon as it finishes running 3 tests on each record.
b) as soon as it finishes running tests on ALL test data (100 records
in this case).

I guess it's case b), and if my guess is right, can I somehow
configure testNG to have report generate right after each test-
record ? This will help to solve out of memory problem.

Thanks.
lt

Cédric Beust ♔

unread,
Dec 21, 2009, 8:21:32 PM12/21/09
to testng...@googlegroups.com
Hi,

I'm guessing you are talking about TestNG's HTML reports?

These are created at the very end of the test run.

TestNG offers two facilities to analyze test runs:  Reporters (which get called at the end of the run) and Listeners (which get notified as the test run progresses:  when a test starts, finishes, etc...).  It looks like you should be writing your own Listener, please refer to the documentation for details on how to do this and let us know if you have questions...

-- 
Cedric



--

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.





--
Cédric


hao trinh

unread,
Dec 21, 2009, 10:34:04 PM12/21/09
to testng...@googlegroups.com
Hi Cedric,
Thanks for answering my question.  Yes, I am talking about the HTML reports,  I have the "out of memory" problem when running my tests with a relatively big data file.
I'll give it a try with my own Listener, and will let you know how it goes.

Thanks.
lt

2009/12/21 Cédric Beust ♔ <cbe...@google.com>

Cédric Beust ♔

unread,
Dec 21, 2009, 10:53:36 PM12/21/09
to testng...@googlegroups.com
And you think that this reporter is causing the out of memory error?

-- 
Cedric

las

unread,
Dec 22, 2009, 12:24:17 PM12/22/09
to testng-users
Hi Cedric,
I am afraid it is. Below is the errors I encountered when testing
with a data file of 10,000 records. I used "System.out.println
(....)" to print out where I was in the tests, and which record it
was processing and redirect that to the TestNGResults.txt. The
TestNGResults.txt showed it processed last record successfully.

I may be wrong here, but I think all the information to be written to
a report is accummulate in some sort of StringBuffer, ArrayList and
start writing to a file when all the data have been processed.

lt.
----------------------------------
C:\working\NetBeansProjects\testOTD_ORM_ORU\build\test\classes>java
org.testng.TestNG -testclass myTestNG.myTestNG3 > c:\TestNGResults.txt
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:2882)
at java.lang.AbstractStringBuilder.expandCapacity
(AbstractStringBuilder.java:100)
at java.lang.AbstractStringBuilder.append
(AbstractStringBuilder.java:390)
at java.lang.StringBuffer.append(StringBuffer.java:224)
at org.testng.reporters.TestHTMLReporter.generateTable
(TestHTMLReporter.java:104)
at org.testng.reporters.TestHTMLReporter.generateLog
(TestHTMLReporter.java:300)
at org.testng.reporters.TestHTMLReporter.onFinish
(TestHTMLReporter.java:39)
at org.testng.TestRunner.fireEvent(TestRunner.java:1158)
at org.testng.TestRunner.afterRun(TestRunner.java:935)
at org.testng.TestRunner.run(TestRunner.java:502)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:329)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:
324)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:296)
at org.testng.SuiteRunner.run(SuiteRunner.java:201)
at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:915)
at org.testng.TestNG.runSuitesLocally(TestNG.java:879)
at org.testng.TestNG.run(TestNG.java:787)
at org.testng.TestNG.privateMain(TestNG.java:952)
at org.testng.TestNG.main(TestNG.java:925)


On Dec 21, 8:53 pm, Cédric Beust ♔ <cbe...@google.com> wrote:
> And you think that this reporter is causing the out of memory error?
>
> --
> Cedric
>
>
>
> On Mon, Dec 21, 2009 at 7:34 PM, hao trinh <lastr...@gmail.com> wrote:
> > Hi Cedric,
> > Thanks for answering my question.  Yes, I am talking about the HTML
> > reports,  I have the "out of memory" problem when running my tests with a
> > relatively big data file.
> > I'll give it a try with my own Listener, and will let you know how it goes.
>
> > Thanks.
> > lt
>
> > 2009/12/21 Cédric Beust ♔ <cbe...@google.com>
>
> > Hi,
>
> >> I'm guessing you are talking about TestNG's HTML reports?
>
> >> These are created at the very end of the test run.
>
> >> TestNG offers two facilities to analyze test runs:  Reporters (which get
> >> called at the end of the run) and Listeners (which get notified as the test
> >> run progresses:  when a test starts, finishes, etc...).  It looks like you
> >> should be writing your own Listener, please refer to the documentation for
> >> details on how to do this and let us know if you have questions...
>
> >> --
> >> Cedric
>

> >> On Mon, Dec 21, 2009 at 1:00 PM, las <lastr...@gmail.com> wrote:
>
> >>> Hi,
> >>> I have a data file, say 100 test records,  and 3 tests in one test
> >>> class.
>
> >>> when the testNG report get created:
>
> >>> a) as soon as it finishes running 3 tests on each record.
> >>> b) as soon as it finishes running tests on ALL test data (100 records
> >>> in this case).
>
> >>> I guess it's case b), and if my guess is right, can I somehow
> >>> configure testNG to have report generate right after each test-
> >>> record ?  This will help to solve out of memory problem.
>
> >>> Thanks.
> >>> lt
>
> >>> --
>
> >>> 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<testng-users%2Bunsu...@googlegroups.com>


> >>> .
> >>> For more options, visit this group at
> >>>http://groups.google.com/group/testng-users?hl=en.
>
> >> --

> >> ***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...@googlegroups.com.
> >> To unsubscribe from this group, send email to

> >> testng-users...@googlegroups.com<testng-users%2Bunsu...@googlegroups.com>


> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/testng-users?hl=en.
>
> >  --
> > 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<testng-users%2Bunsu...@googlegroups.com>


> > .
> > For more options, visit this group at
> >http://groups.google.com/group/testng-users?hl=en.
>
> --

> ***Cédric
> *

Cédric Beust ♔

unread,
Dec 22, 2009, 2:49:13 PM12/22/09
to testng...@googlegroups.com
Indeed.

You must have a lot in these tests in order to cause a StringBuffer#append to run out of memory :-)

I'll try to look into this but in the meantime, did you try to launch your JVM with a bigger heap?

-- 
Cedric


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.





--
Cédric


hao trinh

unread,
Dec 23, 2009, 11:57:30 AM12/23/09
to testng...@googlegroups.com
Hi Cedric,
I just did with increasing the JVM heap space to 256m and it finished successfully.

Thanks for your helps.
las

2009/12/22 Cédric Beust ♔ <cbe...@google.com>
Reply all
Reply to author
Forward
0 new messages