Package org.junit.runner

Examples of org.junit.runner.Result.wasSuccessful()


      TestRunnerAdaptor adaptor = mock(TestRunnerAdaptor.class);
      when(adaptor.test(isA(TestMethodExecutor.class))).thenReturn(TestResult.passed());
     
      Result result = run(adaptor, ArquillianClass1.class);

      Assert.assertTrue(result.wasSuccessful());
      assertCycle(0, Cycle.values());
     
      verify(adaptor, times(1)).beforeSuite();
      verify(adaptor, times(1)).afterSuite();
   }
View Full Code Here


      TestRunnerAdaptor adaptor = mock(TestRunnerAdaptor.class);
      executeAllLifeCycles(adaptor);
     
      Result result = run(adaptor, ArquillianClass1.class);
     
      Assert.assertTrue(result.wasSuccessful());
      assertCycle(1, Cycle.values());

      verify(adaptor, times(1)).beforeSuite();
      verify(adaptor, times(1)).afterSuite();
   }
View Full Code Here

      executeAllLifeCycles(adaptor);
     
      throwException(Cycle.BEFORE_CLASS, new Throwable());
     
      Result result = run(adaptor, ArquillianClass1.class);
      Assert.assertFalse(result.wasSuccessful());
     
      assertCycle(1, Cycle.BEFORE_CLASS, Cycle.AFTER_CLASS);
      assertCycle(0, Cycle.BEFORE, Cycle.AFTER, Cycle.TEST);
  
      verify(adaptor, times(1)).beforeSuite();
View Full Code Here

      executeAllLifeCycles(adaptor);
     
      throwException(Cycle.BEFORE, new Throwable());
     
      Result result = run(adaptor, ArquillianClass1.class);
      Assert.assertFalse(result.wasSuccessful());
     
      assertCycle(1, Cycle.BEFORE_CLASS, Cycle.AFTER_CLASS, Cycle.BEFORE, Cycle.AFTER);
      assertCycle(0, Cycle.TEST);

      verify(adaptor, times(1)).beforeSuite();
View Full Code Here

   {
      TestRunnerAdaptor adaptor = mock(TestRunnerAdaptor.class);
      executeAllLifeCycles(adaptor);
     
      Result result = run(adaptor, ArquillianClass1.class, ArquillianClass1.class, ArquillianClass1.class, ArquillianClass1.class);
      Assert.assertTrue(result.wasSuccessful());

      verify(adaptor, times(1)).beforeSuite();
      verify(adaptor, times(1)).afterSuite();
   }
  
View Full Code Here

      executeAllLifeCycles(adaptor);

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

      Result result = run(adaptor, ArquillianClass1.class);
      Assert.assertFalse(result.wasSuccessful());

      assertCycle(1, Cycle.values());

      verify(adaptor, times(1)).beforeSuite();
      verify(adaptor, times(1)).afterSuite();
View Full Code Here

      executeAllLifeCycles(adaptor);

      Result result = run(adaptor, ArquillianClass1WithTimeout.class);

      Assert.assertFalse(result.wasSuccessful());
      Assert.assertTrue(result.getFailures().get(0).getMessage().contains("timed out"));
      assertCycle(1, Cycle.BEFORE_CLASS, Cycle.BEFORE, Cycle.AFTER, Cycle.AFTER_CLASS);

      verify(adaptor, times(1)).beforeSuite();
      verify(adaptor, times(1)).afterSuite();
View Full Code Here

      executeAllLifeCycles(adaptor);

      Result result = run(adaptor, ArquillianClass1WithExpectedExceptionRule.class);

      Assert.assertTrue(result.wasSuccessful());
      assertCycle(1, Cycle.BEFORE_CLASS, Cycle.BEFORE, Cycle.TEST, Cycle.AFTER, Cycle.AFTER_CLASS);

      verify(adaptor, times(1)).beforeSuite();
      verify(adaptor, times(1)).afterSuite();
   }
View Full Code Here

      executeAllLifeCycles(adaptor);

      Result result = run(adaptor, ArquillianClass1WithExpectedException.class);

      Assert.assertTrue(result.wasSuccessful());
      assertCycle(1, Cycle.BEFORE_CLASS, Cycle.BEFORE, Cycle.TEST, Cycle.AFTER, Cycle.AFTER_CLASS);

      verify(adaptor, times(1)).beforeSuite();
      verify(adaptor, times(1)).afterSuite();
   }
View Full Code Here

              assumptionFailure.add(failure);
        }
      }, ArquillianClass1WithAssume.class);

      Assert.assertEquals(1, assumptionFailure.size());
      Assert.assertTrue(result.wasSuccessful());
      Assert.assertEquals(0, result.getFailureCount());
      Assert.assertEquals(0, result.getIgnoreCount());
      assertCycle(1, Cycle.BEFORE_CLASS, Cycle.BEFORE, Cycle.AFTER, Cycle.AFTER_CLASS);

      verify(adaptor, times(1)).beforeSuite();
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.