4
votes

I am using Arquillian for testing Java EE application against Glassfish, So far I am facing a performance problem, each Test case takes more than a minute to complete, having 60 Test cases means an hour to run. and hence the build will take more an hour.

I understand that running a test case might take this time in starting a glassfish container, creating and deploying a war file.

Is there a way to group test cases under each project, add all of the classes, create a single Deployment archive and run multiple tests in a single deployment as if they are a single test class?

3

3 Answers

7
votes

Arquillian does not support suites by itself.

But I wrote extension that makes suites testing possible.

https://github.com/ingwarsw/arquillian-suite-extension

There you should find documentation with examples.

1
votes

Are you using an embedded glassfish instance? Because running a remote instance should work faster.

0
votes

Use a test suite (@Suite) and set up your arquillian container in a @BeforeClass annotated method

see http://www.mkyong.com/unittest/junit-4-tutorial-5-suite-test/

Edit :

And if all your class extend an AbstractTestClass which declare the @BeforeClass annotated method which initialize the container only if it's not already done ?