You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by Jonathan Gallimore <jo...@gmail.com> on 2011/05/21 22:36:14 UTC

Arquillian adaptor for TomEE

Hi all,

I hacked up a quick Arquillian adaptor for TomEE which I'm using for a
project at work. Its a bit raw, but I've checked it into the sandbox area.
If you fancy checking it out, any feedback would be welcome!

Cheers

Jon

Re: Arquillian adaptor for TomEE

Posted by Jonathan Gallimore <jo...@gmail.com>.
Hi Vishwa

Thanks for checking out the adaptor, it would be great to take it further.
Hopefully I'll be able to do some more work on it myself next week. We can
definitely add the JBoss repo to the POM (I think I have it in my
settings.xml).

In terms of the dependencies, I've tried to keep them to a minimum, but the
examples I've seen, profiles are added to the POM to add the arquillian and
container dependencies. Then you can switch which container you're testing
with by using a different Maven profile.

I think it would be useful to setup an example in the sandbox along with the
adaptor (Moviefun perhaps) which uses the TomEE Arquillian adaptor and maybe
something like Selenium to run some tests.

Jon

On Sat, Jun 25, 2011 at 11:40 PM, stratwine <to...@gmail.com> wrote:

> Hi Jon,
>
> I was just thinking of starting with writing CDI examples and was wondering
> how write tests. Got reminded of this adaptor. Been having fun, playing
> around with this.. :)
>
> These are a few things that I observed,
>
> The example test is now failing with  http://tinypaste.com/af837d
> http://tinypaste.com/af837d   in the snapshot version of Arquillian. On
> changing it to 1.0.0.Alpha5 version it works fine.
>
> Had to include the jboss-repo to the pom to get the Arquillian artifacts..
> Looks like they haven't got it published in maven central yet.
>
>  <repository>
>          <id>jboss-public-repository-group</id>
>          <name>JBoss Public Maven Repository Group</name>
>
> <url>https://repository.jboss.org/nexus/content/groups/public-jboss/</url>
>          <layout>default</layout>
>          <releases>
>            <enabled>true</enabled>
>            <updatePolicy>never</updatePolicy>
>          </releases>
>          <snapshots>
>            <enabled>true</enabled>
>            <updatePolicy>never</updatePolicy>
>          </snapshots>
>        </repository>
>
>
> And one doubt.. How would we run Arquillian tests using this adaptor.. ? By
> adding this as a dependency in whichever project we write tests ?
>
> I tried it this way.. and got a error on annotating the class with
> @RunWith(Arquillian.class) with Arquillian.class not in classpath.
>
> Commented out the test scope to have the tests running
>
> <dependency>
>        <groupId>org.jboss.arquillian</groupId>
>        <artifactId>arquillian-junit</artifactId>
>        <version>${version.arquillian}</version>
>
>      </dependency>
>
> Will play around more with the adaptor..
>
> -Vishwa
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Arquillian-adaptor-for-TomEE-tp3541150p3625145.html
> Sent from the OpenEJB Dev mailing list archive at Nabble.com.
>

Re: Arquillian adaptor for TomEE

Posted by stratwine <to...@gmail.com>.
Sure.. I'll add the new POM and create a patch.



--
View this message in context: http://openejb.979440.n4.nabble.com/Arquillian-adaptor-for-TomEE-tp3541150p3626004.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.

Re: Arquillian adaptor for TomEE

Posted by Jonathan Gallimore <jo...@gmail.com>.
What sort of thing are you after?

If you like you can add a directory / POM in your working copy and do an
'svn diff' to create a patch, which will include your new directory/project,
or you can attach a zip to the JIRA and we can get that committed for you -
would that work?

Cheers

Jon

On Sun, Jun 26, 2011 at 1:06 PM, stratwine <to...@gmail.com> wrote:

> Oh, thanks for the pointer.. and btw can you create a stub project for
> https://issues.apache.org/jira/browse/OPENEJB-1607
> https://issues.apache.org/jira/browse/OPENEJB-1607  so I could submit
> patches against it..?
>
> -Vishwa
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Arquillian-adaptor-for-TomEE-tp3541150p3625830.html
> Sent from the OpenEJB Dev mailing list archive at Nabble.com.
>

Re: Arquillian adaptor for TomEE

Posted by stratwine <to...@gmail.com>.
Oh, thanks for the pointer.. and btw can you create a stub project for 
https://issues.apache.org/jira/browse/OPENEJB-1607
https://issues.apache.org/jira/browse/OPENEJB-1607  so I could submit
patches against it..?

-Vishwa

--
View this message in context: http://openejb.979440.n4.nabble.com/Arquillian-adaptor-for-TomEE-tp3541150p3625830.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.

Re: Arquillian adaptor for TomEE

Posted by David Blevins <da...@gmail.com>.
For plain CDI & EJB we should model things after openejb3/examples/decorators/ and use the standard EJB 3.1 EJBContainer API.

For servlet stuff it would definitely be cool to get some Arquillian based examples going.  We could use a ton of servlet tests for TomEE in general.


-David

On Jun 25, 2011, at 3:40 PM, stratwine wrote:

> Hi Jon,
> 
> I was just thinking of starting with writing CDI examples and was wondering
> how write tests. Got reminded of this adaptor. Been having fun, playing
> around with this.. :) 
> 
> These are a few things that I observed,
> 
> The example test is now failing with  http://tinypaste.com/af837d
> http://tinypaste.com/af837d   in the snapshot version of Arquillian. On
> changing it to 1.0.0.Alpha5 version it works fine. 
> 
> Had to include the jboss-repo to the pom to get the Arquillian artifacts..
> Looks like they haven't got it published in maven central yet.
> 
> <repository>
>          <id>jboss-public-repository-group</id>
>          <name>JBoss Public Maven Repository Group</name>
> 
> <url>https://repository.jboss.org/nexus/content/groups/public-jboss/</url>
>          <layout>default</layout>
>          <releases>
>            <enabled>true</enabled>
>            <updatePolicy>never</updatePolicy>
>          </releases>
>          <snapshots>
>            <enabled>true</enabled>
>            <updatePolicy>never</updatePolicy>
>          </snapshots>
>        </repository>
> 
> 
> And one doubt.. How would we run Arquillian tests using this adaptor.. ? By
> adding this as a dependency in whichever project we write tests ?
> 
> I tried it this way.. and got a error on annotating the class with
> @RunWith(Arquillian.class) with Arquillian.class not in classpath.
> 
> Commented out the test scope to have the tests running
> 
> <dependency>
>        <groupId>org.jboss.arquillian</groupId>
>        <artifactId>arquillian-junit</artifactId>
>        <version>${version.arquillian}</version>
>    	
>      </dependency>
> 
> Will play around more with the adaptor..
> 
> -Vishwa
> 
> 
> --
> View this message in context: http://openejb.979440.n4.nabble.com/Arquillian-adaptor-for-TomEE-tp3541150p3625145.html
> Sent from the OpenEJB Dev mailing list archive at Nabble.com.


Re: Arquillian adaptor for TomEE

Posted by stratwine <to...@gmail.com>.
Hi Jon,

I was just thinking of starting with writing CDI examples and was wondering
how write tests. Got reminded of this adaptor. Been having fun, playing
around with this.. :) 

These are a few things that I observed,

The example test is now failing with  http://tinypaste.com/af837d
http://tinypaste.com/af837d   in the snapshot version of Arquillian. On
changing it to 1.0.0.Alpha5 version it works fine. 

Had to include the jboss-repo to the pom to get the Arquillian artifacts..
Looks like they haven't got it published in maven central yet.

 <repository>
          <id>jboss-public-repository-group</id>
          <name>JBoss Public Maven Repository Group</name>
         
<url>https://repository.jboss.org/nexus/content/groups/public-jboss/</url>
          <layout>default</layout>
          <releases>
            <enabled>true</enabled>
            <updatePolicy>never</updatePolicy>
          </releases>
          <snapshots>
            <enabled>true</enabled>
            <updatePolicy>never</updatePolicy>
          </snapshots>
        </repository>


And one doubt.. How would we run Arquillian tests using this adaptor.. ? By
adding this as a dependency in whichever project we write tests ?

I tried it this way.. and got a error on annotating the class with
@RunWith(Arquillian.class) with Arquillian.class not in classpath.

Commented out the test scope to have the tests running

<dependency>
        <groupId>org.jboss.arquillian</groupId>
        <artifactId>arquillian-junit</artifactId>
        <version>${version.arquillian}</version>
    	
      </dependency>

Will play around more with the adaptor..

-Vishwa


--
View this message in context: http://openejb.979440.n4.nabble.com/Arquillian-adaptor-for-TomEE-tp3541150p3625145.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.

Re: Arquillian adaptor for TomEE

Posted by Jonathan Gallimore <jo...@gmail.com>.
Thanks! I quite like the way it runs embedded. I've tried to make it require
as little as possible in the classpath, so currently the catalina jar is
needed, but OpenEJB is picked up by deploying the openejb.war file.

The first commit was a bit hacky, as it tried to pick up the openejb.war
from the classpath, the idea being that you could just chuck the war on your
classpath, and it would be picked up automatically. It doesn't seem to play
nicely with Maven though, so although it worked on my machine at the time,
it didn't when I tranferred everything over to my new work machine.

Now, by default it looks for the war file on the file system, and Maven
could be used to download it.

I feel this could be better still though, with the adapter perhaps doing a
download automatically if the war file isn't available rather than relying
on the build system to provide it - the idea is to "skip the build" and test
against as many containers as possible without the developer having to do
too much extra work.

I was thinking of perhaps making the Arquillian developers aware of this
adapter - any thoughts or objections to that? Maybe they would have some
thoughts or suggestions?

Jon

On Fri, May 27, 2011 at 7:32 PM, David Blevins <da...@gmail.com>wrote:

>
> On May 21, 2011, at 1:36 PM, Jonathan Gallimore wrote:
>
> > I hacked up a quick Arquillian adaptor for TomEE which I'm using for a
> > project at work. Its a bit raw, but I've checked it into the sandbox
> area.
> > If you fancy checking it out, any feedback would be welcome!
>
> Cool, looks like it boots TomEE embedded!
>
> Looks pretty good to me.  What is raw about it?
>
>
> -David
>
>

Re: Arquillian adaptor for TomEE

Posted by David Blevins <da...@gmail.com>.
On May 21, 2011, at 1:36 PM, Jonathan Gallimore wrote:

> I hacked up a quick Arquillian adaptor for TomEE which I'm using for a
> project at work. Its a bit raw, but I've checked it into the sandbox area.
> If you fancy checking it out, any feedback would be welcome!

Cool, looks like it boots TomEE embedded!

Looks pretty good to me.  What is raw about it?


-David


Re: Arquillian adaptor for TomEE

Posted by Karan Malhi <ka...@gmail.com>.
Will be trying to write some servlet tests using the Arqullian
adapter. Will probably need your help here

On Sat, May 21, 2011 at 4:36 PM, Jonathan Gallimore
<jo...@gmail.com> wrote:
> Hi all,
>
> I hacked up a quick Arquillian adaptor for TomEE which I'm using for a
> project at work. Its a bit raw, but I've checked it into the sandbox area.
> If you fancy checking it out, any feedback would be welcome!
>
> Cheers
>
> Jon
>



-- 

Karan Singh Malhi
twitter.com/KaranSinghMalhi