Hi,
Am 28.09.11 20:44, schrieb tseredz:
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)
that's the correct way of instantiating a task for testing.
However, I still cannot directly call methods defined on the GreetingTask on
this "task" object variable.
What stacktrace to you get when calling methods of "task". Maybe you can
you provide the snippet of your GreetingTask too.
regards,
René
--
-----------------------
regards,
René
rene groeschke
http://www.breskeby.com
@breskeby
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email