You need to specify at least one testng.xml or one class

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

You need to specify at least one testng.xml or one class

tarun3kumar

Hi,
I am trying to use ant task in build.xml and the snippet is as follows:

 <taskdef name="testng" classpathref="test.classpath"
                   classname="org.testng.TestNGAntTask" />

        <target name="testNG" depends="compile-for-test">
           <testng classpathref="test.classpath" suitename="Suite1">
                        <xmlfileset dir="test/java" includes="testng.xml"/>
           </testng>
    </target>

this all worked fine before when i was not using testng.xml and in place of xmlfileset specified the classfileset and classes to run.

And my testng.xml is placed in the same direcotry as build.xml and test/java has direcotries where the test file resides..in the package .com.xyz.ABCTest.

my testng.xml is a very small file like

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite1" verbose="1">
<test name="installGrouptest">
        <groups>
                <define name="install">
                        <include name="installSL"/>
                        <include name="installComp"/>
                </define>
                <run>
                        <include name="install"/>
                </run>
        </groups>
        <classes>
               
             <class name="org.xyz.ABCTEst"/>
        </classes>
</test>
</suite>

when i run the ant task in verbose mode i can see that java task is invoked in wrong way"

java -classpath ....  'org.testng.TestNG'  "C:/Temp/testng123"
C:/Temp/testng123 should have been testng.xml instead..what is wrong...

somehow my testng.xml is not getting recognised or picked up by testng task. I searched all places , some i saw were using propertyfile element as child element to testng which did not compile in my case. At other places i saw fork="yes" i got error saying that is not a supported attribute in my case...

i have java 5 in my path and ant 1.7 alpha in my path
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=79358&messageID=144349#144349


--~--~---------~--~----~------------~-------~--~----~
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: You need to specify at least one testng.xml or one class

Alexandru Popescu ☀

According to your task the testng.xml file should be placed in
<CURRENT_DIR>/test/java but according to your description it is not
there.

./alex
--
.w( the_mindstorm )p.
  TestNG co-founder
EclipseTestNG Creator


On 4/24/07, pts <[hidden email]> wrote:

>
> Hi,
> I am trying to use ant task in build.xml and the snippet is as follows:
>
>  <taskdef name="testng" classpathref="test.classpath"
>                    classname="org.testng.TestNGAntTask" />
>
>         <target name="testNG" depends="compile-for-test">
>            <testng classpathref="test.classpath" suitename="Suite1">
>                         <xmlfileset dir="test/java" includes="testng.xml"/>
>            </testng>
>     </target>
>
> this all worked fine before when i was not using testng.xml and in place of xmlfileset specified the classfileset and classes to run.
>
> And my testng.xml is placed in the same direcotry as build.xml and test/java has direcotries where the test file resides..in the package .com.xyz.ABCTest.
>
> my testng.xml is a very small file like
>
> <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
> <suite name="Suite1" verbose="1">
> <test name="installGrouptest">
>         <groups>
>                 <define name="install">
>                         <include name="installSL"/>
>                         <include name="installComp"/>
>                 </define>
>                 <run>
>                         <include name="install"/>
>                 </run>
>         </groups>
>         <classes>
>
>              <class name="org.xyz.ABCTEst"/>
>         </classes>
> </test>
> </suite>
>
> when i run the ant task in verbose mode i can see that java task is invoked in wrong way"
>
> java -classpath ....  'org.testng.TestNG'  "C:/Temp/testng123"
> C:/Temp/testng123 should have been testng.xml instead..what is wrong...
>
> somehow my testng.xml is not getting recognised or picked up by testng task. I searched all places , some i saw were using propertyfile element as child element to testng which did not compile in my case. At other places i saw fork="yes" i got error saying that is not a supported attribute in my case...
>
> i have java 5 in my path and ant 1.7 alpha in my path
> ---------------------------------------------------------------------
> Posted via Jive Forums
> http://forums.opensymphony.com/thread.jspa?threadID=79358&messageID=144349#144349
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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: You need to specify at least one testng.xml or one class

ptsks

Thanks Alex. I wrongly assumed that xmlfileset is asking for java
files root as was classfileset  needing.

On Apr 23, 3:09 pm, "Alexandru Popescu ☀"
<[hidden email]> wrote:

> According to your task thetestng.xmlfile should be placed in
> <CURRENT_DIR>/test/java but according to your description it is not
> there.
>
> ./alex
> --
> .w( the_mindstorm )p.
>   TestNG co-founder
> EclipseTestNG Creator
>
> On 4/24/07, pts <[hidden email]> wrote:
>
>
>
> > Hi,
> > I am trying to useanttask in build.xml and the snippet is as follows:
>
> >  <taskdef name="testng" classpathref="test.classpath"
> >                    classname="org.testng.TestNGAntTask" />
>
> >         <target name="testNG" depends="compile-for-test">
> >            <testng classpathref="test.classpath" suitename="Suite1">
> >                         <xmlfileset dir="test/java" includes="testng.xml"/>
> >            </testng>
> >     </target>
>
> > this all worked fine before when i was not usingtestng.xmland in place of xmlfileset specified the classfileset and classes to run.
>
> > And mytestng.xmlis placed in the same direcotry as build.xml and test/java has direcotries where the test file resides..in the package .com.xyz.ABCTest.
>
> > mytestng.xmlis a very small file like
>
> > <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
> > <suite name="Suite1" verbose="1">
> > <test name="installGrouptest">
> >         <groups>
> >                 <define name="install">
> >                         <include name="installSL"/>
> >                         <include name="installComp"/>
> >                 </define>
> >                 <run>
> >                         <include name="install"/>
> >                 </run>
> >         </groups>
> >         <classes>
>
> >              <classname="org.xyz.ABCTEst"/>
> >         </classes>
> > </test>
> > </suite>
>
> > when i run theanttask in verbose mode i can see that java task is invoked in wrong way"
>
> > java -classpath ....  'org.testng.TestNG'  "C:/Temp/testng123"
> > C:/Temp/testng123 should have beentestng.xmlinstead..what is wrong...
>
> > somehow mytestng.xmlis not getting recognised or picked up by testng task. I searched all places , some i saw were using propertyfile element as child element to testng which did not compile in my case. At other places i saw fork="yes" i got error saying that is not a supported attribute in my case...
>
> > i have java 5 in my path andant1.7 alpha in my path
> > ---------------------------------------------------------------------
> > Posted via Jive Forums
> >http://forums.opensymphony.com/thread.jspa?threadID=79358&messageID=1...


--~--~---------~--~----~------------~-------~--~----~
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: You need to specify at least one testng.xml or one class

Steve Loughran-7
In reply to this post by tarun3kumar

On 23/04/07, pts <[hidden email]> wrote
>
> i have java 5 in my path and ant 1.7 alpha in my path

Ant 1.7 final is out now, you know.

 Indeed, we are even starting to plan the 1.7.1 summer refresh:
http://wiki.apache.org/ant/Ant1.7.1/Planning

-steve

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