You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Ed Young <ej...@summitbid.com> on 2011/01/17 16:13:17 UTC

Groovy Maven project and groovy tests

I want to create a groovy maven project and be able to execute groovy tests,
Geb test, spock tests, etc.

To start, I just want to execute tests that extend GroovyTestCase. I placed
tests in src/test/groovy, but they won't execute. Only the tests in
src/test/java will execute.

I created the project using the quickstart archetype, then configured the
pom from the gmaven 1.0 wiki.
<http://docs.codehaus.org/display/GMAVEN/GMaven+1.0+Release>

<project>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.codehaus.groovy.maven</groupId>
                <artifactId>gmaven-mojo</artifactId>
                <version>1.0</version>
            </dependency>
            <dependency>
                <groupId>org.codehaus.groovy.maven.runtime</groupId>
                <artifactId>gmaven-runtime-1.6</artifactId>
                <version>1.0</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.groovy.maven</groupId>
                    <artifactId>gmaven-plugin</artifactId>
                    <version>1.0</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
</project>

I then added src/test/groovy and an example Test:

package com.mydomain.whatever;
import groovy.util.GroovyTestCase

class GroovyAppTest extends GroovyTestCase {
    void testSomething() {
        assert 1 == 1
        assert 2 + 2 == 4 : "We're in trouble, arithmetic is broken"
    }
}

when I run mvn test I get:

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
There are no tests to run.

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Mon Jan 17 08:09:29 MST 2011
[INFO] Final Memory: 16M/81M
[INFO]
------------------------------------------------------------------------

Re: Groovy Maven project and groovy tests

Posted by lukewpatterson <lu...@gmail.com>.
you might be able to glean some help from a groovy-based maven plugin I'm
working on

http://code.google.com/p/indoorsdog/source/browse/#svn%2Fjacoco%2Ftrunk%2Fjacoco-maven-plugin

-- 
View this message in context: http://maven.40175.n5.nabble.com/Groovy-Maven-project-and-groovy-tests-tp3344543p3344941.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Groovy Maven project and groovy tests

Posted by Ed Young <ej...@summitbid.com>.
Yes, that was it. I removed the <pluginManagement> tags.

Now to to get my Geb tests working.

Thanks.

On Mon, Jan 17, 2011 at 1:29 PM, lukewpatterson <lu...@gmail.com>wrote:

>
> one thing that sticks out is that you aren't binding the gmaven goals, they
> are just in in <pluginManagement><plugins> not <build><plugins>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/Groovy-Maven-project-and-groovy-tests-tp3344543p3345067.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
- Ed

Re: Groovy Maven project and groovy tests

Posted by lukewpatterson <lu...@gmail.com>.
one thing that sticks out is that you aren't binding the gmaven goals, they
are just in in <pluginManagement><plugins> not <build><plugins>
-- 
View this message in context: http://maven.40175.n5.nabble.com/Groovy-Maven-project-and-groovy-tests-tp3344543p3345067.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Groovy Maven project and groovy tests

Posted by Ed Young <ej...@summitbid.com>.
I'm stumped too. Here's the whole pom

It's a maven project with nothing but one GroovyTestCase in src/test/groovy

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.comcast.neto</groupId>
    <artifactId>ChimpsFuncTest</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>ChimpsFuncTest</name>
    <url>http://maven.apache.org</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.8.1</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-all</artifactId>
            <version>1.7.4</version>
        </dependency>


        <!-- <dependency> -->
        <!-- <groupId>org.codehaus.groovy.maven</groupId> -->
        <!-- <artifactId>gmaven-mojo</artifactId> -->
        <!-- <version>1.0</version> -->
        <!-- </dependency> -->
        <!-- <dependency> -->
        <!-- <groupId>org.codehaus.groovy.maven.runtime</groupId> -->
        <!-- <artifactId>gmaven-runtime-1.6</artifactId> -->
        <!-- <version>1.0</version> -->
        <!-- </dependency> -->

        <dependency>
            <groupId>org.codehaus.geb</groupId>
            <artifactId>geb-core</artifactId>
            <version>RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-firefox-driver</artifactId>
            <version>RELEASE</version>
        </dependency>

    </dependencies>

    <build>
        <pluginManagement>
            <plugins>

                <plugin>
                    <groupId>org.codehaus.gmaven</groupId>
                    <artifactId>gmaven-plugin</artifactId>
                    <version>1.2</version>
                    <configuration>
                        <providerSelection>1.7</providerSelection>
                    </configuration>
                    <extensions>true</extensions>
                    <inherited>true</inherited>
                    <executions>
                        <execution>
                            <goals>
                                <goal>generateStubs</goal>
                                <goal>compile</goal>
                                <goal>generateTestStubs</goal>
                                <goal>testCompile</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

            </plugins>
        </pluginManagement>
    </build>

</project>


On Mon, Jan 17, 2011 at 11:21 AM, John Prystash <st...@yahoo.com> wrote:

> Hmm, maybe post your POM again as it is?  I'm out of ideas, but something
> isn't
> configured right obviously.  When I use the logging swtich, I get output
> along
> the lines of:
>
> [DEBUG] TestCompileMojo - Detected compatible provider: 1.6
> [INFO] [groovy:testCompile {execution: default}]
> [DEBUG] TestCompileMojo - Artifact loader configured with handler:
> org.codehaus.gmaven.plugin.ProviderMojoSupport$ArtifactHandlerImpl@5130500f
> [DEBUG] DefaultProviderManager - Using cached provider '[1.7] 'Groovy
> v1.7-beta-2' (version: 1.7.0-beta-2, type:
> org.codehaus.gmaven.runtime.v1_7.ProviderImpl)' for selection: 1.7
> [DEBUG] TestCompileMojo - Project Classpath:
> [DEBUG] TestCompileMojo -     file:/tmp/test/target/test-classes/
> [DEBUG] TestCompileMojo -     file:/tmp/test/target/classes/
> [DEBUG] TestCompileMojo -
>
> file:/home/prystasj/.m2/repository/org/codehaus/groovy/groovy-all/1.7.4/groovy-all-1.7.4.jar
>
> [DEBUG] TestCompileMojo -
> file:/home/prystasj/.m2/repository/junit/junit/4.8.1/junit-4.8.1.jar
> [DEBUG] TestCompileMojo - Scanning for sources in:
> /tmp/test/src/test/groovy
> [DEBUG] TestCompileMojo - Forcing to compile:
> [DEBUG] TestCompileMojo -  +
> /tmp/test/src/test/groovy/prystasj/ExampleTest.groovy
> [DEBUG] ClassCompilerFeature$ClassCompilerImpl - Added:
> file:/tmp/test/src/test/groovy/prystasj/ExampleTest.groovy
> [DEBUG] TestCompileMojo -  +
> /tmp/test/src/test/groovy/prystasj/HelperTest.groovy
> [DEBUG] ClassCompilerFeature$ClassCompilerImpl - Added:
> file:/tmp/test/src/test/groovy/prystasj/HelperTest.groovy
> [DEBUG] ClassCompilerFeature$ClassCompilerImpl - Classpath:
> [DEBUG] ClassCompilerFeature$ClassCompilerImpl -
> file:/tmp/test/target/test-classes/
> [DEBUG] ClassCompilerFeature$ClassCompilerImpl -
> file:/tmp/test/target/classes/
> [DEBUG] ClassCompilerFeature$ClassCompilerImpl -
>
> file:/home/prystasj/.m2/repository/org/codehaus/groovy/groovy-all/1.7.4/groovy-all-1.7.4.jar
>
> [DEBUG] ClassCompilerFeature$ClassCompilerImpl -
> file:/home/prystasj/.m2/repository/junit/junit/4.8.1/junit-4.8.1.jar
> [DEBUG] ClassCompilerFeature$ClassCompilerImpl - Compiling 2 sources
> [DEBUG] ClassCompilerFeature$ClassCompilerImpl -
> file:/tmp/test/src/test/groovy/prystasj/ExampleTest.groovy
> [DEBUG] ClassCompilerFeature$ClassCompilerImpl -
> file:/tmp/test/src/test/groovy/prystasj/HelperTest.groovy
> [DEBUG] ClassCompilerFeature$ClassCompilerImpl - Compiled 2 classes:
> [DEBUG] ClassCompilerFeature$ClassCompilerImpl -     prystasj.ExampleTest
> [DEBUG] ClassCompilerFeature$ClassCompilerImpl -     prystasj.HelperTest
> [INFO] TestCompileMojo - Compiled 2 Groovy classes
> [INFO] [surefire:test {execution: default-test}]
> [INFO] Surefire report directory: /tmp/test/target/surefire-reports
>
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running prystasj.ExampleTest
> Hello World
> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.143 sec
> Running prystasj.HelperTest
> Hello World
> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.009 sec
>
> Results :
>
> Tests run: 2, Failures: 0, Errors: 0, Skipped: 0
>
>
>
>
>
> ________________________________
> From: Ed Young <ej...@summitbid.com>
> To: Maven Users List <us...@maven.apache.org>
> Sent: Mon, January 17, 2011 12:30:44 PM
> Subject: Re: Groovy Maven project and groovy tests
>
> I added the groovy dependency (like yours), and removed (commented out) the
> gmaven-mojo and runtime.
>
> Still no tests run. Hmmm...
>
> running it like this:
> mvn -Dgmaven.logging=DEBUG test
>
> yeilds:
>
> $ mvn -Dgmaven.logging=DEBUG test
> [INFO] Scanning for projects...
> [WARNING]
>    Profile with id: 'property-overrides' has not been activated.
>
> [WARNING]
>    Profile with id: 'iblibio-repo' has not been activated.
>
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Building ChimpsFuncTest
> [INFO]    task-segment: [test]
> [INFO]
> ------------------------------------------------------------------------
> [INFO] [resources:resources {execution: default-resources}]
> [INFO] Using 'UTF-8' encoding to copy filtered resources.
> [INFO] skip non existing resourceDirectory
>
> /Users/eyoung2297k/development/workspace-sts2/ChimpsFuncTestMaven/src/main/resources
>
> [INFO] [compiler:compile {execution: default-compile}]
> [INFO] Nothing to compile - all classes are up to date
> [INFO] [resources:testResources {execution: default-testResources}]
> [INFO] Using 'UTF-8' encoding to copy filtered resources.
> [INFO] skip non existing resourceDirectory
>
> /Users/eyoung2297k/development/workspace-sts2/ChimpsFuncTestMaven/src/test/resources
>
> [INFO] [compiler:testCompile {execution: default-testCompile}]
> [INFO] Nothing to compile - all classes are up to date
> [INFO] [surefire:test {execution: default-test}]
> [INFO] Surefire report directory:
>
> /Users/eyoung2297k/development/workspace-sts2/ChimpsFuncTestMaven/target/surefire-reports
>
>
> -------------------------------------------------------
> T E S T S
> -------------------------------------------------------
> There are no tests to run.
>
> Results :
>
> Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
>
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD SUCCESSFUL
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 3 seconds
> [INFO] Finished at: Mon Jan 17 10:27:43 MST 2011
> [INFO] Final Memory: 14M/81M
> [INFO]
> ------------------------------------------------------------------------
>
>
>
> On Mon, Jan 17, 2011 at 9:32 AM, John Prystash <st...@yahoo.com>
> wrote:
>
> > I don't believe you need to define the dependencies on gmaven-mojo and
> > gmaven-runtime any longer.
> >
> > Maybe add a dependency on Groovy?  Or see what the output is for running:
> >
> >  $ mvn -Dgmaven.logging=DEBUG
> > I believe this POM gives some sort of a bare minimum needed to run the
> > Groovy
> > tests.  In a small project of mine, it runs the tests found under
> > src/test/groovy:
> >
> > <?xml version="1.0" encoding="utf-8"?>
> >
> >  <modelVersion>4.0.0</modelVersion>
> >   <groupId>prystasj</groupId>
> >  <artifactId>test</artifactId>
> >  <name>Example Project</name>
> >   <version>1.0-SNAPSHOT</version>
> >   <build>
> >     <plugins>
> >      <plugin>
> >        <groupId>org.codehaus.gmaven</groupId>
> >        <artifactId>gmaven-plugin</artifactId>
> >        <version>1.2</version>
> >        <configuration>
> >          <providerSelection>1.7</providerSelection>
> >        </configuration>
> >        <extensions>true</extensions>
> >        <inherited>true</inherited>
> >        <executions>
> >          <execution>
> >            <goals>
> >              <goal>generateStubs</goal>
> >              <goal>compile</goal>
> >              <goal>generateTestStubs</goal>
> >              <goal>testCompile</goal>
> >            </goals>
> >          </execution>
> >        </executions>
> >      </plugin>
> >    </plugins>
> >   </build>
> >  <dependencies>
> >    <dependency>
> >      <groupId>org.codehaus.groovy</groupId>
> >      <artifactId>groovy-all</artifactId>
> >      <version>1.7.4</version>
> >    </dependency>
> >     <dependency>
> >      <groupId>junit</groupId>
> >      <artifactId>junit</artifactId>
> >      <version>4.8.1</version>
> >      <scope>test</scope>
> >    </dependency>
> >   </dependencies>
> > </project>
> >
> >
> >
> >
> >
> > ________________________________
> > From: Ed Young <ej...@summitbid.com>
> > To: Maven Users List <us...@maven.apache.org>
> > Sent: Mon, January 17, 2011 10:59:32 AM
> > Subject: Re: Groovy Maven project and groovy tests
> >
> > thanks for the reply. I've added it to my build section, but still not
> > running my test in src/test/groovy + package name.
> >
> > Here's my entire pom:
> >
> >
> > http://www.w3.org/2001/XMLSchema-instance"
> >    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> > http://maven.apache.org/xsd/maven-4.0.0.xsd">
> >    <modelVersion>4.0.0</modelVersion>
> >
> >    <groupId>com.comcast.neto</groupId>
> >    <artifactId>ChimpsFuncTest</artifactId>
> >    <version>1.0-SNAPSHOT</version>
> >    <packaging>jar</packaging>
> >
> >    <name>ChimpsFuncTest</name>
> >    http://maven.apache.org
> >
> >    <properties>
> >        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
> >    </properties>
> >
> >    <dependencies>
> >        <dependency>
> >            <groupId>junit</groupId>
> >            <artifactId>junit</artifactId>
> >            <version>3.8.1</version>
> >            <scope>test</scope>
> >        </dependency>
> >
> >
> >        <dependency>
> >            <groupId>org.codehaus.groovy.maven</groupId>
> >            <artifactId>gmaven-mojo</artifactId>
> >            <version>1.0</version>
> >        </dependency>
> >        <dependency>
> >            <groupId>org.codehaus.groovy.maven.runtime</groupId>
> >            <artifactId>gmaven-runtime-1.6</artifactId>
> >            <version>1.0</version>
> >        </dependency>
> >
> >        <dependency>
> >            <groupId>org.codehaus.geb</groupId>
> >            <artifactId>geb-core</artifactId>
> >            <version>RELEASE</version>
> >        </dependency>
> >        <dependency>
> >            <groupId>org.seleniumhq.selenium</groupId>
> >            <artifactId>selenium-firefox-driver</artifactId>
> >            <version>RELEASE</version>
> >        </dependency>
> >
> >    </dependencies>
> >
> >    <build>
> >        <pluginManagement>
> >            <plugins>
> >
> >                <plugin>
> >                    <groupId>org.codehaus.gmaven</groupId>
> >                    <artifactId>gmaven-plugin</artifactId>
> >                    <version>1.2</version>
> >                    <configuration>
> >                        <providerSelection>1.7</providerSelection>
> >                    </configuration>
> >                    <extensions>true</extensions>
> >                    <inherited>true</inherited>
> >                    <executions>
> >                        <execution>
> >                            <goals>
> >                                <goal>generateStubs</goal>
> >                                <goal>compile</goal>
> >                                <goal>generateTestStubs</goal>
> >                                <goal>testCompile</goal>
> >                            </goals>
> >                        </execution>
> >                    </executions>
> >                </plugin>
> >
> >            </plugins>
> >        </pluginManagement>
> >    </build>
> >
> > </project>
> >
> > See anything amiss?
> >
> > On Mon, Jan 17, 2011 at 8:27 AM, John Prystash <st...@yahoo.com>
> > wrote:
> >
> > > Hey Ed, I believe you need to add an executions element containing the
> > > testCompile goal.
> > >
> > >
> > > Below is my gmaven configuration:
> > >
> > >      <plugin>
> > >        <groupId>org.codehaus.gmaven</groupId>
> > >        <artifactId>gmaven-plugin</artifactId>
> > >        <version>1.2</version>
> > >        <configuration>
> > >          <providerSelection>1.7</providerSelection>
> > >        </configuration>
> > >        <extensions>true</extensions>
> > >        <inherited>true</inherited>
> > >        <executions>
> > >          <execution>
> > >            <goals>
> > >              <goal>generateStubs</goal>
> > >              <goal>compile</goal>
> > >              <goal>generateTestStubs</goal>
> > >              <goal>testCompile</goal>
> > >            </goals>
> > >          </execution>
> > >        </executions>
> > >      </plugin>
> > >
> > >
> > > Hope this helps
> > >
> > >
> > > ________________________________
> > > From: Ed Young <ej...@summitbid.com>
> > > To: Maven Users List <us...@maven.apache.org>
> > > Sent: Mon, January 17, 2011 10:13:17 AM
> > > Subject: Groovy Maven project and groovy tests
> > >
> > > I want to create a groovy maven project and be able to execute groovy
> > > tests,
> > > Geb test, spock tests, etc.
> > >
> > > To start, I just want to execute tests that extend GroovyTestCase. I
> > placed
> > > tests in src/test/groovy, but they won't execute. Only the tests in
> > > src/test/java will execute.
> > >
> > > I created the project using the quickstart archetype, then configured
> the
> > > pom from the gmaven 1.0 wiki.
> > > <http://docs.codehaus.org/display/GMAVEN/GMaven+1.0+Release>
> > >
> > > <project>
> > >    <dependencyManagement>
> > >        <dependencies>
> > >            <dependency>
> > >                <groupId>org.codehaus.groovy.maven</groupId>
> > >                <artifactId>gmaven-mojo</artifactId>
> > >                <version>1.0</version>
> > >            </dependency>
> > >            <dependency>
> > >                <groupId>org.codehaus.groovy.maven.runtime</groupId>
> > >                <artifactId>gmaven-runtime-1.6</artifactId>
> > >                <version>1.0</version>
> > >            </dependency>
> > >        </dependencies>
> > >    </dependencyManagement>
> > >    <build>
> > >        <pluginManagement>
> > >            <plugins>
> > >                <plugin>
> > >                    <groupId>org.codehaus.groovy.maven</groupId>
> > >                    <artifactId>gmaven-plugin</artifactId>
> > >                    <version>1.0</version>
> > >                </plugin>
> > >            </plugins>
> > >        </pluginManagement>
> > >    </build>
> > > </project>
> > >
> > > I then added src/test/groovy and an example Test:
> > >
> > > package com.mydomain.whatever;
> > > import groovy.util.GroovyTestCase
> > >
> > > class GroovyAppTest extends GroovyTestCase {
> > >    void testSomething() {
> > >        assert 1 == 1
> > >        assert 2 + 2 == 4 : "We're in trouble, arithmetic is broken"
> > >    }
> > > }
> > >
> > > when I run mvn test I get:
> > >
> > > -------------------------------------------------------
> > > T E S T S
> > > -------------------------------------------------------
> > > There are no tests to run.
> > >
> > > Results :
> > >
> > > Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
> > >
> > > [INFO]
> > >
> ------------------------------------------------------------------------
> > > [INFO] BUILD SUCCESSFUL
> > > [INFO]
> > >
> ------------------------------------------------------------------------
> > > [INFO] Total time: 3 seconds
> > > [INFO] Finished at: Mon Jan 17 08:09:29 MST 2011
> > > [INFO] Final Memory: 16M/81M
> > > [INFO]
> > >
> ------------------------------------------------------------------------
> > >
> > >
> > >
> > >
> > >
> >
> >
> >
> > --
> > - Ed
> >
> >
> >
> >
> >
>
>
>
> --
> - Ed
>
>
>
>
>



-- 
- Ed

Re: Groovy Maven project and groovy tests

Posted by John Prystash <st...@yahoo.com>.
Hmm, maybe post your POM again as it is?  I'm out of ideas, but something isn't 
configured right obviously.  When I use the logging swtich, I get output along 
the lines of:

[DEBUG] TestCompileMojo - Detected compatible provider: 1.6
[INFO] [groovy:testCompile {execution: default}]
[DEBUG] TestCompileMojo - Artifact loader configured with handler: 
org.codehaus.gmaven.plugin.ProviderMojoSupport$ArtifactHandlerImpl@5130500f
[DEBUG] DefaultProviderManager - Using cached provider '[1.7] 'Groovy 
v1.7-beta-2' (version: 1.7.0-beta-2, type: 
org.codehaus.gmaven.runtime.v1_7.ProviderImpl)' for selection: 1.7
[DEBUG] TestCompileMojo - Project Classpath:
[DEBUG] TestCompileMojo -     file:/tmp/test/target/test-classes/
[DEBUG] TestCompileMojo -     file:/tmp/test/target/classes/
[DEBUG] TestCompileMojo -     
file:/home/prystasj/.m2/repository/org/codehaus/groovy/groovy-all/1.7.4/groovy-all-1.7.4.jar

[DEBUG] TestCompileMojo -     
file:/home/prystasj/.m2/repository/junit/junit/4.8.1/junit-4.8.1.jar
[DEBUG] TestCompileMojo - Scanning for sources in: /tmp/test/src/test/groovy
[DEBUG] TestCompileMojo - Forcing to compile:
[DEBUG] TestCompileMojo -  + 
/tmp/test/src/test/groovy/prystasj/ExampleTest.groovy
[DEBUG] ClassCompilerFeature$ClassCompilerImpl - Added: 
file:/tmp/test/src/test/groovy/prystasj/ExampleTest.groovy
[DEBUG] TestCompileMojo -  + 
/tmp/test/src/test/groovy/prystasj/HelperTest.groovy
[DEBUG] ClassCompilerFeature$ClassCompilerImpl - Added: 
file:/tmp/test/src/test/groovy/prystasj/HelperTest.groovy
[DEBUG] ClassCompilerFeature$ClassCompilerImpl - Classpath:
[DEBUG] ClassCompilerFeature$ClassCompilerImpl -     
file:/tmp/test/target/test-classes/
[DEBUG] ClassCompilerFeature$ClassCompilerImpl -     
file:/tmp/test/target/classes/
[DEBUG] ClassCompilerFeature$ClassCompilerImpl -     
file:/home/prystasj/.m2/repository/org/codehaus/groovy/groovy-all/1.7.4/groovy-all-1.7.4.jar

[DEBUG] ClassCompilerFeature$ClassCompilerImpl -     
file:/home/prystasj/.m2/repository/junit/junit/4.8.1/junit-4.8.1.jar
[DEBUG] ClassCompilerFeature$ClassCompilerImpl - Compiling 2 sources
[DEBUG] ClassCompilerFeature$ClassCompilerImpl -     
file:/tmp/test/src/test/groovy/prystasj/ExampleTest.groovy
[DEBUG] ClassCompilerFeature$ClassCompilerImpl -     
file:/tmp/test/src/test/groovy/prystasj/HelperTest.groovy
[DEBUG] ClassCompilerFeature$ClassCompilerImpl - Compiled 2 classes:
[DEBUG] ClassCompilerFeature$ClassCompilerImpl -     prystasj.ExampleTest
[DEBUG] ClassCompilerFeature$ClassCompilerImpl -     prystasj.HelperTest
[INFO] TestCompileMojo - Compiled 2 Groovy classes
[INFO] [surefire:test {execution: default-test}]
[INFO] Surefire report directory: /tmp/test/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running prystasj.ExampleTest
Hello World
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.143 sec
Running prystasj.HelperTest
Hello World
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.009 sec

Results :

Tests run: 2, Failures: 0, Errors: 0, Skipped: 0





________________________________
From: Ed Young <ej...@summitbid.com>
To: Maven Users List <us...@maven.apache.org>
Sent: Mon, January 17, 2011 12:30:44 PM
Subject: Re: Groovy Maven project and groovy tests

I added the groovy dependency (like yours), and removed (commented out) the
gmaven-mojo and runtime.

Still no tests run. Hmmm...

running it like this:
mvn -Dgmaven.logging=DEBUG test

yeilds:

$ mvn -Dgmaven.logging=DEBUG test
[INFO] Scanning for projects...
[WARNING]
    Profile with id: 'property-overrides' has not been activated.

[WARNING]
    Profile with id: 'iblibio-repo' has not been activated.

[INFO]
------------------------------------------------------------------------
[INFO] Building ChimpsFuncTest
[INFO]    task-segment: [test]
[INFO]
------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory
/Users/eyoung2297k/development/workspace-sts2/ChimpsFuncTestMaven/src/main/resources

[INFO] [compiler:compile {execution: default-compile}]
[INFO] Nothing to compile - all classes are up to date
[INFO] [resources:testResources {execution: default-testResources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory
/Users/eyoung2297k/development/workspace-sts2/ChimpsFuncTestMaven/src/test/resources

[INFO] [compiler:testCompile {execution: default-testCompile}]
[INFO] Nothing to compile - all classes are up to date
[INFO] [surefire:test {execution: default-test}]
[INFO] Surefire report directory:
/Users/eyoung2297k/development/workspace-sts2/ChimpsFuncTestMaven/target/surefire-reports


-------------------------------------------------------
T E S T S
-------------------------------------------------------
There are no tests to run.

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Mon Jan 17 10:27:43 MST 2011
[INFO] Final Memory: 14M/81M
[INFO]
------------------------------------------------------------------------



On Mon, Jan 17, 2011 at 9:32 AM, John Prystash <st...@yahoo.com> wrote:

> I don't believe you need to define the dependencies on gmaven-mojo and
> gmaven-runtime any longer.
>
> Maybe add a dependency on Groovy?  Or see what the output is for running:
>
>  $ mvn -Dgmaven.logging=DEBUG
> I believe this POM gives some sort of a bare minimum needed to run the
> Groovy
> tests.  In a small project of mine, it runs the tests found under
> src/test/groovy:
>
> <?xml version="1.0" encoding="utf-8"?>
>
>  <modelVersion>4.0.0</modelVersion>
>   <groupId>prystasj</groupId>
>  <artifactId>test</artifactId>
>  <name>Example Project</name>
>   <version>1.0-SNAPSHOT</version>
>   <build>
>     <plugins>
>      <plugin>
>        <groupId>org.codehaus.gmaven</groupId>
>        <artifactId>gmaven-plugin</artifactId>
>        <version>1.2</version>
>        <configuration>
>          <providerSelection>1.7</providerSelection>
>        </configuration>
>        <extensions>true</extensions>
>        <inherited>true</inherited>
>        <executions>
>          <execution>
>            <goals>
>              <goal>generateStubs</goal>
>              <goal>compile</goal>
>              <goal>generateTestStubs</goal>
>              <goal>testCompile</goal>
>            </goals>
>          </execution>
>        </executions>
>      </plugin>
>    </plugins>
>   </build>
>  <dependencies>
>    <dependency>
>      <groupId>org.codehaus.groovy</groupId>
>      <artifactId>groovy-all</artifactId>
>      <version>1.7.4</version>
>    </dependency>
>     <dependency>
>      <groupId>junit</groupId>
>      <artifactId>junit</artifactId>
>      <version>4.8.1</version>
>      <scope>test</scope>
>    </dependency>
>   </dependencies>
> </project>
>
>
>
>
>
> ________________________________
> From: Ed Young <ej...@summitbid.com>
> To: Maven Users List <us...@maven.apache.org>
> Sent: Mon, January 17, 2011 10:59:32 AM
> Subject: Re: Groovy Maven project and groovy tests
>
> thanks for the reply. I've added it to my build section, but still not
> running my test in src/test/groovy + package name.
>
> Here's my entire pom:
>
>
> http://www.w3.org/2001/XMLSchema-instance"
>    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/maven-4.0.0.xsd">
>    <modelVersion>4.0.0</modelVersion>
>
>    <groupId>com.comcast.neto</groupId>
>    <artifactId>ChimpsFuncTest</artifactId>
>    <version>1.0-SNAPSHOT</version>
>    <packaging>jar</packaging>
>
>    <name>ChimpsFuncTest</name>
>    http://maven.apache.org
>
>    <properties>
>        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>    </properties>
>
>    <dependencies>
>        <dependency>
>            <groupId>junit</groupId>
>            <artifactId>junit</artifactId>
>            <version>3.8.1</version>
>            <scope>test</scope>
>        </dependency>
>
>
>        <dependency>
>            <groupId>org.codehaus.groovy.maven</groupId>
>            <artifactId>gmaven-mojo</artifactId>
>            <version>1.0</version>
>        </dependency>
>        <dependency>
>            <groupId>org.codehaus.groovy.maven.runtime</groupId>
>            <artifactId>gmaven-runtime-1.6</artifactId>
>            <version>1.0</version>
>        </dependency>
>
>        <dependency>
>            <groupId>org.codehaus.geb</groupId>
>            <artifactId>geb-core</artifactId>
>            <version>RELEASE</version>
>        </dependency>
>        <dependency>
>            <groupId>org.seleniumhq.selenium</groupId>
>            <artifactId>selenium-firefox-driver</artifactId>
>            <version>RELEASE</version>
>        </dependency>
>
>    </dependencies>
>
>    <build>
>        <pluginManagement>
>            <plugins>
>
>                <plugin>
>                    <groupId>org.codehaus.gmaven</groupId>
>                    <artifactId>gmaven-plugin</artifactId>
>                    <version>1.2</version>
>                    <configuration>
>                        <providerSelection>1.7</providerSelection>
>                    </configuration>
>                    <extensions>true</extensions>
>                    <inherited>true</inherited>
>                    <executions>
>                        <execution>
>                            <goals>
>                                <goal>generateStubs</goal>
>                                <goal>compile</goal>
>                                <goal>generateTestStubs</goal>
>                                <goal>testCompile</goal>
>                            </goals>
>                        </execution>
>                    </executions>
>                </plugin>
>
>            </plugins>
>        </pluginManagement>
>    </build>
>
> </project>
>
> See anything amiss?
>
> On Mon, Jan 17, 2011 at 8:27 AM, John Prystash <st...@yahoo.com>
> wrote:
>
> > Hey Ed, I believe you need to add an executions element containing the
> > testCompile goal.
> >
> >
> > Below is my gmaven configuration:
> >
> >      <plugin>
> >        <groupId>org.codehaus.gmaven</groupId>
> >        <artifactId>gmaven-plugin</artifactId>
> >        <version>1.2</version>
> >        <configuration>
> >          <providerSelection>1.7</providerSelection>
> >        </configuration>
> >        <extensions>true</extensions>
> >        <inherited>true</inherited>
> >        <executions>
> >          <execution>
> >            <goals>
> >              <goal>generateStubs</goal>
> >              <goal>compile</goal>
> >              <goal>generateTestStubs</goal>
> >              <goal>testCompile</goal>
> >            </goals>
> >          </execution>
> >        </executions>
> >      </plugin>
> >
> >
> > Hope this helps
> >
> >
> > ________________________________
> > From: Ed Young <ej...@summitbid.com>
> > To: Maven Users List <us...@maven.apache.org>
> > Sent: Mon, January 17, 2011 10:13:17 AM
> > Subject: Groovy Maven project and groovy tests
> >
> > I want to create a groovy maven project and be able to execute groovy
> > tests,
> > Geb test, spock tests, etc.
> >
> > To start, I just want to execute tests that extend GroovyTestCase. I
> placed
> > tests in src/test/groovy, but they won't execute. Only the tests in
> > src/test/java will execute.
> >
> > I created the project using the quickstart archetype, then configured the
> > pom from the gmaven 1.0 wiki.
> > <http://docs.codehaus.org/display/GMAVEN/GMaven+1.0+Release>
> >
> > <project>
> >    <dependencyManagement>
> >        <dependencies>
> >            <dependency>
> >                <groupId>org.codehaus.groovy.maven</groupId>
> >                <artifactId>gmaven-mojo</artifactId>
> >                <version>1.0</version>
> >            </dependency>
> >            <dependency>
> >                <groupId>org.codehaus.groovy.maven.runtime</groupId>
> >                <artifactId>gmaven-runtime-1.6</artifactId>
> >                <version>1.0</version>
> >            </dependency>
> >        </dependencies>
> >    </dependencyManagement>
> >    <build>
> >        <pluginManagement>
> >            <plugins>
> >                <plugin>
> >                    <groupId>org.codehaus.groovy.maven</groupId>
> >                    <artifactId>gmaven-plugin</artifactId>
> >                    <version>1.0</version>
> >                </plugin>
> >            </plugins>
> >        </pluginManagement>
> >    </build>
> > </project>
> >
> > I then added src/test/groovy and an example Test:
> >
> > package com.mydomain.whatever;
> > import groovy.util.GroovyTestCase
> >
> > class GroovyAppTest extends GroovyTestCase {
> >    void testSomething() {
> >        assert 1 == 1
> >        assert 2 + 2 == 4 : "We're in trouble, arithmetic is broken"
> >    }
> > }
> >
> > when I run mvn test I get:
> >
> > -------------------------------------------------------
> > T E S T S
> > -------------------------------------------------------
> > There are no tests to run.
> >
> > Results :
> >
> > Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
> >
> > [INFO]
> > ------------------------------------------------------------------------
> > [INFO] BUILD SUCCESSFUL
> > [INFO]
> > ------------------------------------------------------------------------
> > [INFO] Total time: 3 seconds
> > [INFO] Finished at: Mon Jan 17 08:09:29 MST 2011
> > [INFO] Final Memory: 16M/81M
> > [INFO]
> > ------------------------------------------------------------------------
> >
> >
> >
> >
> >
>
>
>
> --
> - Ed
>
>
>
>
>



-- 
- Ed



      

Re: Groovy Maven project and groovy tests

Posted by Ed Young <ej...@summitbid.com>.
I added the groovy dependency (like yours), and removed (commented out) the
gmaven-mojo and runtime.

Still no tests run. Hmmm...

running it like this:
mvn -Dgmaven.logging=DEBUG test

yeilds:

$ mvn -Dgmaven.logging=DEBUG test
[INFO] Scanning for projects...
[WARNING]
    Profile with id: 'property-overrides' has not been activated.

[WARNING]
    Profile with id: 'iblibio-repo' has not been activated.

[INFO]
------------------------------------------------------------------------
[INFO] Building ChimpsFuncTest
[INFO]    task-segment: [test]
[INFO]
------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory
/Users/eyoung2297k/development/workspace-sts2/ChimpsFuncTestMaven/src/main/resources
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Nothing to compile - all classes are up to date
[INFO] [resources:testResources {execution: default-testResources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory
/Users/eyoung2297k/development/workspace-sts2/ChimpsFuncTestMaven/src/test/resources
[INFO] [compiler:testCompile {execution: default-testCompile}]
[INFO] Nothing to compile - all classes are up to date
[INFO] [surefire:test {execution: default-test}]
[INFO] Surefire report directory:
/Users/eyoung2297k/development/workspace-sts2/ChimpsFuncTestMaven/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
There are no tests to run.

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Mon Jan 17 10:27:43 MST 2011
[INFO] Final Memory: 14M/81M
[INFO]
------------------------------------------------------------------------



On Mon, Jan 17, 2011 at 9:32 AM, John Prystash <st...@yahoo.com> wrote:

> I don't believe you need to define the dependencies on gmaven-mojo and
> gmaven-runtime any longer.
>
> Maybe add a dependency on Groovy?  Or see what the output is for running:
>
>  $ mvn -Dgmaven.logging=DEBUG
> I believe this POM gives some sort of a bare minimum needed to run the
> Groovy
> tests.  In a small project of mine, it runs the tests found under
> src/test/groovy:
>
> <?xml version="1.0" encoding="utf-8"?>
>
>  <modelVersion>4.0.0</modelVersion>
>   <groupId>prystasj</groupId>
>  <artifactId>test</artifactId>
>  <name>Example Project</name>
>   <version>1.0-SNAPSHOT</version>
>   <build>
>     <plugins>
>      <plugin>
>        <groupId>org.codehaus.gmaven</groupId>
>        <artifactId>gmaven-plugin</artifactId>
>        <version>1.2</version>
>        <configuration>
>          <providerSelection>1.7</providerSelection>
>        </configuration>
>        <extensions>true</extensions>
>        <inherited>true</inherited>
>        <executions>
>          <execution>
>            <goals>
>              <goal>generateStubs</goal>
>              <goal>compile</goal>
>              <goal>generateTestStubs</goal>
>              <goal>testCompile</goal>
>            </goals>
>          </execution>
>        </executions>
>      </plugin>
>    </plugins>
>   </build>
>  <dependencies>
>    <dependency>
>      <groupId>org.codehaus.groovy</groupId>
>      <artifactId>groovy-all</artifactId>
>      <version>1.7.4</version>
>    </dependency>
>     <dependency>
>      <groupId>junit</groupId>
>      <artifactId>junit</artifactId>
>      <version>4.8.1</version>
>      <scope>test</scope>
>    </dependency>
>   </dependencies>
> </project>
>
>
>
>
>
> ________________________________
> From: Ed Young <ej...@summitbid.com>
> To: Maven Users List <us...@maven.apache.org>
> Sent: Mon, January 17, 2011 10:59:32 AM
> Subject: Re: Groovy Maven project and groovy tests
>
> thanks for the reply. I've added it to my build section, but still not
> running my test in src/test/groovy + package name.
>
> Here's my entire pom:
>
>
> http://www.w3.org/2001/XMLSchema-instance"
>    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/maven-4.0.0.xsd">
>    <modelVersion>4.0.0</modelVersion>
>
>    <groupId>com.comcast.neto</groupId>
>    <artifactId>ChimpsFuncTest</artifactId>
>    <version>1.0-SNAPSHOT</version>
>    <packaging>jar</packaging>
>
>    <name>ChimpsFuncTest</name>
>     http://maven.apache.org
>
>    <properties>
>        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>    </properties>
>
>    <dependencies>
>        <dependency>
>            <groupId>junit</groupId>
>            <artifactId>junit</artifactId>
>            <version>3.8.1</version>
>            <scope>test</scope>
>        </dependency>
>
>
>        <dependency>
>            <groupId>org.codehaus.groovy.maven</groupId>
>            <artifactId>gmaven-mojo</artifactId>
>            <version>1.0</version>
>        </dependency>
>        <dependency>
>            <groupId>org.codehaus.groovy.maven.runtime</groupId>
>            <artifactId>gmaven-runtime-1.6</artifactId>
>            <version>1.0</version>
>        </dependency>
>
>        <dependency>
>            <groupId>org.codehaus.geb</groupId>
>            <artifactId>geb-core</artifactId>
>            <version>RELEASE</version>
>        </dependency>
>        <dependency>
>            <groupId>org.seleniumhq.selenium</groupId>
>            <artifactId>selenium-firefox-driver</artifactId>
>            <version>RELEASE</version>
>        </dependency>
>
>    </dependencies>
>
>    <build>
>        <pluginManagement>
>            <plugins>
>
>                <plugin>
>                    <groupId>org.codehaus.gmaven</groupId>
>                    <artifactId>gmaven-plugin</artifactId>
>                    <version>1.2</version>
>                    <configuration>
>                        <providerSelection>1.7</providerSelection>
>                    </configuration>
>                    <extensions>true</extensions>
>                    <inherited>true</inherited>
>                    <executions>
>                        <execution>
>                            <goals>
>                                <goal>generateStubs</goal>
>                                <goal>compile</goal>
>                                <goal>generateTestStubs</goal>
>                                <goal>testCompile</goal>
>                            </goals>
>                        </execution>
>                    </executions>
>                </plugin>
>
>            </plugins>
>        </pluginManagement>
>    </build>
>
> </project>
>
> See anything amiss?
>
> On Mon, Jan 17, 2011 at 8:27 AM, John Prystash <st...@yahoo.com>
> wrote:
>
> > Hey Ed, I believe you need to add an executions element containing the
> > testCompile goal.
> >
> >
> > Below is my gmaven configuration:
> >
> >      <plugin>
> >        <groupId>org.codehaus.gmaven</groupId>
> >        <artifactId>gmaven-plugin</artifactId>
> >        <version>1.2</version>
> >        <configuration>
> >          <providerSelection>1.7</providerSelection>
> >        </configuration>
> >        <extensions>true</extensions>
> >        <inherited>true</inherited>
> >        <executions>
> >          <execution>
> >            <goals>
> >              <goal>generateStubs</goal>
> >              <goal>compile</goal>
> >              <goal>generateTestStubs</goal>
> >              <goal>testCompile</goal>
> >            </goals>
> >          </execution>
> >        </executions>
> >      </plugin>
> >
> >
> > Hope this helps
> >
> >
> > ________________________________
> > From: Ed Young <ej...@summitbid.com>
> > To: Maven Users List <us...@maven.apache.org>
> > Sent: Mon, January 17, 2011 10:13:17 AM
> > Subject: Groovy Maven project and groovy tests
> >
> > I want to create a groovy maven project and be able to execute groovy
> > tests,
> > Geb test, spock tests, etc.
> >
> > To start, I just want to execute tests that extend GroovyTestCase. I
> placed
> > tests in src/test/groovy, but they won't execute. Only the tests in
> > src/test/java will execute.
> >
> > I created the project using the quickstart archetype, then configured the
> > pom from the gmaven 1.0 wiki.
> > <http://docs.codehaus.org/display/GMAVEN/GMaven+1.0+Release>
> >
> > <project>
> >    <dependencyManagement>
> >        <dependencies>
> >            <dependency>
> >                <groupId>org.codehaus.groovy.maven</groupId>
> >                <artifactId>gmaven-mojo</artifactId>
> >                <version>1.0</version>
> >            </dependency>
> >            <dependency>
> >                <groupId>org.codehaus.groovy.maven.runtime</groupId>
> >                <artifactId>gmaven-runtime-1.6</artifactId>
> >                <version>1.0</version>
> >            </dependency>
> >        </dependencies>
> >    </dependencyManagement>
> >    <build>
> >        <pluginManagement>
> >            <plugins>
> >                <plugin>
> >                    <groupId>org.codehaus.groovy.maven</groupId>
> >                    <artifactId>gmaven-plugin</artifactId>
> >                    <version>1.0</version>
> >                </plugin>
> >            </plugins>
> >        </pluginManagement>
> >    </build>
> > </project>
> >
> > I then added src/test/groovy and an example Test:
> >
> > package com.mydomain.whatever;
> > import groovy.util.GroovyTestCase
> >
> > class GroovyAppTest extends GroovyTestCase {
> >    void testSomething() {
> >        assert 1 == 1
> >        assert 2 + 2 == 4 : "We're in trouble, arithmetic is broken"
> >    }
> > }
> >
> > when I run mvn test I get:
> >
> > -------------------------------------------------------
> > T E S T S
> > -------------------------------------------------------
> > There are no tests to run.
> >
> > Results :
> >
> > Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
> >
> > [INFO]
> > ------------------------------------------------------------------------
> > [INFO] BUILD SUCCESSFUL
> > [INFO]
> > ------------------------------------------------------------------------
> > [INFO] Total time: 3 seconds
> > [INFO] Finished at: Mon Jan 17 08:09:29 MST 2011
> > [INFO] Final Memory: 16M/81M
> > [INFO]
> > ------------------------------------------------------------------------
> >
> >
> >
> >
> >
>
>
>
> --
> - Ed
>
>
>
>
>



-- 
- Ed

Re: Groovy Maven project and groovy tests

Posted by John Prystash <st...@yahoo.com>.
I don't believe you need to define the dependencies on gmaven-mojo and 
gmaven-runtime any longer.

Maybe add a dependency on Groovy?  Or see what the output is for running:

  $ mvn -Dgmaven.logging=DEBUG
I believe this POM gives some sort of a bare minimum needed to run the Groovy 
tests.  In a small project of mine, it runs the tests found under 
src/test/groovy:

<?xml version="1.0" encoding="utf-8"?>

  <modelVersion>4.0.0</modelVersion>
  <groupId>prystasj</groupId>
  <artifactId>test</artifactId>
  <name>Example Project</name>
  <version>1.0-SNAPSHOT</version>
  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.gmaven</groupId>
        <artifactId>gmaven-plugin</artifactId>
        <version>1.2</version>
        <configuration>
          <providerSelection>1.7</providerSelection>
        </configuration>
        <extensions>true</extensions>
        <inherited>true</inherited>
        <executions>
          <execution>
            <goals>
              <goal>generateStubs</goal>
              <goal>compile</goal>
              <goal>generateTestStubs</goal>
              <goal>testCompile</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>org.codehaus.groovy</groupId>
      <artifactId>groovy-all</artifactId>
      <version>1.7.4</version>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>





________________________________
From: Ed Young <ej...@summitbid.com>
To: Maven Users List <us...@maven.apache.org>
Sent: Mon, January 17, 2011 10:59:32 AM
Subject: Re: Groovy Maven project and groovy tests

thanks for the reply. I've added it to my build section, but still not
running my test in src/test/groovy + package name.

Here's my entire pom:


http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.comcast.neto</groupId>
    <artifactId>ChimpsFuncTest</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>ChimpsFuncTest</name>
    http://maven.apache.org

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>


        <dependency>
            <groupId>org.codehaus.groovy.maven</groupId>
            <artifactId>gmaven-mojo</artifactId>
            <version>1.0</version>
        </dependency>
        <dependency>
            <groupId>org.codehaus.groovy.maven.runtime</groupId>
            <artifactId>gmaven-runtime-1.6</artifactId>
            <version>1.0</version>
        </dependency>

        <dependency>
            <groupId>org.codehaus.geb</groupId>
            <artifactId>geb-core</artifactId>
            <version>RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-firefox-driver</artifactId>
            <version>RELEASE</version>
        </dependency>

    </dependencies>

    <build>
        <pluginManagement>
            <plugins>

                <plugin>
                    <groupId>org.codehaus.gmaven</groupId>
                    <artifactId>gmaven-plugin</artifactId>
                    <version>1.2</version>
                    <configuration>
                        <providerSelection>1.7</providerSelection>
                    </configuration>
                    <extensions>true</extensions>
                    <inherited>true</inherited>
                    <executions>
                        <execution>
                            <goals>
                                <goal>generateStubs</goal>
                                <goal>compile</goal>
                                <goal>generateTestStubs</goal>
                                <goal>testCompile</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

            </plugins>
        </pluginManagement>
    </build>

</project>

See anything amiss?

On Mon, Jan 17, 2011 at 8:27 AM, John Prystash <st...@yahoo.com> wrote:

> Hey Ed, I believe you need to add an executions element containing the
> testCompile goal.
>
>
> Below is my gmaven configuration:
>
>      <plugin>
>        <groupId>org.codehaus.gmaven</groupId>
>        <artifactId>gmaven-plugin</artifactId>
>        <version>1.2</version>
>        <configuration>
>          <providerSelection>1.7</providerSelection>
>        </configuration>
>        <extensions>true</extensions>
>        <inherited>true</inherited>
>        <executions>
>          <execution>
>            <goals>
>              <goal>generateStubs</goal>
>              <goal>compile</goal>
>              <goal>generateTestStubs</goal>
>              <goal>testCompile</goal>
>            </goals>
>          </execution>
>        </executions>
>      </plugin>
>
>
> Hope this helps
>
>
> ________________________________
> From: Ed Young <ej...@summitbid.com>
> To: Maven Users List <us...@maven.apache.org>
> Sent: Mon, January 17, 2011 10:13:17 AM
> Subject: Groovy Maven project and groovy tests
>
> I want to create a groovy maven project and be able to execute groovy
> tests,
> Geb test, spock tests, etc.
>
> To start, I just want to execute tests that extend GroovyTestCase. I placed
> tests in src/test/groovy, but they won't execute. Only the tests in
> src/test/java will execute.
>
> I created the project using the quickstart archetype, then configured the
> pom from the gmaven 1.0 wiki.
> <http://docs.codehaus.org/display/GMAVEN/GMaven+1.0+Release>
>
> <project>
>    <dependencyManagement>
>        <dependencies>
>            <dependency>
>                <groupId>org.codehaus.groovy.maven</groupId>
>                <artifactId>gmaven-mojo</artifactId>
>                <version>1.0</version>
>            </dependency>
>            <dependency>
>                <groupId>org.codehaus.groovy.maven.runtime</groupId>
>                <artifactId>gmaven-runtime-1.6</artifactId>
>                <version>1.0</version>
>            </dependency>
>        </dependencies>
>    </dependencyManagement>
>    <build>
>        <pluginManagement>
>            <plugins>
>                <plugin>
>                    <groupId>org.codehaus.groovy.maven</groupId>
>                    <artifactId>gmaven-plugin</artifactId>
>                    <version>1.0</version>
>                </plugin>
>            </plugins>
>        </pluginManagement>
>    </build>
> </project>
>
> I then added src/test/groovy and an example Test:
>
> package com.mydomain.whatever;
> import groovy.util.GroovyTestCase
>
> class GroovyAppTest extends GroovyTestCase {
>    void testSomething() {
>        assert 1 == 1
>        assert 2 + 2 == 4 : "We're in trouble, arithmetic is broken"
>    }
> }
>
> when I run mvn test I get:
>
> -------------------------------------------------------
> T E S T S
> -------------------------------------------------------
> There are no tests to run.
>
> Results :
>
> Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
>
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD SUCCESSFUL
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 3 seconds
> [INFO] Finished at: Mon Jan 17 08:09:29 MST 2011
> [INFO] Final Memory: 16M/81M
> [INFO]
> ------------------------------------------------------------------------
>
>
>
>
>



-- 
- Ed



      

Re: Groovy Maven project and groovy tests

Posted by Ed Young <ej...@summitbid.com>.
thanks for the reply. I've added it to my build section, but still not
running my test in src/test/groovy + package name.

Here's my entire pom:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.comcast.neto</groupId>
    <artifactId>ChimpsFuncTest</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>ChimpsFuncTest</name>
    <url>http://maven.apache.org</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>


        <dependency>
            <groupId>org.codehaus.groovy.maven</groupId>
            <artifactId>gmaven-mojo</artifactId>
            <version>1.0</version>
        </dependency>
        <dependency>
            <groupId>org.codehaus.groovy.maven.runtime</groupId>
            <artifactId>gmaven-runtime-1.6</artifactId>
            <version>1.0</version>
        </dependency>

        <dependency>
            <groupId>org.codehaus.geb</groupId>
            <artifactId>geb-core</artifactId>
            <version>RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-firefox-driver</artifactId>
            <version>RELEASE</version>
        </dependency>

    </dependencies>

    <build>
        <pluginManagement>
            <plugins>

                <plugin>
                    <groupId>org.codehaus.gmaven</groupId>
                    <artifactId>gmaven-plugin</artifactId>
                    <version>1.2</version>
                    <configuration>
                        <providerSelection>1.7</providerSelection>
                    </configuration>
                    <extensions>true</extensions>
                    <inherited>true</inherited>
                    <executions>
                        <execution>
                            <goals>
                                <goal>generateStubs</goal>
                                <goal>compile</goal>
                                <goal>generateTestStubs</goal>
                                <goal>testCompile</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

            </plugins>
        </pluginManagement>
    </build>

</project>

See anything amiss?

On Mon, Jan 17, 2011 at 8:27 AM, John Prystash <st...@yahoo.com> wrote:

> Hey Ed, I believe you need to add an executions element containing the
> testCompile goal.
>
>
> Below is my gmaven configuration:
>
>      <plugin>
>        <groupId>org.codehaus.gmaven</groupId>
>        <artifactId>gmaven-plugin</artifactId>
>        <version>1.2</version>
>        <configuration>
>          <providerSelection>1.7</providerSelection>
>        </configuration>
>        <extensions>true</extensions>
>        <inherited>true</inherited>
>        <executions>
>          <execution>
>            <goals>
>              <goal>generateStubs</goal>
>              <goal>compile</goal>
>              <goal>generateTestStubs</goal>
>              <goal>testCompile</goal>
>            </goals>
>          </execution>
>        </executions>
>      </plugin>
>
>
> Hope this helps
>
>
> ________________________________
> From: Ed Young <ej...@summitbid.com>
> To: Maven Users List <us...@maven.apache.org>
> Sent: Mon, January 17, 2011 10:13:17 AM
> Subject: Groovy Maven project and groovy tests
>
> I want to create a groovy maven project and be able to execute groovy
> tests,
> Geb test, spock tests, etc.
>
> To start, I just want to execute tests that extend GroovyTestCase. I placed
> tests in src/test/groovy, but they won't execute. Only the tests in
> src/test/java will execute.
>
> I created the project using the quickstart archetype, then configured the
> pom from the gmaven 1.0 wiki.
> <http://docs.codehaus.org/display/GMAVEN/GMaven+1.0+Release>
>
> <project>
>    <dependencyManagement>
>        <dependencies>
>            <dependency>
>                <groupId>org.codehaus.groovy.maven</groupId>
>                <artifactId>gmaven-mojo</artifactId>
>                <version>1.0</version>
>            </dependency>
>            <dependency>
>                <groupId>org.codehaus.groovy.maven.runtime</groupId>
>                <artifactId>gmaven-runtime-1.6</artifactId>
>                <version>1.0</version>
>            </dependency>
>        </dependencies>
>    </dependencyManagement>
>    <build>
>        <pluginManagement>
>            <plugins>
>                <plugin>
>                    <groupId>org.codehaus.groovy.maven</groupId>
>                    <artifactId>gmaven-plugin</artifactId>
>                    <version>1.0</version>
>                </plugin>
>            </plugins>
>        </pluginManagement>
>    </build>
> </project>
>
> I then added src/test/groovy and an example Test:
>
> package com.mydomain.whatever;
> import groovy.util.GroovyTestCase
>
> class GroovyAppTest extends GroovyTestCase {
>    void testSomething() {
>        assert 1 == 1
>        assert 2 + 2 == 4 : "We're in trouble, arithmetic is broken"
>    }
> }
>
> when I run mvn test I get:
>
> -------------------------------------------------------
> T E S T S
> -------------------------------------------------------
> There are no tests to run.
>
> Results :
>
> Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
>
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD SUCCESSFUL
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 3 seconds
> [INFO] Finished at: Mon Jan 17 08:09:29 MST 2011
> [INFO] Final Memory: 16M/81M
> [INFO]
> ------------------------------------------------------------------------
>
>
>
>
>



-- 
- Ed

Re: Groovy Maven project and groovy tests

Posted by John Prystash <st...@yahoo.com>.
Hey Ed, I believe you need to add an executions element containing the 
testCompile goal.  


Below is my gmaven configuration:

      <plugin>
        <groupId>org.codehaus.gmaven</groupId>
        <artifactId>gmaven-plugin</artifactId>
        <version>1.2</version>
        <configuration>
          <providerSelection>1.7</providerSelection>
        </configuration>
        <extensions>true</extensions>
        <inherited>true</inherited>
        <executions>
          <execution>
            <goals>
              <goal>generateStubs</goal>
              <goal>compile</goal>
              <goal>generateTestStubs</goal>
              <goal>testCompile</goal>
            </goals>
          </execution>
        </executions>
      </plugin>


Hope this helps


________________________________
From: Ed Young <ej...@summitbid.com>
To: Maven Users List <us...@maven.apache.org>
Sent: Mon, January 17, 2011 10:13:17 AM
Subject: Groovy Maven project and groovy tests

I want to create a groovy maven project and be able to execute groovy tests,
Geb test, spock tests, etc.

To start, I just want to execute tests that extend GroovyTestCase. I placed
tests in src/test/groovy, but they won't execute. Only the tests in
src/test/java will execute.

I created the project using the quickstart archetype, then configured the
pom from the gmaven 1.0 wiki.
<http://docs.codehaus.org/display/GMAVEN/GMaven+1.0+Release>

<project>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.codehaus.groovy.maven</groupId>
                <artifactId>gmaven-mojo</artifactId>
                <version>1.0</version>
            </dependency>
            <dependency>
                <groupId>org.codehaus.groovy.maven.runtime</groupId>
                <artifactId>gmaven-runtime-1.6</artifactId>
                <version>1.0</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.groovy.maven</groupId>
                    <artifactId>gmaven-plugin</artifactId>
                    <version>1.0</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
</project>

I then added src/test/groovy and an example Test:

package com.mydomain.whatever;
import groovy.util.GroovyTestCase

class GroovyAppTest extends GroovyTestCase {
    void testSomething() {
        assert 1 == 1
        assert 2 + 2 == 4 : "We're in trouble, arithmetic is broken"
    }
}

when I run mvn test I get:

-------------------------------------------------------
T E S T S
-------------------------------------------------------
There are no tests to run.

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Mon Jan 17 08:09:29 MST 2011
[INFO] Final Memory: 16M/81M
[INFO]
------------------------------------------------------------------------