开发者

Maven tests vs ant tests (more specifically now)

开发者 https://www.devze.com 2023-03-26 22:34 出处:网络
Ok, a little backstory on this one. I\'m responsible for translating a project from a (terrible) ant build to a maven build. My first step was to simply remake the final EAR as similar as the Ant one,

Ok, a little backstory on this one. I'm responsible for translating a project from a (terrible) ant build to a maven build. My first step was to simply remake the final EAR as similar as the Ant one, so as not to trouble the other team.

I did it all perfectly (thanks for you guys, who answered a few questions before).

However, now I've hit a brickwall. The ant tests.

They used to run ant tests, right from Eclipse. From what I've gathered from their build.xml, they create a small jar, deploy it (on Jetty), test it, and und开发者_如何转开发eploy it.

I've been trying to make the same tests with maven (thought not on the same way), and was unable to reproduce it. However, I think I'm approaching it the wrong way. I'm simply running the tests with surefire plugin against the EJBs already deployed on my JBoss.

Why am I doing that? Because I want the passing tests be a condition for a successfull deploy on JBoss. I don't want to deploy it if it's not passing the tests. Making a jar, and deploying aftewards won't test beforehand, just after (since I'll be testing it against the compiled and deployed ear). Any hints?

Should I just follow the same pattern they (the other team) used to follow? Or can I do it another way?

Thanks for any responses!

André Cardoso PS.: sorry for my mangled english, it's not my first language!


The solution is to create a separate module which contains the integration-tests which means in your case start JBoss, deploy the archive, run the tests against it and shut down JBoss.

0

精彩评论

暂无评论...
验证码 换一张
取 消