Naturally, starting and stopping the container from a test is going to be a preference that some developers will want and others not. That's why I suggested that it would be a system property (or some other configuration mechanism) that you could use to enable this behavior. I can tell you that from experience working with the CDI TCK that this was a very nice feature to have. I'm sure the other guys that worked on the TCK could offer their opinion.
The subject line of your e-mail made me thinking of another possibility. It would be possible to include a Maven plugin configuration that would start and stop the container around the test (or integration) phase of the Maven life cycle. The only downside there is that it wouldn't carry over to the IDE JUnit or TestNG plugin.
So, in general, I think it's a good thing to offer. I also agree that it shouldn't be the only way, perhaps not even the default behavior.
Sorry to come to the conversation late on this, but this e-mail is raising a potential red flag for me. I apologize if this has been already addressed and I missed it, but...
Controlling the lifecycle of a non-embedded container from a build is something you want to be very careful about from a security perspective.
Now, if you have a plugin that requires an explicit command as well as a link in a settings.xml, that seems perfectly reasonable.
I am worried that a someone running "mvn test" for application foo.war could startup non-foo wars because they were deployed to a local container.
Also, I am concerned that it may startup the wrong container and cause similar problems. I usually work on multiple applications at a time and have a container for foo.war and a separate container for bar.war. I may think it is starting up foo's container, but it may startup bar's container and cause trouble.
For me, that can get really dangerous because my applications contact external resources on startup as well as access things like files and bdb databases that are not suitable for usage by multiple applications. They could corrupt the file with simultaneous writes or more likely write duplicate or erroneous data.
I know I sound like a member of the "tin-foil-hat-club" here, but I deal with patient data, so my apps are required by law to be paranoid about security.
On 12/27/2009 03:54 PM, Dan Allen wrote:
Awesome, that will be a good feature to get in.
- Dan Allen
Sent from my Android-powered phone:
An open platform for carriers, consumers
and developers.On Dec 27, 2009 1:35 PM, "Aslak Knutsen" <email@example.com> wrote:
Arquillian 'starts' it, but the container impl does not actually start a not started jboss instance.