maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shane Isbell <shane.isb...@gmail.com>
Subject Re: Maven SureFire Plugin: Android Provider
Date Wed, 13 Jun 2012 23:38:30 GMT
Android has it's own RemoteAndroidTestRunner, so I just invoke the
RemoteAndroidTestRunner.run method to kick off the Android junit tests.

Surefire has a report test lifecycle: testSetStarting, testFailed...These
methods map closely to the events in the RemoteAndroidTestRunner. So I just
created a simple mapping. For an early prototype see:

http://tinyurl.com/7rrv6cx

So I would prefer not to run surefire code directly on the device.

I follow the path:

AbstractSurefireMojo.executeProvider - >
AbstractSurefireMojo.createForkStarter ->
AbstractSurefireMojo.getStartupReportConfiguration - > ForkStarter.new

I just don't see how to configure the StartupReportConfiguration to return
a customized XMLReporter (this reporter implementation queries the device
for its system properties).

I'll keep digging around...but appreciate any further pointers.

Thanks,
Shane

On Wed, Jun 13, 2012 at 1:12 PM, Kristian Rosenvold <
kristian.rosenvold@gmail.com> wrote:

> I would somehow assume that the sensible way to implement an android
> provider would be to extend the current forking logic to serialize the
> entire fork to a remote machine. Furthermore there is already support
> for bringing the system properties from the fork back to the plugin,
> which would come for "free" in this case. I would be considering
> starting the fork in/around the "ForkStarter" java class.
>
> Something in your question makes me think you're starting the fork
> differently?
>
> Kristian
>
>
> 2012/6/13 Shane Isbell <shane.isbell@gmail.com>:
> > Hi all,
> >
> > I'm working on an android provider for surefire. Generally, I have things
> > working but have encountered a specific problem. The unit tests are
> running
> > remotely on a device (not the build machine). For the surefire xml
> report,
> > I need to pull in the system properties on the device, not those on the
> > build machine.
> >
> > The StartupReportConfiguration.instantiateXmlReporter is hardcoded to
> > return XMLReporter. AbstractSurefireMojo.createForkStarter is, in turn,
> > hardcoded to use StartReportConfiguration.
> >
> > So I'm unable to replace the StartReportConfiguration with a class
> > implementation that will return a specialized XMLReporter instance that
> > will return device system properties.
> >
> > Is there a way to handle this situation through the surefire API or is
> this
> > something I need to create a patch for?
> >
> > Thanks,
> > Shane
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message