'test/java' and 'test/groovy' directories

View: New views
10 Messages — Rating Filter:   Alert me  

'test/java' and 'test/groovy' directories

by Peter Ledbrook-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

What do people think of adding 'test/java' and 'test/groovy'
directories to Grails, to complement the 'src/...' directories? I
think this would be useful for storing abstract and utility test
classes, and they could be provided by plugins too.

Cheers,

Peter

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

    http://xircles.codehaus.org/manage_email


Re: 'test/java' and 'test/groovy' directories

by Graeme Rocher-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Useful but post 1.0

Cheers

On Jan 11, 2008 8:16 PM, Peter Ledbrook <peter@...> wrote:

> Hi,
>
> What do people think of adding 'test/java' and 'test/groovy'
> directories to Grails, to complement the 'src/...' directories? I
> think this would be useful for storing abstract and utility test
> classes, and they could be provided by plugins too.
>
> Cheers,
>
> Peter
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>



--
Graeme Rocher
Grails Project Lead
G2One, Inc. Chief Technology Officer
http://www.g2one.com

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

    http://xircles.codehaus.org/manage_email


Re: 'test/java' and 'test/groovy' directories

by rtayek :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

At 12:16 PM 1/11/2008, you wrote:
>... What do people think of adding 'test/java' and 'test/groovy'
>directories to Grails, to complement the 'src/...' directories? I
>think this would be useful for storing abstract and utility test
>classes,  ...

currently there are unit/ and integration/ in test/. there might be
others like user/ load/ and deployment/. these seem (imho) more
useful than the groovy/java separation.

would you do both or ?

thanks


---
vice-chair http://ocjug.org/



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

    http://xircles.codehaus.org/manage_email


Re: 'test/java' and 'test/groovy' directories

by Marcos Silva Pereira :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hum... I don't write unit test for Java classes using Java. Indeed, use groovy to write these test sounds more attractive to me. Moreover, test can be grouped by packages, so, why divide them in more directories?

Kind Regards

On Jan 11, 2008 8:18 PM, Ray Tayek <rtayek@...> wrote:
At 12:16 PM 1/11/2008, you wrote:
>... What do people think of adding 'test/java' and 'test/groovy'
>directories to Grails, to complement the 'src/...' directories? I
>think this would be useful for storing abstract and utility test
>classes,  ...

currently there are unit/ and integration/ in test/. there might be
others like user/ load/ and deployment/. these seem (imho) more
useful than the groovy/java separation.

would you do both or ?

thanks


---
vice-chair http://ocjug.org/



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

   http://xircles.codehaus.org/manage_email




--
Marcos Silva Pereira
http://marcospereira.wordpress.com
"You only live once.", James Brown

Re: 'test/java' and 'test/groovy' directories

by Peter Ledbrook :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 12/01/2008, Marcos Silva Pereira <marcos.silva@...> wrote:
> Hum... I don't write unit test for Java classes using Java. Indeed, use
> groovy to write these test sounds more attractive to me. Moreover, test can
> be grouped by packages, so, why divide them in more directories?

Urgh...tests in a different package? Sorry, one of my pet hates :)
Anyway, the point is that in some build systems it is useful to have
different classpaths for the main source and the tests. Grails only
adds 'test/unit' and 'test/integration' when running the tests
(understandably).

However, there are no other paths defined explicitly for tests, so the
only option is to put helper/abstract classes under either 'test/unit'
or 'test/integration'. In addition, plugins cannot provide 'test-time'
source files. So, it would be nice to have something similar to
Maven's standard structure, i.e. 'test/groovy' and 'test/java' where
you can put classes that only apply for tests (and shouldn't be
distributed in the WAR file).

Probably clear as mud, but I hope it clarifies the intention behind
the proposal :)

Cheers,

Peter

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

    http://xircles.codehaus.org/manage_email


Re: 'test/java' and 'test/groovy' directories

by hcunningham :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hi

Peter Ledbrook wrote:
>  So, it would be nice to have something similar to
> Maven's standard structure, i.e. 'test/groovy' and 'test/java' where
> you can put classes that only apply for tests (and shouldn't be
> distributed in the WAR file).


is there some difficulty with having groovy and java files in the same directory?

personally I find src/java vs. src/groovy to be a needless separation (and
found similar while working with maven)

best
--
Hamish
http://www.dcs.shef.ac.uk/~hamish/

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

    http://xircles.codehaus.org/manage_email


Re: 'test/java' and 'test/groovy' directories

by Peter Ledbrook :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 14/01/2008, Hamish Cunningham <hamish@...> wrote:

> hi
>
> Peter Ledbrook wrote:
> >  So, it would be nice to have something similar to
> > Maven's standard structure, i.e. 'test/groovy' and 'test/java' where
> > you can put classes that only apply for tests (and shouldn't be
> > distributed in the WAR file).
>
>
> is there some difficulty with having groovy and java files in the same directory?
>
> personally I find src/java vs. src/groovy to be a needless separation (and
> found similar while working with maven)


Maybe not now with the joint compiler. It might even work at the
moment if all java and groovy files go into 'src/java', although I
haven't tried it.

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

    http://xircles.codehaus.org/manage_email


Re: 'test/java' and 'test/groovy' directories

by mjgallag :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Peter Ledbrook wrote:
However, there are no other paths defined explicitly for tests, so the
only option is to put helper/abstract classes under either 'test/unit'
or 'test/integration'.
Is there anyway currently to get these helper/abstract test classes not to show up in the test report with warnings indicating they don't contain any tests?

Thanks a lot,
Mike

Re: 'test/java' and 'test/groovy' directories

by Peter Ledbrook :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> Is there anyway currently to get these helper/abstract test classes not to
> show up in the test report with warnings indicating they don't contain any
> tests?

With Grails the version of Grails in subversion, you can specify a
test pattern in Config.groovy:

  grails.testing.patterns = [ '**/*Tests' ]

As long as your abstract classes do not match the pattern, they will
not be included in the tests.

Cheers,

Peter

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

    http://xircles.codehaus.org/manage_email


Re: 'test/java' and 'test/groovy' directories

by Barry Kaplan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I would prefer if the java and groovy directories be merged (or just dropped and all production code simply be placed in src).