Groovy JUnit tests don't update

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Groovy JUnit tests don't update

Carr, Brian M
I've seen this weird behavior for some time, but it's just now reached enough of a nuisance to ask...

Occasionally when I make a change to a JUnit test, then right click the test and choose "Run as JUnit", the previous version of the test is run, and not the version I just saved.  Sometimes adding a blank to the file and saving again is enough to get the test to be recompiled and run, sometimes I have to restart eclipse to get the changes picked up.

This is a mixed Java/Groovy project, it's also a maven project, and the maven build uses the groovy eclipse compiler.

--b
______________________________
Brian M. Carr
Area Lead, Core Identity Management
ITS Applications, Identity Management
University of Texas at Austin
V: 512-232-6419
F: 512-232-4985
[hidden email]


smime.p7s (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Groovy JUnit tests don't update

Travis Hume

Ensure that within the project's build configuration src/test/groovy has an output folder of target/test-classes

On Jun 22, 2011 12:14 PM, "Carr, Brian M" <[hidden email]> wrote:
> I've seen this weird behavior for some time, but it's just now reached enough of a nuisance to ask...
>
> Occasionally when I make a change to a JUnit test, then right click the test and choose "Run as JUnit", the previous version of the test is run, and not the version I just saved. Sometimes adding a blank to the file and saving again is enough to get the test to be recompiled and run, sometimes I have to restart eclipse to get the changes picked up.
>
> This is a mixed Java/Groovy project, it's also a maven project, and the maven build uses the groovy eclipse compiler.
>
> --b
> ______________________________
> Brian M. Carr
> Area Lead, Core Identity Management
> ITS Applications, Identity Management
> University of Texas at Austin
> V: 512-232-6419
> F: 512-232-4985
> [hidden email]
>
Reply | Threaded
Open this post in threaded view
|

Re: Groovy JUnit tests don't update

Carr, Brian M
ah, yes... this is the problem.  it's an artifact of having to add the src/main/groovy and src/test/groovy folders to the build path every time i import a project...  Thanks for the assist

______________________________
Brian M. Carr
Area Lead, Core Identity Management
ITS Applications, Identity Management
University of Texas at Austin
V: 512-232-6419
F: 512-232-4985
[hidden email]

On Jun 22, 2011, at 2:27 PM, Travis Hume wrote:

> Ensure that within the project's build configuration src/test/groovy has an output folder of target/test-classes
> On Jun 22, 2011 12:14 PM, "Carr, Brian M" <[hidden email]> wrote:
> > I've seen this weird behavior for some time, but it's just now reached enough of a nuisance to ask...
> >
> > Occasionally when I make a change to a JUnit test, then right click the test and choose "Run as JUnit", the previous version of the test is run, and not the version I just saved. Sometimes adding a blank to the file and saving again is enough to get the test to be recompiled and run, sometimes I have to restart eclipse to get the changes picked up.
> >
> > This is a mixed Java/Groovy project, it's also a maven project, and the maven build uses the groovy eclipse compiler.
> >
> > --b
> > ______________________________
> > Brian M. Carr
> > Area Lead, Core Identity Management
> > ITS Applications, Identity Management
> > University of Texas at Austin
> > V: 512-232-6419
> > F: 512-232-4985
> > [hidden email]
> >


smime.p7s (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Groovy JUnit tests don't update

Travis Hume
You shouldn't have to manually add them each time if you additionally install the "Groovy-Eclipse m2Eclipse integration" plugin. It's gmaven aware and will setup your eclipse project correctly.


On Thu, Jun 23, 2011 at 6:52 AM, Carr, Brian M <[hidden email]> wrote:
ah, yes... this is the problem.  it's an artifact of having to add the src/main/groovy and src/test/groovy folders to the build path every time i import a project...  Thanks for the assist

______________________________
Brian M. Carr
Area Lead, Core Identity Management
ITS Applications, Identity Management
University of Texas at Austin
V: <a href="tel:512-232-6419" value="+15122326419">512-232-6419
F: <a href="tel:512-232-4985" value="+15122324985">512-232-4985
[hidden email]

On Jun 22, 2011, at 2:27 PM, Travis Hume wrote:

> Ensure that within the project's build configuration src/test/groovy has an output folder of target/test-classes
> On Jun 22, 2011 12:14 PM, "Carr, Brian M" <[hidden email]> wrote:
> > I've seen this weird behavior for some time, but it's just now reached enough of a nuisance to ask...
> >
> > Occasionally when I make a change to a JUnit test, then right click the test and choose "Run as JUnit", the previous version of the test is run, and not the version I just saved. Sometimes adding a blank to the file and saving again is enough to get the test to be recompiled and run, sometimes I have to restart eclipse to get the changes picked up.
> >
> > This is a mixed Java/Groovy project, it's also a maven project, and the maven build uses the groovy eclipse compiler.
> >
> > --b
> > ______________________________
> > Brian M. Carr
> > Area Lead, Core Identity Management
> > ITS Applications, Identity Management
> > University of Texas at Austin
> > V: <a href="tel:512-232-6419" value="+15122326419">512-232-6419
> > F: <a href="tel:512-232-4985" value="+15122324985">512-232-4985
> > [hidden email]
> >




--
Travis Hume
[hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Groovy JUnit tests don't update

Andrew Eisenberg
I think Brian mentioned that he is using the groovy-eclipse-compiler.
In this case, you need to use the build-helper-plugin to add the extra
source folders to your project.  See
http://groovy.codehaus.org/Groovy-Eclipse+compiler+plugin+for+Maven

On Thu, Jun 23, 2011 at 7:54 AM, Travis Hume <[hidden email]> wrote:

> You shouldn't have to manually add them each time if you additionally
> install the "Groovy-Eclipse m2Eclipse integration" plugin. It's gmaven aware
> and will setup your eclipse project correctly.
>
>
> On Thu, Jun 23, 2011 at 6:52 AM, Carr, Brian M
> <[hidden email]> wrote:
>>
>> ah, yes... this is the problem.  it's an artifact of having to add the
>> src/main/groovy and src/test/groovy folders to the build path every time i
>> import a project...  Thanks for the assist
>>
>> ______________________________
>> Brian M. Carr
>> Area Lead, Core Identity Management
>> ITS Applications, Identity Management
>> University of Texas at Austin
>> V: 512-232-6419
>> F: 512-232-4985
>> [hidden email]
>>
>> On Jun 22, 2011, at 2:27 PM, Travis Hume wrote:
>>
>> > Ensure that within the project's build configuration src/test/groovy has
>> > an output folder of target/test-classes
>> > On Jun 22, 2011 12:14 PM, "Carr, Brian M" <[hidden email]>
>> > wrote:
>> > > I've seen this weird behavior for some time, but it's just now reached
>> > > enough of a nuisance to ask...
>> > >
>> > > Occasionally when I make a change to a JUnit test, then right click
>> > > the test and choose "Run as JUnit", the previous version of the test is run,
>> > > and not the version I just saved. Sometimes adding a blank to the file and
>> > > saving again is enough to get the test to be recompiled and run, sometimes I
>> > > have to restart eclipse to get the changes picked up.
>> > >
>> > > This is a mixed Java/Groovy project, it's also a maven project, and
>> > > the maven build uses the groovy eclipse compiler.
>> > >
>> > > --b
>> > > ______________________________
>> > > Brian M. Carr
>> > > Area Lead, Core Identity Management
>> > > ITS Applications, Identity Management
>> > > University of Texas at Austin
>> > > V: 512-232-6419
>> > > F: 512-232-4985
>> > > [hidden email]
>> > >
>>
>
>
>
> --
> Travis Hume
> [hidden email]
>
>

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

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Groovy JUnit tests don't update

Carr, Brian M
hmm... i have the following in my pom, but "import -> existing maven projects" seems to ignore buildhelper.  it should be pointed out that maven itself honors the buildhelper settings when compiling.


<build>
<plugins>
...
<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>build-helper-maven-plugin</artifactId>
    <version>1.5</version>
    <executions>
        <execution>
            <id>add-source</id>
            <phase>generate-sources</phase>
            <goals>
                <goal>add-source</goal>
            </goals>
            <configuration>
                <sources>
                    <source>src/main/groovy</source>
                </sources>
            </configuration>
        </execution>
        <execution>
            <id>add-test-source</id>
            <phase>generate-test-sources</phase>
            <goals>
                <goal>add-test-source</goal>
            </goals>
            <configuration>
                <sources>
                    <source>src/test/groovy</source>
                </sources>
            </configuration>
        </execution>
    </executions>
</plugin>
...
</plugins>
</build>


with this configuration, i have to manually right click the src/{main,test}/groovy folders and add them to the build path.  (and now know that i need to then edit the build path to redirect the target folder for test).

--b
______________________________
Brian M. Carr
Area Lead, Core Identity Management
ITS Applications, Identity Management
University of Texas at Austin
V: 512-232-6419
F: 512-232-4985
[hidden email]

On Jun 23, 2011, at 10:00 AM, Andrew Eisenberg wrote:

> I think Brian mentioned that he is using the groovy-eclipse-compiler.
> In this case, you need to use the build-helper-plugin to add the extra
> source folders to your project.  See
> http://groovy.codehaus.org/Groovy-Eclipse+compiler+plugin+for+Maven
>
> On Thu, Jun 23, 2011 at 7:54 AM, Travis Hume <[hidden email]> wrote:
>> You shouldn't have to manually add them each time if you additionally
>> install the "Groovy-Eclipse m2Eclipse integration" plugin. It's gmaven aware
>> and will setup your eclipse project correctly.
>>
>>
>> On Thu, Jun 23, 2011 at 6:52 AM, Carr, Brian M
>> <[hidden email]> wrote:
>>>
>>> ah, yes... this is the problem.  it's an artifact of having to add the
>>> src/main/groovy and src/test/groovy folders to the build path every time i
>>> import a project...  Thanks for the assist
>>>
>>> ______________________________
>>> Brian M. Carr
>>> Area Lead, Core Identity Management
>>> ITS Applications, Identity Management
>>> University of Texas at Austin
>>> V: 512-232-6419
>>> F: 512-232-4985
>>> [hidden email]
>>>
>>> On Jun 22, 2011, at 2:27 PM, Travis Hume wrote:
>>>
>>>> Ensure that within the project's build configuration src/test/groovy has
>>>> an output folder of target/test-classes
>>>> On Jun 22, 2011 12:14 PM, "Carr, Brian M" <[hidden email]>
>>>> wrote:
>>>>> I've seen this weird behavior for some time, but it's just now reached
>>>>> enough of a nuisance to ask...
>>>>>
>>>>> Occasionally when I make a change to a JUnit test, then right click
>>>>> the test and choose "Run as JUnit", the previous version of the test is run,
>>>>> and not the version I just saved. Sometimes adding a blank to the file and
>>>>> saving again is enough to get the test to be recompiled and run, sometimes I
>>>>> have to restart eclipse to get the changes picked up.
>>>>>
>>>>> This is a mixed Java/Groovy project, it's also a maven project, and
>>>>> the maven build uses the groovy eclipse compiler.
>>>>>
>>>>> --b
>>>>> ______________________________
>>>>> Brian M. Carr
>>>>> Area Lead, Core Identity Management
>>>>> ITS Applications, Identity Management
>>>>> University of Texas at Austin
>>>>> V: 512-232-6419
>>>>> F: 512-232-4985
>>>>> [hidden email]
>>>>>
>>>
>>
>>
>>
>> --
>> Travis Hume
>> [hidden email]
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>


smime.p7s (6K) Download Attachment