3 Replies Latest reply on Oct 24, 2011 5:05 AM by zhfeng

    Is it possible to restart jboss container after crash ?

    zhfeng

      Hi,

       

      I want to test web serviece transaction crash recovery.

      currently, I used byteman script to make jvm crash when transaction commit.

       

      basically, I need to restart container after jvm crash.

      My test codes looks like following:

       

      ...

      @RunWith(Arquillian.class)

      public class ATCrashDuringOnePhaseCommitTest {

          @Inject

          private XTSServiceTestRunnerBean testRunner;

         

         @Deployment @TargetsContainer("container-at-crash-during-one-phase-commit")

         public static Archive<?> createTestArchive() {

              WebArchive archive = ShrinkWrap.

              createFromZipFile(WebArchive.class, new File("target/xtstest.war"));

              return archive;   

         }

       

         @Test

         public void SingleParticipantPrepareAndCommitTest() {

             String testName =

                  "org.jboss.jbossts.xts.servicetests.test.at.SingleParticipantPrepareAndCommitTest";

              try {

                   testRunner.runTest(testName);

              } catch (Exception e) {

                   // jvm should crash on commit

                   // restart container to watch recovery

                  ...

              }

              fail("It should be crash by byteman script");

         }

       

      is it possible to do or any other suggestion ?

      Thanks,

       

      Amos