Package org.junit.runner

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


      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

      executeAllLifeCycles(adaptor);

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

      Assert.assertFalse(result.wasSuccessful());
      Assert.assertEquals(2,  result.getFailureCount());
      Assert.assertTrue(result.getFailures().get(0).getMessage().equals("BeforeException"));
      Assert.assertTrue(result.getFailures().get(1).getMessage().equals("AfterException"));
      assertCycle(1, Cycle.BEFORE_CLASS, Cycle.BEFORE, Cycle.AFTER, Cycle.AFTER_CLASS);
      assertCycle(0, Cycle.TEST);
View Full Code Here

      }
    } );
   
    Result r = c.run( MainIOTClient.class );
   
    if (!r.wasSuccessful())
    {
      System.err.printf( "MainIOTClient: tests failed (%d/%d/%d)",
        r.getRunCount(), r.getIgnoreCount(), r.getFailureCount() );
      System.err.println();
      System.exit( 1 );
View Full Code Here

      for (Failure f: r.getFailures()) {
         System.out.println("---------------------- " + f.getTestHeader() + "------------------------\n");
         System.out.println(f.getTrace());
      }

      if (!r.wasSuccessful())
         System.out.println(r.getFailureCount() + " Fehler insgesamt");
   }
}
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.