Java Code Examples for org.junit.runner.notification.RunNotifier#fireTestAssumptionFailed()

The following examples show how to use org.junit.runner.notification.RunNotifier#fireTestAssumptionFailed() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractParallelScenarioRunner.java    From xtext-eclipse with Eclipse Public License 2.0 6 votes vote down vote up
protected Statement prepareMethodBlock(final FrameworkMethod method, final RunNotifier notifier) {
	final Statement methodBlock = superMethodBlock(method);
	return new Statement() {
		@Override
		public void evaluate() throws Throwable {
			try {
				methodBlock.evaluate();
				Description description = describeChild(method);
				try {
					notifier.fireTestStarted(description);
					notifier.fireTestAssumptionFailed(new Failure(description, new AssumptionViolatedException("Method " + method.getName() + " did parse any input")));
				} finally {
					notifier.fireTestFinished(description);
				}
			} catch(TestDataCarrier testData) {
				AbstractParallelScenarioRunner.this.testData.put(method, testData.getData());
			}
		}
	};
}
 
Example 2
Source File: AbstractParallelScenarioRunner.java    From xtext-core with Eclipse Public License 2.0 6 votes vote down vote up
protected Statement prepareMethodBlock(final FrameworkMethod method, final RunNotifier notifier) {
	final Statement methodBlock = superMethodBlock(method);
	return new Statement() {
		@Override
		public void evaluate() throws Throwable {
			try {
				methodBlock.evaluate();
				Description description = describeChild(method);
				try {
					notifier.fireTestStarted(description);
					notifier.fireTestAssumptionFailed(new Failure(description, new AssumptionViolatedException("Method " + method.getName() + " did parse any input")));
				} finally {
					notifier.fireTestFinished(description);
				}
			} catch(TestDataCarrier testData) {
				AbstractParallelScenarioRunner.this.testData.put(method, testData.getData());
			}
		}
	};
}
 
Example 3
Source File: DisablablePaxExam.java    From components with Apache License 2.0 5 votes vote down vote up
@Override
public void run(final RunNotifier notifier) {
    if (!SystemUtils.JAVA_VERSION.startsWith("1.8.")) {
        notifier.fireTestAssumptionFailed(new Failure(
                Description.createSuiteDescription(clazz),
                new IllegalStateException("Java " + SystemUtils.JAVA_VERSION + " not yet supported")));
    } else {
        super.run(notifier);
    }
}
 
Example 4
Source File: DisablablePaxExam.java    From components with Apache License 2.0 5 votes vote down vote up
@Override
public void run(final RunNotifier notifier) {
    if (!SystemUtils.JAVA_VERSION.startsWith("1.8.")) {
        notifier.fireTestAssumptionFailed(new Failure(
                Description.createSuiteDescription(clazz),
                new IllegalStateException("Java " + SystemUtils.JAVA_VERSION + " not yet supported")));
    } else {
        super.run(notifier);
    }
}
 
Example 5
Source File: DisablablePaxExam.java    From components with Apache License 2.0 5 votes vote down vote up
@Override
public void run(final RunNotifier notifier) {
    if (!SystemUtils.JAVA_VERSION.startsWith("1.8.")) {
        notifier.fireTestAssumptionFailed(new Failure(
                Description.createSuiteDescription(clazz),
                new IllegalStateException("Java " + SystemUtils.JAVA_VERSION + " not yet supported")));
    } else {
        super.run(notifier);
    }
}
 
Example 6
Source File: DisablablePaxExam.java    From components with Apache License 2.0 5 votes vote down vote up
@Override
public void run(final RunNotifier notifier) {
    if (!SystemUtils.JAVA_VERSION.startsWith("1.8.")) {
        notifier.fireTestAssumptionFailed(new Failure(
                Description.createSuiteDescription(clazz),
                new IllegalStateException("Java " + SystemUtils.JAVA_VERSION + " not yet supported")));
    } else {
        super.run(notifier);
    }
}
 
Example 7
Source File: DisablablePaxExam.java    From components with Apache License 2.0 5 votes vote down vote up
@Override
public void run(final RunNotifier notifier) {
    if (!SystemUtils.JAVA_VERSION.startsWith("1.8.")) {
        notifier.fireTestAssumptionFailed(new Failure(
                Description.createSuiteDescription(clazz),
                new IllegalStateException("Java " + SystemUtils.JAVA_VERSION + " not yet supported")));
    } else {
        super.run(notifier);
    }
}
 
Example 8
Source File: DisablablePaxExam.java    From components with Apache License 2.0 5 votes vote down vote up
@Override
public void run(final RunNotifier notifier) {
    if (!SystemUtils.JAVA_VERSION.startsWith("1.8.")) {
        notifier.fireTestAssumptionFailed(new Failure(
                Description.createSuiteDescription(clazz),
                new IllegalStateException("Java " + SystemUtils.JAVA_VERSION + " not yet supported")));
    } else {
        super.run(notifier);
    }
}
 
Example 9
Source File: DisablablePaxExam.java    From components with Apache License 2.0 5 votes vote down vote up
@Override
public void run(final RunNotifier notifier) {
    if (!SystemUtils.JAVA_VERSION.startsWith("1.8.")) {
        notifier.fireTestAssumptionFailed(new Failure(
                Description.createSuiteDescription(clazz),
                new IllegalStateException("Java " + SystemUtils.JAVA_VERSION + " not yet supported")));
    } else {
        super.run(notifier);
    }
}
 
Example 10
Source File: DisablablePaxExam.java    From components with Apache License 2.0 5 votes vote down vote up
@Override
public void run(final RunNotifier notifier) {
    if (!SystemUtils.JAVA_VERSION.startsWith("1.8.")) {
        notifier.fireTestAssumptionFailed(new Failure(
                Description.createSuiteDescription(clazz),
                new IllegalStateException("Java " + SystemUtils.JAVA_VERSION + " not yet supported")));
    } else {
        super.run(notifier);
    }
}
 
Example 11
Source File: DisablablePaxExam.java    From components with Apache License 2.0 5 votes vote down vote up
@Override
public void run(final RunNotifier notifier) {
    if (!SystemUtils.JAVA_VERSION.startsWith("1.8.")) {
        notifier.fireTestAssumptionFailed(new Failure(
                Description.createSuiteDescription(clazz),
                new IllegalStateException("Java " + SystemUtils.JAVA_VERSION + " not yet supported")));
    } else {
        super.run(notifier);
    }
}
 
Example 12
Source File: OrcasParameterizedParallel.java    From orcas with Apache License 2.0 5 votes vote down vote up
@Override
protected void runChild( Runner pRunner, RunNotifier pNotifier )
{
  OrcasBlockJUnit4ClassRunnerWithParameters lOrcasBlockJUnit4ClassRunnerWithParameters = (OrcasBlockJUnit4ClassRunnerWithParameters)pRunner;
  String lTestName = lOrcasBlockJUnit4ClassRunnerWithParameters.testName;

  try
  {
    assumeShouldExecuteTestcase( lTestName );
  }
  catch( AssumptionViolatedException e )
  {
    Description lDescribeChildRunner = describeChild( pRunner );
    pNotifier.fireTestAssumptionFailed( new Failure( lDescribeChildRunner, e ) );
    pNotifier.fireTestIgnored( lDescribeChildRunner );

    for( FrameworkMethod lChildFrameworkMethod : lOrcasBlockJUnit4ClassRunnerWithParameters.getChildren() )
    {
      Description lDescribeChildFrameworkMethod = lOrcasBlockJUnit4ClassRunnerWithParameters.describeChild( lChildFrameworkMethod );

      pNotifier.fireTestAssumptionFailed( new Failure( lDescribeChildFrameworkMethod, e ) );
      pNotifier.fireTestIgnored( lDescribeChildFrameworkMethod );
    }

    return;
  }

  super.runChild( pRunner, pNotifier );
}