[
https://issues.apache.org/jira/browse/OFBIZ-10611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16658218#comment-16658218 ]
Mathieu Lirzin commented on OFBIZ-10611:
----------------------------------------
I have included [^OFBIZ-10611_Allow-unit-tests-to-be-written-in-Groovy.patch]which adds the Groovy plugin in the Gradle build file, and migrate {{FileUtilsTest.groovy}} to an unit test since it doesn't depend on the dispatcher or the delegator.
> Allow unit tests to be written in Groovy
> ----------------------------------------
>
> Key: OFBIZ-10611
> URL:
https://issues.apache.org/jira/browse/OFBIZ-10611> Project: OFBiz
> Issue Type: Improvement
> Affects Versions: Trunk
> Reporter: Mathieu Lirzin
> Priority: Minor
> Fix For: Upcoming Branch
>
> Attachments: OFBIZ-10611_Allow-unit-tests-to-be-written-in-Groovy.patch
>
>
> Since OFBIZ-9996 it is possible to write integration tests in Groovy, meaning test that depend on the dispatcher and the delegator. It would be nice if the unit tests could be written in Groovy too.
> The major benefit of writing tests in Groovy is that you create inputs and expected outputs more easily with objects literals. For example the following java code:
> {code:java}
> Map<String, Integer> input = new HashMap<>();
> input.put("foo", 42);
> input.put("bar", 37);
> {code}
> can be rewritten in Groovy like this:
> {code:java}
> def input = [foo: 42, bar: 37]
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)