Sounds very good! I am still within Christmas visits, so cannot fully
respond in detail right now. But find some first comments inline.


On Mon, Dec 26, 2011 at 9:31 PM, Harald Wellmann <
[email protected]> wrote:

> With Pax Exam 2.x, you can write tests which launch an OSGi container,
> automatically install a test probe bundle, inject container dependencies
> into the test and invoke test methods within the container.
>
> Now why should the container be limited to an OSGi framework and the probe
> be limited to a bundle?
>

This is very true, and was also part of the Pax Exam 1 to 2 move:
generalize things to allow different container implementations for the
typical "start, provision, test, teardown" cycle. In early Exam 2 forks
there was even an Android spike, that has basically the same idea. To ship
Exam2 at some point at all it was never realized/finished (yet).
So, yes, you are on the exact correct path. ;)

>
> The same approach works for Java EE: the container is an (embedded) Java
> EE server, the probe is a WAR built on the fly, and the injection method is
> CDI.
>
> There is a growing number of Java EE servers which are built on OSGi
> and/or offer an OSGi subsystem for deploying bundles in addition to
> traditional WARs.
>
> Thus, an in-container testing framework should support both modes, OSGi
> and Java EE, to let you test hybrid applications.
>
> As it happens, I created the jeeunit project [1] in 2010 for testing my
> Java EE 6 projects - long before I started working with Pax Exam.
>
> The more I work with these two projects, the more I feel they are really
> two sides of the same coin.
>
> jeeunit supports GlassFish 3.1, JBoss AS 7 and Resin 4. Recently, its
> scope has broadened to cover other containers and injection methods in the
> guise of Tomcat 6 and 7 and Spring. There is no OSGi support.
>
> Pax Exam on the other hand supports practically all OSGi frameworks, but
> no Java EE or servlet containers.
>
> Now I'm proposing to merge jeeunit into Pax Exam to provide adequate
> testing capabilities for containers that support hybrid OSGi plus Java EE
> applications and to offer a unified testing approach for users who switch
> between OSGi, Java EE and Spring.
>
> Working with a pure OSGi or a pure Java EE container, the resulting Pax
> Exam 3.0 would be equivalent to either Pax Exam 2.x or jeeunit, but on a
> hybrid container, Pax Exam 3.x would let you deploy and test WARs and
> bundles at the same time.
>

+1
As said before, the general pattern is not limited to OSGi at all. At some
point (maybe even in some pom.xml) there was the <description>Testing
Framework for Modern Java Platforms</description>.
Long time idea.



> This should be doable by introducing a bunch of new options like war(),
> mavenWar() and a number of new pax-exam-container-foo modules.
>
> As a proof of concept, I've started working on a GlassFish Container,
> guided by Sahoo's usage of Pax Exam 2.1 for testing OSGi bundles and WABs
> on GlassFish [2].
>
> I'm looking forward to your comments on this idea.
>
More comments after xmas/newyear phase.

>
> [1] http://code.google.com/p/**jeeunit/<http://code.google.com/p/jeeunit/>
> [2] http://www.java.net/forum/**topic/glassfish/glassfish/**
> using-glassfish-pax-exam<http://www.java.net/forum/topic/glassfish/glassfish/using-glassfish-pax-exam>
>
> Best regards,
> Harald
>

Enjoy!


>
> ______________________________**_________________
> general mailing list
> [email protected]
> http://lists.ops4j.org/**mailman/listinfo/general<http://lists.ops4j.org/mailman/listinfo/general>
>



-- 
Toni Menzel Source <http://tonimenzel.com>
_______________________________________________
general mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/general

Reply via email to