No @Deployment = Deploy what I found on the classpath?


#1

So talking with Antonio Goncalves at the weekend opened up this thought.

If we remove @Deployment, how about classpath scanning for any deployment and just do it, rather than throwing an error.

This kind of comes off the back of the SpringBoot way that Antonio is currently using. He was working on an EE demo and was complaining a bit that it’s hard to get started on an Arquillian test compared to SpringBoot. I didn’t initially agree, but I use Arquillian a lot, so maybe I find it easy ‘now’.

After sleeping on it the idea started to feel right, @Deployment would then be a kind of override of the default scanning.

There are more scenarios where this could feel right. If there is no impl on the path then just assume the environment is serverless. Like Drone tests might not need to deploy anything, and just test against a running site.

So this is hopefully food for thought.

Best regards,

Andy


#2

Sounds good, although if using CDI, it’s not possible to avoid classes for one test affecting other tests. But in simple scenarios and demos it would greatly simplify writing tests.

I would also consider building deployment by convention, for example taking all classes and resources found in a package derived from test class file name.