I ran into a situation where I cannot simply instantiate my custom task
(which extends from DefaultTask) due to a problem discribed in other post:
http://gradle.1045684.n5.nabble.com/NullPointerException-when-invoking-DefaultTask-s-no-arg-ctor-td3395247.html

My intent of instantiating my custom task was to then be able to call
methods defined on such custom task from within my test class so I could
specifically test behavior of those auxiliary methods.

Gradle's User Guide suggests using ProjectBuilder for instantiating the
task, such as:

Project project = ProjectBuilder.builder().build()
def task = project.task('greeting', type: GreetingTask)

However, I still cannot directly call methods defined on the GreetingTask on
this "task" object variable.

Does anyone know how to go about this problem?

Thanks!

--
View this message in context: 
http://gradle.1045684.n5.nabble.com/How-to-Unit-Test-protected-public-methods-in-the-CustomTask-tp4850331p4850331.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