Examples of TestRunnerAdaptor


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

   }

   @Test
   public void shouldCallAllWhenTestThrowsException() throws Exception
   {
      TestRunnerAdaptor adaptor = mock(TestRunnerAdaptor.class);
      executeAllLifeCycles(adaptor);

      throwException(Cycle.TEST, new Throwable());

      TestListenerAdapter result = run(adaptor, ArquillianClass1.class);
View Full Code Here

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

   }

   @Test
   public void shouldNotCallArquillianWhenNonArquillianClassIsRan() throws Exception
   {
      TestRunnerAdaptor adaptor = mock(TestRunnerAdaptor.class);
      executeAllLifeCycles(adaptor);

      TestListenerAdapter result = run(adaptor, NonArquillianClass1.class);
      Assert.assertTrue(wasSuccessful(result));
View Full Code Here

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

   }

   @Test
   public void shouldNotCallArquillianWhenNonArquillianGroupIsRan() throws Exception
   {
      TestRunnerAdaptor adaptor = mock(TestRunnerAdaptor.class);
      executeAllLifeCycles(adaptor);

      TestListenerAdapter result = run(new String[]{"non-arq"}, adaptor, NonArquillianClass1.class, ArquillianClass1.class);
      Assert.assertTrue(wasSuccessful(result));
View Full Code Here

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

   }

   @Test @Ignore("ARQ-646")
   public void shouldCallArquillianWhenGroupIsRan() throws Exception
   {
      TestRunnerAdaptor adaptor = mock(TestRunnerAdaptor.class);
      executeAllLifeCycles(adaptor);

      TestListenerAdapter result = run(new String[]{"arq"}, adaptor, NonArquillianClass1.class, ArquillianClass2.class);
      Assert.assertTrue(wasSuccessful(result));
View Full Code Here

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

   }

   @Test // workaround for ARQ-646, enable the arquillian group
   public void shouldCallArquillianWhenArquillianGroupIsActive() throws Exception
   {
      TestRunnerAdaptor adaptor = mock(TestRunnerAdaptor.class);
      executeAllLifeCycles(adaptor);

      TestListenerAdapter result = run(new String[]{"arq", "arquillian"}, adaptor, NonArquillianClass1.class, ArquillianClass2.class);
      Assert.assertTrue(wasSuccessful(result));
View Full Code Here

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

                  "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

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

public class JUnitIntegrationTestCase extends JUnitTestBaseClass
{
   @Test
   public void shouldNotCallAnyMethodsWithoutLifecycleHandlers() throws Exception
   {
      TestRunnerAdaptor adaptor = mock(TestRunnerAdaptor.class);
      when(adaptor.test(isA(TestMethodExecutor.class))).thenReturn(new TestResult(Status.PASSED));
     
      Result result = run(adaptor, ArquillianClass1.class);

      Assert.assertTrue(result.wasSuccessful());
      assertCycle(0, Cycle.values());
View Full Code Here

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

   }
  
   @Test
   public void shouldCallAllMethods() throws Exception
   {
      TestRunnerAdaptor adaptor = mock(TestRunnerAdaptor.class);
      executeAllLifeCycles(adaptor);
     
      Result result = run(adaptor, ArquillianClass1.class);
     
      Assert.assertTrue(result.wasSuccessful());
View Full Code Here

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

   }
  
   @Test
   public void shouldCallAfterClassWhenBeforeThrowsException() throws Exception
   {
      TestRunnerAdaptor adaptor = mock(TestRunnerAdaptor.class);
      executeAllLifeCycles(adaptor);
     
      throwException(Cycle.BEFORE_CLASS, new Throwable());
     
      Result result = run(adaptor, ArquillianClass1.class);
View Full Code Here

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

   }

   @Test
   public void shouldCallAfterWhenBeforeThrowsException() throws Exception
   {
      TestRunnerAdaptor adaptor = mock(TestRunnerAdaptor.class);
      executeAllLifeCycles(adaptor);
     
      throwException(Cycle.BEFORE, new Throwable());
     
      Result result = run(adaptor, ArquillianClass1.class);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.