Package org.jboss.arquillian.test.spi

Examples of org.jboss.arquillian.test.spi.TestRunnerAdaptor


   @BeforeSuite(alwaysRun = true)
   public void arquillianBeforeSuite() throws Exception
   {
      if(deployableTest.get() == null)
      {
         TestRunnerAdaptor adaptor = TestRunnerAdaptorBuilder.build();
         adaptor.beforeSuite();
         deployableTest.set(adaptor); // don't set TestRunnerAdaptor if beforeSuite fails
      }
   }
View Full Code Here


                  "Arquillian has previously been attempted initialized, but failed. See cause for previous exception",
                  State.getInitializationException())));
         }
         else
         {
            final TestRunnerAdaptor adaptor = TestRunnerAdaptorBuilder.build();
            try
            {
               // don't set it if beforeSuite fails
               adaptor.beforeSuite();
               State.testAdaptor(adaptor);
            }
            catch (Exception e)
            {
               // caught exception during BeforeSuite, mark this as failed
               State.caughtInitializationException(e);
               notifier.fireTestFailure(new Failure(getDescription(), e));
            }
         }
      }

      notifier.addListener(new RunListener()
      {
         @Override
         public void testRunFinished(Result result) throws Exception
         {
            State.runnerFinished();
            shutdown();
         }

         private void shutdown()
         {
            try
            {
               if (State.isLastRunner())
               {
                  try
                  {
                     if (State.hasTestAdaptor())
                     {
                        TestRunnerAdaptor adaptor = State.getTestAdaptor();
                        adaptor.afterSuite();
                        adaptor.shutdown();
                     }
                  }
                  finally
                  {
                     State.clean();
View Full Code Here

         else
         {
            try
            {
               // ARQ-1742 If exceptions happen during boot
               TestRunnerAdaptor adaptor = TestRunnerAdaptorBuilder.build();
               // don't set it if beforeSuite fails
               adaptor.beforeSuite();
               State.testAdaptor(adaptor);
            }
            catch (Exception e
            {
               // caught exception during BeforeSuite, mark this as failed
               State.caughtInitializationException(e);
               notifier.fireTestFailure(new Failure(getDescription(), e));
            }
         }
      }
      notifier.addListener(new RunListener()
      {
         @Override
         public void testRunFinished(Result result) throws Exception
         {
            State.runnerFinished();
            shutdown();
         }

         private void shutdown()
         {
            try
            {
               if(State.isLastRunner())
               {
                  try
                  {
                     if(adaptor != null)
                     {
                        adaptor.afterSuite();
                        adaptor.shutdown();
                     }
                  }
                  finally
                  {
                     State.clean();
View Full Code Here

   @BeforeSuite(groups = "arquillian", inheritGroups = true)
   public void arquillianBeforeSuite() throws Exception
   {
      if(deployableTest.get() == null)
      {
         TestRunnerAdaptor adaptor = TestRunnerAdaptorBuilder.build();
         adaptor.beforeSuite();
         deployableTest.set(adaptor); // don't set TestRunnerAdaptor if beforeSuite fails
         cycleStack.get().push(Cycle.BEFORE_SUITE);
      }
   }
View Full Code Here

                              "Arquillian has previously been attempted initialized, but failed. See cause for previous exception",
                              State.getInitializationException())));
         }
         else
         {
            TestRunnerAdaptor adaptor = TestRunnerAdaptorBuilder.build();
            try
            {
               // don't set it if beforeSuite fails
               adaptor.beforeSuite();
               State.testAdaptor(adaptor);
            }
            catch (Exception e
            {
               // caught exception during BeforeSuite, mark this as failed
               State.caughtInitializationException(e);
               notifier.fireTestFailure(new Failure(getDescription(), e));
            }
         }
      }
      // initialization ok, run children
      if(State.hasTestAdaptor()) 
      {
         notifier.addListener(new RunListener()
         {
            @Override
            public void testRunFinished(Result result) throws Exception
            {
               State.runnerFinished();
               shutdown();
            }
           
            private void shutdown()
            {
               try 
               {
                  if(State.hasTestAdaptor() && State.isLastRunner())
                  {
                     try
                     {
                        TestRunnerAdaptor adaptor = State.getTestAdaptor();
                        adaptor.afterSuite();
                        adaptor.shutdown();
                     }
                     finally
                     {
                        State.clean();
                     }
View Full Code Here

                              "Arquillian has previously been attempted initialized, but failed. See cause for previous exception",
                              State.getInitializationException())));
         }
         else
         {
            TestRunnerAdaptor adaptor = TestRunnerAdaptorBuilder.build();
            try
            {
               // don't set it if beforeSuite fails
               adaptor.beforeSuite();
               State.testAdaptor(adaptor);
            }
            catch (Exception e
            {
               // caught exception during BeforeSuite, mark this as failed
               State.caughtInitializationException(e);
               notifier.fireTestFailure(new Failure(getDescription(), e));
            }
         }
      }
      // initialization ok, run children
      if(State.hasTestAdaptor()) 
      {
         notifier.addListener(new RunListener()
         {
            @Override
            public void testRunFinished(Result result) throws Exception
            {
               State.runnerFinished();
               shutdown();
            }
           
            private void shutdown()
            {
               try 
               {
                  if(State.hasTestAdaptor() && State.isLastRunner())
                  {
                     try
                     {
                        TestRunnerAdaptor adaptor = State.getTestAdaptor();
                        adaptor.afterSuite();
                        adaptor.shutdown();
                     }
                     finally
                     {
                        State.clean();
                     }
View Full Code Here

TOP

Related Classes of org.jboss.arquillian.test.spi.TestRunnerAdaptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.