Package org.junit

Examples of org.junit.Ignore


        return testMethods;
      testClassesRun.add(getTestClass().getJavaClass().getSimpleName());
      testMethods = new ArrayList<FrameworkMethod>();
      for (Method m : getTestClass().getJavaClass().getMethods()) {
        // check if the current test's class has methods annotated with @Ignore
        final Ignore ignored = m.getAnnotation(Ignore.class);
        if (ignored != null && !m.getName().equals("alwaysIgnoredTestMethod")) {
          System.err.println("NOTE: Ignoring test method '" + m.getName() + "': " + ignored.value());
        }
        // add methods starting with "test"
        final int mod = m.getModifiers();
        if (m.getAnnotation(Test.class) != null ||
            (m.getName().startsWith("test") &&
View Full Code Here


        return testMethods;
      testClassesRun.add(getTestClass().getJavaClass().getSimpleName());
      testMethods = new ArrayList<FrameworkMethod>();
      for (Method m : getTestClass().getJavaClass().getMethods()) {
        // check if the current test's class has methods annotated with @Ignore
        final Ignore ignored = m.getAnnotation(Ignore.class);
        if (ignored != null && !m.getName().equals("alwaysIgnoredTestMethod")) {
          System.err.println("NOTE: Ignoring test method '" + m.getName() + "': " + ignored.value());
        }
        // add methods starting with "test"
        final int mod = m.getModifiers();
        if (m.getAnnotation(Test.class) != null ||
            (m.getName().startsWith("test") &&
View Full Code Here

        }
        return getSuites().get(suiteName);
    }

    public String getIgnoredMessage(Description description) {
        Ignore ignore = description.getAnnotation(Ignore.class);
        return ignore == null || ignore.value().isEmpty() ? "Test ignored (without reason)!" : ignore.value();
    }
View Full Code Here

        // Now process that full list of test methods and build our custom result
        final List<FrameworkMethod> result = new ArrayList<FrameworkMethod>();
    final boolean doValidation = Boolean.getBoolean( Helper.VALIDATE_FAILURE_EXPECTED );
    int testCount = 0;

    Ignore virtualIgnore;

    for ( FrameworkMethod frameworkMethod : methods ) {
      // potentially ignore based on expected failure
            final FailureExpected failureExpected = Helper.locateAnnotation( FailureExpected.class, frameworkMethod, getTestClass() );
      if ( failureExpected != null && !doValidation ) {
View Full Code Here

    }
   
    // HACK: junit gives us no way to do this in LuceneTestCase
    try {
      Class<?> clazz = Class.forName(suite.getName());
      Ignore ignore = clazz.getAnnotation(Ignore.class);
      if (ignore != null) {
        if (systemError == null) systemError = "";
        systemError += "NOTE: Ignoring test class '" + clazz.getSimpleName() + "': "
                    + ignore.value() + StringUtils.LINE_SEP;
      }
    } catch (ClassNotFoundException e) { /* no problem */ }
    // END HACK
   
    if (systemError != null && systemError.length() > 0) {
View Full Code Here

    }
   
    // HACK: junit gives us no way to do this in LuceneTestCase
    try {
      Class<?> clazz = Class.forName(suite.getName());
      Ignore ignore = clazz.getAnnotation(Ignore.class);
      if (ignore != null) {
        if (systemError == null) systemError = "";
        systemError += "NOTE: Ignoring test class '" + clazz.getSimpleName() + "': "
                    + ignore.value() + StringUtils.LINE_SEP;
      }
    } catch (ClassNotFoundException e) { /* no problem */ }
    // END HACK
   
    if (systemError != null && systemError.length() > 0) {
View Full Code Here

        return testMethods;
      testClassesRun.add(getTestClass().getJavaClass().getSimpleName());
      testMethods = new ArrayList<FrameworkMethod>();
      for (Method m : getTestClass().getJavaClass().getMethods()) {
        // check if the current test's class has methods annotated with @Ignore
        final Ignore ignored = m.getAnnotation(Ignore.class);
        if (ignored != null && !m.getName().equals("alwaysIgnoredTestMethod")) {
          System.err.println("NOTE: Ignoring test method '" + m.getName() + "': " + ignored.value());
        }
        // add methods starting with "test"
        final int mod = m.getModifiers();
        if (m.getAnnotation(Test.class) != null ||
            (m.getName().startsWith("test") &&
View Full Code Here

      // GH-82: try to determine the reason why the test has been ignored and populate
      // the cause message. This really should be passed from the runner but the API does
      // not allow it.
      String cause = "Unknown reason for ignore status.";
      try {
        Ignore ignoreAnn = description.getAnnotation(Ignore.class);
        if ((ignoreAnn = description.getAnnotation(Ignore.class)) != null) {
          cause = "Annotated @Ignore(" + ignoreAnn.value() + ")";
        } else {
          // Try class.
          ignoreAnn = description.getTestClass().getAnnotation(Ignore.class);
          if (ignoreAnn != null) {
            cause = "Class annotated @Ignore(" + ignoreAnn.value() + ")";
          }
        }
      } catch (Throwable t) {
        // Never fail on this.
      }
View Full Code Here

    Random r = new Random(runnerSeed);
   
    testMethods = new ArrayList<FrameworkMethod>();
    for (Method m : getTestClass().getJavaClass().getMethods()) {
      // check if the current test's class has methods annotated with @Ignore
      final Ignore ignored = m.getAnnotation(Ignore.class);
      if (ignored != null && !m.getName().equals("alwaysIgnoredTestMethod")) {
        System.err.println("NOTE: Ignoring test method '" + m.getName() + "': " + ignored.value());
      }
      // add methods starting with "test"
      final int mod = m.getModifiers();
      if (m.getAnnotation(Test.class) != null ||
          (m.getName().startsWith("test") &&
View Full Code Here

TOP

Related Classes of org.junit.Ignore

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.