I am struggling with this, too.

1. Trying the advice above:

* What went wrong:
A problem occurred evaluating root project 'PSMC'.
Cause: Could not find property 'test2' on root project 'PSMC'.

This is cretainly due to the forward reference to a still non-existing task
definition.
2. So let's try:
test(dependsOn: 'test2') {
    useJUnit();
}

* What went wrong:
A problem occurred evaluating root project 'PSMC'.
Cause: Could not find method test() for arguments [{dependsOn=test2},
build_gradle_1cc3d5ab16c36a6c5824412cf2666a0c$_run_closur...@c6b8b0] on root
project 'PSMC'.

3. OK, try other way:
test {
    useJUnit();
}

task test2(type: Test) {
    useTestNG();
}
test.dependsOn test2

FAILURE: Build failed with an exception.

* What went wrong:
A base directory must be specified in the task or via a method argument!

* Exception is:
org.gradle.api.InvalidUserDataException: A base directory must be specified
in the task or via a method argument!
        at
org.gradle.api.internal.file.DefaultConfigurableFileTree.getDir(DefaultConfigurableFileTree.java:75)
        at
org.gradle.api.internal.file.DefaultConfigurableFileTree.matching(DefaultConfigurableFileTree.java:92)
        at 
org.gradle.api.tasks.testing.Test.getCandidateClassFiles(Test.java:767)
        at
org.gradle.api.tasks.testing.Test_Decorated.getCandidateClassFiles(Unknown
Source)


4. Instead of test.dependsOn test2 try this:
check.dependsOn test2

Only JUnit tests are run.



Is there a working solution for this?

Thanks!
-- 
View this message in context: 
http://gradle.1045684.n5.nabble.com/JUnit-and-TestNG-tp3074015p3211528.html
Sent from the gradle-user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to