1 Reply Latest reply on Apr 20, 2011 4:23 PM by Stan Silvert

    Start JBoss if not running before tests

    Robert Gary Newbie

      How can I determine if JBoss is running before starting my tests? I'm using cactus and am doing...

       

              <cargo  containerid="jboss6x" home="c:\jboss"  output="jbossoutput.log"

                     log="cargo.log" action="start" >

                  <configuration >

                          <property name="cargo.servlet.port" value="80"/>

                          <property name="cargo.logging" value="high"/>

                      <property name="cargo.jboss.configuration" value="myserver"/>

                  </configuration>

              </cargo>

       

      However, it tries to start the server whether or not its already running.

       

      -Robert

        • 1. Start JBoss if not running before tests
          Stan Silvert Master

          That's a good question.  It seems that cargo should take care of that for you, but I guess I see why they don't do it since you would need to tell it about HTTP ports or JMX ports to query.

           

          The easiest way I can think of is to write a simple JUnit (not JSFUnit) test.  In that test, ping your HTTP port to find out if JBoss is running.  Since HtmlUnit is already there, I would use that.  Let that run during the normal test phase and set a flag somewhere.  When you hit cargo in the integration-test phase it would look at the flag and know if JBoss is running or not.  I don't know the details of the implementation, but that's the best approach I can think of.

           

          Stan