Package junit.framework

Examples of junit.framework.TestResult.wasSuccessful()


    protected void executeTest(Class test, Permission missingPermission) {
        TestSuite suite = new TestSuite();
        suite.addTestSuite(test);
        TestResult result = new TestResult();
        suite.run(result);
        if (result.wasSuccessful()) {
            if (missingPermission == null) {
                return;
            } else {
                fail("Security test expected an AccessControlException on " + missingPermission + ", but did not receive one");
            }
View Full Code Here


    * @param args DOCUMENT_ME
    */
   public static void main( String[] args )
   {
      TestResult result = TestRunner.run( IoUtilsTestCase.suite(  ) );
      if ( !result.wasSuccessful(  ) )
      {
         System.exit( 1 );
      }
   }

View Full Code Here

        // } catch (java.lang.InternalError e1){
        // System.out.println("Error with class "+n+" "+e1);
        // }
        //System.out.println("------------");
        // --
        System.exit(result.wasSuccessful() ? 0 : 1); // this is needed because the test may start the AWT EventQueue thread which is not a daemon.
    }

    /**
     * An overridable method that initializes the logging for the unit test run,
     * using the properties file passed in as the second argument.
View Full Code Here

            } catch (IllegalAccessException e) {
                tr.addError(theClazz, e);
            } catch (IllegalArgumentException e) {
                tr.addError(theClazz, e);
            }
            if ( !tr.wasSuccessful() ){
                sresult.setSuccessful(false);
                StringBuilder buf = new StringBuilder();
                StringBuilder buftrace = new StringBuilder();
                Enumeration<TestFailure> en;
                if (getAppendError()) {
View Full Code Here

      // run current test
      TestResult results = aTestRunner.doRun(suite);

      // check test result
      if (results.wasSuccessful() == false) {
        return false;
      }
      return true;
    } catch (Exception e) {
      System.out.println(e.getMessage());
View Full Code Here

                    Object value = entry.getValue();
                    System.out.println(key+" = "+value);
                }
                System.out.println("_________________________________________________");

                if (!r.wasSuccessful())
                    System.exit(FAILURE_EXIT);
                System.exit(SUCCESS_EXIT);
            } catch (Exception e) {
                System.err.println(e.getMessage());
                System.exit(EXCEPTION_EXIT);
View Full Code Here

            test.setCounts(results.runCount(), results.failureCount(), results.errorCount());
            // rollback all entity operations performed by the delegator
            testDelegator.rollback();
            xml.endTestSuite(test);

            if (!results.wasSuccessful()) {
                failedRun = true;
            }

            // display the results
            Debug.logInfo("[JUNIT] Results for test suite: " + suite.getName(), module);
View Full Code Here

                failedRun = true;
            }

            // display the results
            Debug.logInfo("[JUNIT] Results for test suite: " + suite.getName(), module);
            Debug.logInfo("[JUNIT] Pass: " + results.wasSuccessful() + " | # Tests: " + results.runCount() + " | # Failed: " +
                    results.failureCount() + " # Errors: " + results.errorCount(), module);
            if (Debug.importantOn()) {
                Debug.logInfo("[JUNIT] ----------------------------- ERRORS ----------------------------- [JUNIT]", module);
                Enumeration<?> err = results.errors();
                if (!err.hasMoreElements()) {
View Full Code Here

  {
    TestRunner aTestRunner= new TestRunner();
    try
    {
      TestResult r= aTestRunner.start(args);
      if (!r.wasSuccessful())
      {
        System.exit(FAILURE_EXIT);
      }
      System.exit(SUCCESS_EXIT);
    }
View Full Code Here

                new TKTestRunner(repetitions, duration, threads, (delay == null) ? 0 : delay, params, testCaseName,
                    reportDir, testRunName, csvResults, xmlResults, decoratorFactories);

            TestResult testResult = testRunner.start(testClassName);

            if (!testResult.wasSuccessful())
            {
                System.exit(FAILURE_EXIT);
            }
        }
        catch (Exception e)
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.