2 Replies Latest reply on Aug 29, 2011 12:07 AM by smmousavi1

    Supporting test suites

    smmousavi1

      Hi All,

       

      Last several days, I am learning and trying to use the Arquillian test in my project.

      I should say that Arquillian has a very good design and implementation, and I really enjoyed it (if we ignore the lack of good documentation for those like me that not using the Maven, and using Ant. Anyway, it took me 2 days to learn it, find JAR files necessary, and fix errors)

       

      Now, I am using Arquillian in my project, and I can use for my TestCases (I am using JUnit).

      But, I have a question. Does Arquillian support TestSuites too? I am seeing that in following URL, Aslak has a sample for using Arquillian for test suites, but, as long as I search, I can't find the "ArquillianSuite" class. Am I missing something?

       

      http://pastebin.com/TtkUScLS

       

      Let me explain the necessity for the above request.

      As you know, for large projects, there will be many TestCases. And, it is not logical that include all test cases inside ant file for automating all the test cases (for example, for using with Continuous Integration tools, like Jenkines). Therefore, normally, Ant only access one entry point for unit tests, which will be TestSuite. And, the TestSuite will include all those TestCases.

       

      In addition to above need,

      - I don't want to include: @RunWith(Arquillian.class) for all my test cases, and I just want to add @RunWith(ArquillianSuite.class) only in one location, which will be the test suite class.

      - I don't want to include:  public static JavaArchive createTestArchive(){ ... } method in all of my test cases. Rule is to be DRY (Don't Repeat Yourself), and I want to include archieve creation method only in one location, which is test suite. I am not sure about details of Arquillian implementation, but, using createTestArchive() methods ONLY inside test suite, I think it will be un-necessary to deploy/undeploy test JAR/WAR files to web server for each test case.

       

      Thanks.

        • 1. Re: Supporting test suites
          kpiwko

          Hi Mousavi,

           

          the page you have found is only a scratch how it should look in the future. Actually, w.r.t. to @RunAs annotation, it is quite an old scratch.

           

          As for DRY, you can make an abstract class which has @Deployment(s) method, however you'll have to specify @RunWith into each of the (inherrited) classes. Yes, as you suggested this will lead to deploy/undeploy for every testcase.

           

          As for ArquillianSuite, I'm not aware of any other runner than Arquilian, so suite is not supported. Can you please fill a jira containing summary of your question at https://issues.jboss.org/browse/ARQ ? This way we make sure that the SuiteRunner is a requested feature.

           

          Thanks!

          • 2. Re: Supporting test suites
            smmousavi1

            Hi Karel,

            and thank you for your confirmation.

            As you have mentioned in your reply, I have filled a JIRA feature request, as following URL:

             

            https://issues.jboss.org/browse/ARQ-567