Error "No test suite found. Nothing to run"

4,605 views
Skip to first unread message

Omair-Inam Abdul-Matin

unread,
Jun 27, 2012, 11:14:46 AM6/27/12
to testng...@googlegroups.com
I took a build.xml and suite.xml file from a project where testng was running correctly .. copied it to another project.. and now I can't run the tests anymore.. 

C:\project\bin>ant testng
Buildfile: C:\project\bin\build.xml

testng:
   [testng] Listening for transport dt_socket at address: 5005
   [testng] [ERROR]: No test suite found.  Nothing to run
   [testng] java.io.FileNotFoundException: test-output\testng.css (The system cannot find the path specified)
   [testng]     at java.io.FileOutputStream.open(Native Method)
   [testng]     at java.io.FileOutputStream.<init>(FileOutputStream.java:194)
   [testng]     at java.io.FileOutputStream.<init>(FileOutputStream.java:145)
   [testng]     at org.testng.internal.Utils.writeResourceToFile(Utils.java:618)
   [testng]     at org.testng.reporters.HtmlHelper.generateStylesheet(HtmlHelper.java:25)
   [testng]     at org.testng.reporters.SuiteHTMLReporter.generateReport(SuiteHTMLReporter.java:49)
   [testng]     at org.testng.TestNG.run(TestNG.java:613)
   [testng]     at org.testng.TestNG.privateMain(TestNG.java:999)
   [testng]     at org.testng.TestNG.main(TestNG.java:936)
   [testng] ERROR WHILE WRITING TO test-output\index.html
   [testng] java.io.IOException: The system cannot find the path specified
   [testng]     at java.io.WinNTFileSystem.createFileExclusively(Native Method)
   [testng]     at java.io.File.createNewFile(File.java:883)
   [testng]     at org.testng.internal.Utils.writeFile(Utils.java:168)
   [testng]     at org.testng.reporters.SuiteHTMLReporter.generateIndex(SuiteHTMLReporter.java:138)
   [testng]     at org.testng.reporters.SuiteHTMLReporter.generateReport(SuiteHTMLReporter.java:75)
   [testng]     at org.testng.TestNG.run(TestNG.java:613)
   [testng]     at org.testng.TestNG.privateMain(TestNG.java:999)
   [testng]     at org.testng.TestNG.main(TestNG.java:936)

My ant target looks like this:
    <path id="test.complete.classpath">

        <fileset refid="test-dependencies.fileset"/>
        <path refid="test.classpath"/>
        <fileset dir="${test.resources.dir}">
            <include name="log4j.properties"/>
        </fileset>
        <fileset dir="${build.test.dir}">
            <include name="**/*.class"/>
        </fileset>

    </path>

    <target name="testng" >
        <delete quiet="true">
            <fileset dir="${testng.report.dir}"/>
            <fileset dir="${test.coverage.dir}"/>
        </delete>
        <mkdir dir="${testng.report.dir}"/>
        <mkdir dir="${test.coverage.dir}"/>
        <testng outputDir="${testng.report.dir}"
                workingDir="${test.resources.dir}"
                haltOnfailure="false"
                useDefaultListeners="false"
                listeners="org.uncommons.reportng.HTMLReporter,org.testng.reporters.JUnitXMLReporter,org.uncommons.reportng.JUnitXMLReporter"
                groups="unit" verbose="1"
                >
            <jvmarg value="-Dlog4j.configuration=file:log4j.properties" />
            <jvmarg value="-Dquest.debug=1" />
            <jvmarg value="-Xdebug"/>
            <jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005"/>
            <classpath refid="test.complete.classpath"/>
            <sysproperty key="org.uncommons.reportng.title" value="Some Unit Tests"/>
            <xmlfileset dir="bin" includes="suite.xml"/>
        </testng>
    </target>


My suite.xml looks like this:
<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >

<suite name="TestSuite" verbose="1">
    <test name="TEST-Unit">
        <classes>
            <class name="com.somepackage.TransactionTestNGTest" />
        </classes>
        <groups>
            <run>
                <exclude name="brokenTests"  />
                <include name="unit"  />
            </run>
        </groups>
    </test>
</suite>

I've verified that the suite.xml file exists .. if I change the xmlfileset file to point to a non-existent suite.xml file: I get a different error:

BUILD FAILED
C:\source\Destiny_OneCE\SRSAD_UCSC\bin\build-test.xml:92: No suites, classes, methods or jar file was specified.

Does anyone have any idea what's going wrong here?




Omair-Inam Abdul-Matin

unread,
Jun 27, 2012, 12:24:43 PM6/27/12
to testng...@googlegroups.com
I found out the issue I was facing.. I was including reportNG as a maven dependency using the maven ant task which defines a transitive dependency on TestNG 5.0 which was getting picked up first and that was causing everything to fail.. 

Cédric Beust ♔

unread,
Jun 27, 2012, 1:44:59 PM6/27/12
to testng...@googlegroups.com
Thanks for taking the time to explain the problem, it might come in handy for future readers.

-- 
Cédric




--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/testng-users/-/QS2bvL2l0vAJ.

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.

Reply all
Reply to author
Forward
0 new messages