I recently started using TestNG, and am not yet at the
point in my project where my tests are actually
automated. I'm still tweaking things and running the
tests through a browser.
I added a doGet() method that searches for a testng.xml
file in the classpath, and runs the specified tests.
It writes the results to the same directory that the
TestNGEEServlet is mapped to (this requires that the
servlet-mapping contains a trailing slash). This
allows a user to click "reload" and re-run the tests,
then re-display the results.
I think this makes sense, but please let me know if you
think there is a better way to go about it.
Also, I must note that I coded this patch against
TestNG 4.6.1, the most recent version. The seemed to
break a piece of the Ant task that referenced a
protected variable in TestNG (m_groups was the name, I
believe).
I don't know anything about the Ant task, so I did not
look into it.
It seems that the current implementation of
TestNGEEServlet expects to receive a zip file
containing testng.xml files. It then runs the tests,
zips up the results and sends them back to the client.
It's an interesting idea, but I'm a bit skeptical if
this is the behavior that most users would desire.
Perhaps there should be a set of different servlets (or
strategies, maybe) that could provide different testing
techniques under the hood.
But perhaps these ideas are better suited for the
mailing list. Again, let me know if you have any
concerns with the patch -- for now I'm using my local
customized version, but it would be great to see this
functionality in the CVS version.
Thanks!
added TestNGEEServlet.doGet()