3 Replies Latest reply on Jun 7, 2010 11:32 AM by aslak

    passing test properties

    mwringe

      SInce Arquillian will turn the test on the server which is running on a  different jvm, setting a system property for surefire wont work. What should be the proper way to pass a test property to the actual test?

        • 1. Re: passing test properties
          aslak

          Not sure how we could do that pr test case...

           

          Some possible solutions:

           

          • Start the container with the required sys env
          • Deploy a properties file that the application can read for the variables needed
          • Arquillian could in theory use System.setProperty during test execution, but it might be to late depending on who needs the variables

           

          What kind of properties do you need to set?

          • 2. Re: passing test properties
            mwringe

            ok, if I start the server separately with system properties that can work.

             

            What kind of properties do you need to set?

             

            My test may need to use a url (to connect to an external webservice, to access a file on the system, etc), maybe I want to set a flag to only run parts of a specific test under certain situations, etc...

             

            I don't know why I need to justify being able to pass a property to a test, its a common feature of test frameworks

            • 3. Re: passing test properties
              aslak

              Matt Wringe wrote:

               

              I don't know why I need to justify being able to pass a property to a test, its a common feature of test frameworks

              hehe, you didn't need to justify passing properties. I was just wondering if these were container related or test case related.