Error message: testng doesn't support the "sourcedir" attribute

164 views
Skip to first unread message

Thomas Nguyen

unread,
Jan 8, 2016, 8:14:01 PM1/8/16
to testng-users
Got the error message: testng doesn't support the "sourcedir" attribute

According to TestNG documentation it definitely does support the "sourcedir" attribute (http://testng.org/doc/documentation-main.html#running-testng) so I'm very puzzled by this error message.

Here's the relevant section of my build.xml that cause the error message:

    <target name="run-tests" depends="test-compile" unless="testng.xml.fileset.run">
        <echo message="Running Unit Tests..." />

        <echo message="unitTest.failure = ${unitTest.failure}" />
        <testng haltonskipped="false" skippedProperty="unitTest.skipped" haltonfailure="false" failureproperty="unitTest.failure" workingDir="${tests.dir}" outputdir="${unit.test.dir}" sourcedir="${testclasses.dir}" groups="${testng.groups}" listeners="${testng.listeners}" timeOut="${testng.timeOut}" dumpCommand="true">
            <classpath>
                <pathelement path="${classes.dir}" />
                <pathelement path="${testclasses.dir}" />
                <pathelement path="${bp:run.classpath}" />
                <pathelement path="${bp:testrun.classpath}" />
            </classpath>
            <classfileset dir="${testclasses.dir}">
                <include name="**/*Test*.class" />
                <exclude name="**/*$$*.class" />
            </classfileset>
        </testng>

        <echo message="unitTest.failure = ${unitTest.failure}" />

        <antcall target="testng-junitreport">
        </antcall>

        <fail message="Common Data Provider Tests Failed">
            <condition>
                <istrue value="${unitTest.failure}" />
            </condition>
        </fail>
    </target>

Google doesn't give any useful information on this error message: https://www.google.com/search?q=testng+doesn%27t+support+the+%22sourcedir%22+attribute&ie=utf-8&oe=utf-8#q=testng+doesn%27t+support+the+sourcedir+attribute

There's even a nearly year old question on this exact issue on StackExchange without any answer: http://stackoverflow.com/questions/30543271/testng-doesnt-support-sourcedir-attribute-error

Anyone has any idea?  Thanks!

Cédric Beust ♔

unread,
Jan 8, 2016, 8:21:22 PM1/8/16
to testng...@googlegroups.com

TestNG no longer supports sourcedir (which was used then TestNG was still supporting Javadoc tags).


-- 
Cédric


--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users...@googlegroups.com.
To post to this group, send email to testng...@googlegroups.com.
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages