Re: Test Execution Listener

Benno Markiewicz <[email protected]>
Newsgroups gmane.comp.java.netbeans.modules.openide.devel
Message-ID <CAA_aP4h_hakeyxpRrMMHdFb5oxoQsnO=K7JMiz7STUuR1GdDxg@mail.gmail.com>
Hi Theofanis,

can you help?

Is there an official way (via public API) to add listeners to the test
execution? So that external plugins can attach to?

I haven't found any documentation about this. There is also no published
documentation about the *.testrunner.* modules in
http://bits.netbeans.org/dev/javadoc/. I guess they are supposed to be used
from external non-friend-modules?!

@Janpridial: You can also have a look at
https://github.com/mkleint/netbeans-continuous-surefire, where Milos hooked
his plugin in the surefire execution. I haven't tried it yet, but it is
worth a shot.

Thanks for your time!

With kind regards, markiewb

2016-03-11 14:44 GMT+01:00 janpridal <[email protected]>:

> Hi,
> I'd like to create a module with following functionality: when user
> executes JUnit test in NetBeans project my module would perform some action
> like notifying an external system (test execution starts/ends with result).
>
> I've noticed that for Maven projects the JUnit test is executed like this:
>
> cd E:\commons; "JAVA_HOME=C:\\jdk1.8" cmd /c
> "\"\"E:\\NetBeans\\java\\maven\\bin\\mvn.bat\" -Dtest=commons.DateUtilsTest
> -Dmaven.ext.class.path=\"E:\\NetBeans\\java\\maven-nblib\\netbeans-eventspy.jar\"
> surefire:test\""
>
> And it looks like that when Maven is not used in project, the JUnit test
> execution is performed differently.
>
> Does it mean there's not a common layer that would allow me to listen for
> the events related to JUnit test execution?
>
> If there's not, is there a way how to listen for such event in case of
> Maven projects to start with?
>
> I've found some stuff in SPI for Ant builds: AntLogger+AntEvent, is there
> something like that for Maven?
>
> Thank you,
> Jan
>
>
>
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.