Different reporter output in eclipse vs. ant/shell

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Different reporter output in eclipse vs. ant/shell

Arno Jost
I allready wondered about why the report produced by TestNG is looking totally different when TestNG is called in eclipse (via the plugin) than when it is called in the shell (java org.testng.TestNG ...) or the ant-Target <testng>.
So far, i got used to it with the assumption that the reason for the simplier report format in eclipse has someting to do with the needed ability of the plugin to interprete the report for the graphical view?

What really bothers me now is that any information i add to the html-report with the static Reporter.log() method within a method annotated with @After-/BeforeMethod is just shown in the eclipse-report and not at all in ant/shell-report.
It looks like the only supported place to call a striking Reporter.log() for ant/shell is the test-method (@Test) itself.

Any particular reason for that and do i really have to use the Reporter API and an own Repoter for my need?

Thx in advance for any help!

b.t.w., i'm using TestNG in Version 6.5.1
Reply | Threaded
Open this post in threaded view
|

Re: Different reporter output in eclipse vs. ant/shell

Cédric Beust ♔-2
Reporter.log() should definitely add its output to the HTML report, can you post a screen shot of what you mean?

Thanks.

-- 
Cédric




On Mon, May 21, 2012 at 2:54 AM, Jostar <[hidden email]> wrote:

I allready wondered about why the report produced by TestNG is looking
totally different when TestNG is called in eclipse (via the plugin) than
when it is called in the shell (java org.testng.TestNG ...) or the
ant-Target <testng>.
So far, i got used to it with the assumption that the reason for the
simplier report format in eclipse has someting to do with the needed ability
of the plugin to interprete the report for the graphical view?

What really bothers me now is that any information i add to the html-report
with the static Reporter.log() method within a method annotated with
@After-/BeforeMethod is just shown in the eclipse-report and not at all in
ant/shell-report.
It looks like the only supported place to call a striking Reporter.log() for
ant/shell is the test-method (@Test) itself.

Any particular reason for that and do i really have to use the Reporter API
and an own Repoter for my need?

Thx in advance for any help!

b.t.w., i'm using TestNG in Version 6.5.1
--
View this message in context: http://old.nabble.com/Different-reporter-output-in-eclipse-vs.-ant-shell-tp33881684p33881684.html
Sent from the testng-users mailing list archive at Nabble.com.

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
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 [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: Different reporter output in eclipse vs. ant/shell

Arno Jost
Sure i can! :-)

Using the code below for any Test-Class and a testng.xml where it gets executed in a suite,
i get the following two reports and Results/Summary views when executed in ecplise (via plugin) and the shell respectively.

As you can see, in the second report (Screenshot_ShellReport_ReportOutput.png) the lines from the @BeforeClass methods ("Report entry before ClassA/B") are missing.
B.t.w. i neither get the line from the test-method ("Report entry from within testA2") within the summary of the shell-report (Screenshot_ShellReport_Summary.png) as i would expect it. So i have explicitely to look at the "reporter output" and i loose the information from which test-method which report-line was raised.

Hope that helps

Arno

Screenshot_EclipseReport_ReporterOutput.png


Screenshot_ShellReport_ReportOutput.png


Screenshot_EclipseReport_Results.png


Screenshot_ShellReport_Summary.png




------ code snipped of ClassA.java -----
   @BeforeClass
   public void classFromA()
   {
      System.out.println ("BeforeClass from A");
      Reporter.log ("Report entry before ClassA");
   }

   @Test
   public void testA1()
   {
      System.out.println (" - testA1");
   }

   @Test
   public void testA2()
   {
      System.out.println (" - testA2");
      Reporter.log ("Report entry from within testA2");
   }

   @Test(dependsOnMethods={"testA1","testA2"})
   public void testA3()
   {
      System.out.println (" - testA3");
   }


Cedric Beust wrote
Reporter.log() should definitely add its output to the HTML report, can you
post a screen shot of what you mean?

Thanks.

--
Cédric




On Mon, May 21, 2012 at 2:54 AM, Jostar <arno.jost@hispeed.ch> wrote:

>
> I allready wondered about why the report produced by TestNG is looking
> totally different when TestNG is called in eclipse (via the plugin) than
> when it is called in the shell (java org.testng.TestNG ...) or the
> ant-Target <testng>.
> So far, i got used to it with the assumption that the reason for the
> simplier report format in eclipse has someting to do with the needed
> ability
> of the plugin to interprete the report for the graphical view?
>
> What really bothers me now is that any information i add to the html-report
> with the static Reporter.log() method within a method annotated with
> @After-/BeforeMethod is just shown in the eclipse-report and not at all in
> ant/shell-report.
> It looks like the only supported place to call a striking Reporter.log()
> for
> ant/shell is the test-method (@Test) itself.
>
> Any particular reason for that and do i really have to use the Reporter API
> and an own Repoter for my need?
>
> Thx in advance for any help!
>
> b.t.w., i'm using TestNG in Version 6.5.1
> --
> View this message in context:
> http://old.nabble.com/Different-reporter-output-in-eclipse-vs.-ant-shell-tp33881684p33881684.html
> Sent from the testng-users mailing list archive at Nabble.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@googlegroups.com.
> To unsubscribe from this group, send email to
> testng-users+unsubscribe@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-users@googlegroups.com.
To unsubscribe from this group, send email to testng-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: Different reporter output in eclipse vs. ant/shell

Arno Jost
I realized, that the "old style" reports (screenshots 1 and 3) are coming from the old testng eclipse pluging that is installed in our central eclipse distribution (version 6.1.1.20110713_1401).

After installing locally a newer version (6.4.0.20120308_1617) the reports from within eclipse are like the ones from the shell or ant, thus with missing entries in the report output.

As often, sadly, an update of a technology/tool for increased optical comfort came along with decreased functionality... ;)

greets,
Arno