Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-dev] example of tests for m2e plugin based on BuildContext



On 12-10-16 5:00 PM, Steven Bethard wrote:
On Oct 16, 2012, at 2:53 PM, Vlad Tatavu <vtatavu@xxxxxxxxxxxx> wrote:
I haven't worked with the BuildContext (and related) in quite a while
now, but IIRC, in pure maven world, the BuildContext is a noop.   So I
would say u need tycho in order to test this.

So is the idea to have just the Maven plugin project, and then a single Tycho "eclipse-test-plugin" project?


Yes, this seems to be the easiest way to test maven plugin behaviour
inside m2e workspace.

--
Regards,
Igor




Steve

On 10/16/2012 4:42 PM, Steven Bethard wrote:
[Moving from m2e-users to m2e-dev as suggested there.]

I've been updating a code-generation plugin to use BuildContext (http://wiki.eclipse.org/M2E_compatible_maven_plugins) instead of having a separate m2e connector (http://wiki.eclipse.org/M2E_compatible_maven_plugins).

How do I write integration tests for this Maven plugin? Basically I want to be able to test things like:
* I modified a grammar file in Eclipse. Did the code generation run? (It should have.)
* I modified an unrelated Java file in Eclipse. Did the code generation run? (It shouldn't have.)

With the m2e connector approach, I had a Tycho project with a class that extended org.eclipse.m2e.tests.common.AbstractMavenProjectTestCase. But with the BuildContext approach, I'm no longer using Tycho, since I'm just building a regular Maven plugin. How do I test that my plugin integrates properly with m2e?

Steve

On Oct 16, 2012, at 2:23 PM, Matthew Piggott <mpiggott@xxxxxxxxxxxx> wrote:

I haven't worked actively on the new stuff, but I think you should be able to model a separate maven module on a test bundle of a plugin using the connector approach.

It would probably be best to move the conversation to m2e-dev

On 16 October 2012 16:09, Steven Bethard <steven.bethard@xxxxxxxxxxxx> wrote:
On Oct 16, 2012, at 2:05 PM, Matthew Piggott <mpiggott@xxxxxxxxxxxx> wrote:
The tests expect to be run inside an Eclipse instance.  For examples you could look at the tests in m2e source, or one of the connectors in m2e-extras ( https://github.com/sonatype/m2eclipse-extras/ ).
Yeah, the problem is that those are all based off of the m2e-connector approach (http://wiki.eclipse.org/M2E/Extension_Development), not the new BuildContext approach (http://wiki.eclipse.org/M2E_compatible_maven_plugins).

I already have a working m2e-connector approach based off the m2eclipse-extras examples. I was just hoping to migrate to the BuildContext approach because then there's only the Maven plugin to maintain, not both a Maven plugin and an Eclipse plugin.

Steve
_______________________________________________
m2e-dev mailing list
m2e-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-dev



_______________________________________________
m2e-dev mailing list
m2e-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-dev

_______________________________________________
m2e-dev mailing list
m2e-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-dev



Back to the top