Quantcast

how to use testng and reportng with ant

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

how to use testng and reportng with ant

ubuntuuser
Hi ,

i have a task in my build.xml file

 <target name="run" depends = "jar">
        <echo message= "ABC: run"/>
        <taskdef name="testng" classpathref="classpath" classname="org.testng.TestNGAntTask"/>

        <testng classpathref="classpath" outputdir="report" haltonfailure="true"
            useDefaultListeners="false"
            listeners="org.uncommons.reportng.HTMLReporter,org.uncommons.reportng.JUnitXMLReporter">
                         <xmlfileset dir="." includes="testNG.xml"/>
                        <sysproperty key="org.uncommons.reportng.title" value=" Test Report"/>
                </testng>
    </target>


and i have specified the two required files basiclly reportng-1.1.2.jar and velocity-dep-1.4.jar file in the classpathref.

but when i do ant run and the testcases are executed i get the following error:


[testng] [2011-01-26 17:54:26 +0530][ValidSpecialCharsHeadersTester][INFO] ---------------------------------
   [testng] [TestNG] Reporter org.uncommons.reportng.HTMLReporter@78105738 failed
   [testng] org.uncommons.reportng.ReportNGException: Failed generating HTML report.
   [testng]     at org.uncommons.reportng.HTMLReporter.generateReport(HTMLReporter.java:117)
   [testng]     at org.testng.TestNG.generateReports(TestNG.java:931)
   [testng]     at org.testng.TestNG.run(TestNG.java:912)
   [testng]     at org.testng.TestNG.privateMain(TestNG.java:1193)
   [testng]     at org.testng.TestNG.main(TestNG.java:1153)
   [testng] Caused by: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getUser' in  class org.uncommons.reportng.ReportMetadata threw exception class java.net.UnknownHostException : mobiusQA: mobiusQA
   [testng]     at org.apache.velocity.runtime.parser.node.ASTIdentifier.execute(ASTIdentifier.java:193)
   [testng]     at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:175)
   [testng]     at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:220)
   [testng]     at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:230)
   [testng]     at org.apache.velocity.Template.merge(Template.java:256)
   [testng]     at org.apache.velocity.app.Velocity.mergeTemplate(Velocity.java:449)
   [testng]     at org.uncommons.reportng.AbstractReporter.generateFile(AbstractReporter.java:102)
   [testng]     at org.uncommons.reportng.HTMLReporter.createOverview(HTMLReporter.java:141)
   [testng]     at org.uncommons.reportng.HTMLReporter.generateReport(HTMLReporter.java:106)
   [testng]     ... 4 more

am i missing anything?
Guide!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how to use testng and reportng with ant

Cédric Beust ♔-2
Does the host name "mobiusQA" ring a bell? It seems to be related to the problem you're seeing.

-- 
Cédric


On Wed, Jan 26, 2011 at 4:37 AM, ubuntuuser <[hidden email]> wrote:

Hi ,

i have a task in my build.xml file

 <target name="run" depends = "jar">
       <echo message= "ABC: run"/>
       <taskdef name="testng" classpathref="classpath"
classname="org.testng.TestNGAntTask"/>

       <testng classpathref="classpath" outputdir="report"
haltonfailure="true"
           useDefaultListeners="false"

listeners="org.uncommons.reportng.HTMLReporter,org.uncommons.reportng.JUnitXMLReporter">
                        <xmlfileset dir="." includes="testNG.xml"/>
                       <sysproperty key="org.uncommons.reportng.title"
value=" Test Report"/>
               </testng>
   </target>


and i have specified the two required files basiclly reportng-1.1.2.jar and
velocity-dep-1.4.jar file in the classpathref.

but when i do ant run and the testcases are executed i get the following
error:


[testng] [2011-01-26 17:54:26 +0530][ValidSpecialCharsHeadersTester][INFO]
---------------------------------
  [testng] [TestNG] Reporter org.uncommons.reportng.HTMLReporter@78105738
failed
  [testng] org.uncommons.reportng.ReportNGException: Failed generating HTML
report.
  [testng]     at
org.uncommons.reportng.HTMLReporter.generateReport(HTMLReporter.java:117)
  [testng]     at org.testng.TestNG.generateReports(TestNG.java:931)
  [testng]     at org.testng.TestNG.run(TestNG.java:912)
  [testng]     at org.testng.TestNG.privateMain(TestNG.java:1193)
  [testng]     at org.testng.TestNG.main(TestNG.java:1153)
  [testng] Caused by:
org.apache.velocity.exception.MethodInvocationException: Invocation of
method 'getUser' in  class org.uncommons.reportng.ReportMetadata threw
exception class java.net.UnknownHostException : mobiusQA: mobiusQA
  [testng]     at
org.apache.velocity.runtime.parser.node.ASTIdentifier.execute(ASTIdentifier.java:193)
  [testng]     at
org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:175)
  [testng]     at
org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:220)
  [testng]     at
org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:230)
  [testng]     at org.apache.velocity.Template.merge(Template.java:256)
  [testng]     at
org.apache.velocity.app.Velocity.mergeTemplate(Velocity.java:449)
  [testng]     at
org.uncommons.reportng.AbstractReporter.generateFile(AbstractReporter.java:102)
  [testng]     at
org.uncommons.reportng.HTMLReporter.createOverview(HTMLReporter.java:141)
  [testng]     at
org.uncommons.reportng.HTMLReporter.generateReport(HTMLReporter.java:106)
  [testng]     ... 4 more

am i missing anything?
Guide!
--
View this message in context: http://old.nabble.com/how-to-use-testng-and-reportng-with-ant-tp30765845p30765845.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.




--
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 [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
|  
Report Content as Inappropriate

Re: how to use testng and reportng with ant

Jailton Jr
In reply to this post by ubuntuuser
Hey man! I don't know exactly if you want this, but you can generate great report with chart using testng-xslt (testng-xslt use xml generated by TestNG report and generate great reports with chart's!), if you interested you can see how it's work in my blog: http://www.jailtonalkiminlouzada.com/ (you can translate to english and ask me)





On Wed, Jan 26, 2011 at 10:37 AM, ubuntuuser <[hidden email]> wrote:

Hi ,

i have a task in my build.xml file

 <target name="run" depends = "jar">
       <echo message= "ABC: run"/>
       <taskdef name="testng" classpathref="classpath"
classname="org.testng.TestNGAntTask"/>

       <testng classpathref="classpath" outputdir="report"
haltonfailure="true"
           useDefaultListeners="false"

listeners="org.uncommons.reportng.HTMLReporter,org.uncommons.reportng.JUnitXMLReporter">
                        <xmlfileset dir="." includes="testNG.xml"/>
                       <sysproperty key="org.uncommons.reportng.title"
value=" Test Report"/>
               </testng>
   </target>


and i have specified the two required files basiclly reportng-1.1.2.jar and
velocity-dep-1.4.jar file in the classpathref.

but when i do ant run and the testcases are executed i get the following
error:


[testng] [2011-01-26 17:54:26 +0530][ValidSpecialCharsHeadersTester][INFO]
---------------------------------
  [testng] [TestNG] Reporter org.uncommons.reportng.HTMLReporter@78105738
failed
  [testng] org.uncommons.reportng.ReportNGException: Failed generating HTML
report.
  [testng]     at
org.uncommons.reportng.HTMLReporter.generateReport(HTMLReporter.java:117)
  [testng]     at org.testng.TestNG.generateReports(TestNG.java:931)
  [testng]     at org.testng.TestNG.run(TestNG.java:912)
  [testng]     at org.testng.TestNG.privateMain(TestNG.java:1193)
  [testng]     at org.testng.TestNG.main(TestNG.java:1153)
  [testng] Caused by:
org.apache.velocity.exception.MethodInvocationException: Invocation of
method 'getUser' in  class org.uncommons.reportng.ReportMetadata threw
exception class java.net.UnknownHostException : mobiusQA: mobiusQA
  [testng]     at
org.apache.velocity.runtime.parser.node.ASTIdentifier.execute(ASTIdentifier.java:193)
  [testng]     at
org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:175)
  [testng]     at
org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:220)
  [testng]     at
org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:230)
  [testng]     at org.apache.velocity.Template.merge(Template.java:256)
  [testng]     at
org.apache.velocity.app.Velocity.mergeTemplate(Velocity.java:449)
  [testng]     at
org.uncommons.reportng.AbstractReporter.generateFile(AbstractReporter.java:102)
  [testng]     at
org.uncommons.reportng.HTMLReporter.createOverview(HTMLReporter.java:141)
  [testng]     at
org.uncommons.reportng.HTMLReporter.generateReport(HTMLReporter.java:106)
  [testng]     ... 4 more

am i missing anything?
Guide!
--
View this message in context: http://old.nabble.com/how-to-use-testng-and-reportng-with-ant-tp30765845p30765845.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.




--
At,

Jailton Alkimin Louzada
Test Analyst - CTFL - Certified Tester Foundation Level
www.jailtonalkiminlouzada.com ou goo.gl/0x2h
http://br.linkedin.com/in/jailtonlouzada

--
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
|  
Report Content as Inappropriate

Re: how to use testng and reportng with ant

ubuntuuser
Hey Cedric,

Does using reportNG deal with users also! i am really not sure how and
why the "method 'getUser' in  class
org.uncommons.reportng.ReportMetadata threw
exception class java.net.UnknownHostException " is generated?

how do you use reportng with testng?

--
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
|  
Report Content as Inappropriate

Re: Re: how to use testng and reportng with ant

Cédric Beust ♔-2
Hi,

I don't use ReportNG and I didn't write it either. You should ask this question to its creator, Daniel Dyer.

-- 
Cédric


On Wed, Jan 26, 2011 at 11:48 AM, ubuntuuser <[hidden email]> wrote:
Hey Cedric,

Does using reportNG deal with users also! i am really not sure how and
why the "method 'getUser' in  class
org.uncommons.reportng.ReportMetadata threw
exception class java.net.UnknownHostException " is generated?

how do you use reportng with testng?

--
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.




--
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 [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
|  
Report Content as Inappropriate

Re: Re: how to use testng and reportng with ant

Daniel Dyer
On Wed, 26 Jan 2011 20:41:44 -0000, Cédric Beust ♔ <[hidden email]>  
wrote:

> Hi,
>
> I don't use ReportNG and I didn't write it either. You should ask this
> question to its creator, Daniel Dyer.

> >  [testng] Caused by:
> > org.apache.velocity.exception.MethodInvocationException: Invocation of
> > method 'getUser' in  class org.uncommons.reportng.ReportMetadata threw
> > exception class java.net.UnknownHostException : mobiusQA: mobiusQA

ReportNG includes the host name of the machine in the report.  The reason  
for this is it can be useful if you have a continuous integration system  
that consists of more than one machine.  If there is a problem it can be  
useful to know which machine was used in order to eliminate any possible  
problems with the environment.

The line that is causing this exception is

     String host = InetAddress.getLocalHost().getHostName();

I don't know why looking up the localhost causes a problem.  Presumably  
there is something unusual about your network configuration.  Which  
operating system is this?  Is mobiusQA the host name of the machine?

The Javadocs for getLocalHost() say that UnknownHostException can be  
thrown if the IP address is an illegal length.  How that might happen, I  
don't know.

Dan.

--
Daniel Dyer

--
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.

Loading...