本文整理汇总了Java中org.junit.runner.notification.RunNotifier.fireTestIgnored方法的典型用法代码示例。如果您正苦于以下问题:Java RunNotifier.fireTestIgnored方法的具体用法?Java RunNotifier.fireTestIgnored怎么用?Java RunNotifier.fireTestIgnored使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.junit.runner.notification.RunNotifier
的用法示例。
在下文中一共展示了RunNotifier.fireTestIgnored方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: run
import org.junit.runner.notification.RunNotifier; //导入方法依赖的package包/类
final void run(final RunNotifier notifier) {
RunNotifier nested = new RunNotifier();
NestedRunListener nestedListener = new NestedRunListener(notifier);
nested.addListener(nestedListener);
try {
runEnabledTests(nested);
} finally {
nestedListener.cleanup();
}
for (Description disabledTest : disabledTests) {
nested.fireTestStarted(disabledTest);
nested.fireTestIgnored(disabledTest);
}
}
示例2: runChild
import org.junit.runner.notification.RunNotifier; //导入方法依赖的package包/类
@Override
protected void runChild(Spec spec, RunNotifier notifier) {
List<Spec> specs = spec.getSuite().getSpecs();
boolean suiteHasNoSpecs = specs.isEmpty();
boolean isFirstSpec = specs.indexOf(spec) == 0;
boolean isLastSpec = specs.indexOf(spec) == specs.size() -1;
if (suiteHasNoSpecs || isFirstSpec){
runBeforeCallbacks(spec);
}
if (spec.getBlock().isPresent()) {
runBeforeEachCallbacks(spec);
runLeaf(spec, describeChild(spec), notifier);
runAfterEachCallbacks(spec);
} else {
notifier.fireTestIgnored(describeChild(spec));
}
if (suiteHasNoSpecs || isLastSpec){
runAfterCallbacks(spec);
}
}
示例3: runChild
import org.junit.runner.notification.RunNotifier; //导入方法依赖的package包/类
@Override
protected void runChild(final FrameworkMethod method, RunNotifier notifier) {
boolean isOnlyTransactional;
try {
isOnlyTransactional = isOnlyTransactional();
// System.err.println("isOnlyTransactional:" + isOnlyTransactional);
}
catch (IOException e) {
isOnlyTransactional = false;
}
if (!isOnlyTransactional) {
super.runChild(method, notifier);
return;
}
Description description = describeChild(method);
if (method.getAnnotation(Transactional.class) == null) {
notifier.fireTestIgnored(description);
}
else {
super.runChild(method, notifier);
}
}
示例4: runChild
import org.junit.runner.notification.RunNotifier; //导入方法依赖的package包/类
@Override
protected void runChild( final FrameworkMethod method, RunNotifier notifier )
{
Description description = describeChild( method );
if ( method.getAnnotation( Ignore.class ) != null )
{
notifier.fireTestIgnored( description );
}
else
{
if ( method.getAnnotation( Repeat.class ) != null && method.getAnnotation( Ignore.class ) == null )
{
retryCount = method.getAnnotation( Repeat.class ).retryCount();
sleepTime = method.getAnnotation( Repeat.class ).sleepTime();
}
runTestUnit( methodBlock( method ), description, notifier );
}
}
示例5: runChild
import org.junit.runner.notification.RunNotifier; //导入方法依赖的package包/类
@Override
protected void runChild(FrameworkMethod method, RunNotifier notifier) {
Description description = describeChild(method);
// check Ignore first
if (method.getAnnotation(Ignore.class) != null) {
notify("@Ignore", description);
notifier.fireTestIgnored(description);
} else if (localTestsEnabled && method.getAnnotation(RemoteOnly.class) != null) {
// if running in local mode and @RemoteOnly annotation exists, ignore
notify("Skip @RemoteOnly", description);
notifier.fireTestIgnored(description);
} else if (remoteTestsEnabled && method.getAnnotation(LocalOnly.class) != null) {
// if running in remote mode and @LocalOnly annotation exists, ignore
notify("Skip @LocalOnly", description);
notifier.fireTestIgnored(description);
} else {
// default is run in either mode
notify("Test[" + mode + "]", description);
super.runChild(method, notifier);
}
}
示例6: runChild
import org.junit.runner.notification.RunNotifier; //导入方法依赖的package包/类
@Override
public void runChild(final FrameworkMethod method, final RunNotifier notifier) {
final Description description = describeChild(method);
if (this.isIgnored(method)) {
notifier.fireTestIgnored(description);
} else {
EachTestNotifier eachNotifier = new EachTestNotifier(notifier, description);
eachNotifier.fireTestStarted();
boolean ignored = false;
try {
this.methodBlock(method).evaluate();
} catch (AssumptionViolatedException ave) {
eachNotifier.addFailedAssumption(ave);
} catch (Throwable e) {
if (validateForGraphComputer(e)) {
eachNotifier.fireTestIgnored();
logger.info(e.getMessage());
ignored = true;
} else
eachNotifier.addFailure(e);
} finally {
if (!ignored)
eachNotifier.fireTestFinished();
}
}
}
示例7: runChild
import org.junit.runner.notification.RunNotifier; //导入方法依赖的package包/类
@Override
protected void runChild(TestCases.TestCase testCase, RunNotifier runNotifier) {
Description description = this.children.get( testCase );
try {
runNotifier.fireTestStarted( description );
vendorSuite.beforeTest( description, context, testCase );
TestResult result = vendorSuite.executeTest( description, context, testCase );
switch ( result.getResult() ) {
case SUCCESS:
runNotifier.fireTestFinished( description );
break;
case IGNORED:
runNotifier.fireTestIgnored( description );
break;
case ERROR:
runNotifier.fireTestFailure(new Failure(description, new RuntimeException(result.toStringWithLines())));
break;
}
if (resultFile != null) {
String relativePath = relativePath(folder);
resultFile.append( String.format( "\"%s\",\"%s\",\"%s\",\"%s\",\"%s\"\n", relativePath, description.getClassName(), description.getMethodName(),
result.getResult().toString(), result.getMsg() ) );
}
} catch ( IOException e ) {
e.printStackTrace();
} finally {
vendorSuite.afterTest( description, context, testCase );
runNotifier.fireTestFinished(description);
}
}
示例8: runChild
import org.junit.runner.notification.RunNotifier; //导入方法依赖的package包/类
@Override
protected void runChild(ArchTestExecution child, RunNotifier notifier) {
if (child.ignore()) {
notifier.fireTestIgnored(describeChild(child));
} else {
notifier.fireTestStarted(describeChild(child));
JavaClasses classes = cache.get().getClassesToAnalyzeFor(getTestClass().getJavaClass());
child.evaluateOn(classes).notify(notifier);
notifier.fireTestFinished(describeChild(child));
}
}
示例9: runChild
import org.junit.runner.notification.RunNotifier; //导入方法依赖的package包/类
@Override
protected void runChild(final FrameworkMethod method, RunNotifier notifier) {
Description description = describeChild(method);
if (isIgnored(method)) {
notifier.fireTestIgnored(description);
} else {
try {
runLeaf(methodBlock(method), description, notifier);
} catch (AssumptionViolatedException ex) {
notifier.fireTestIgnored(description);
}
}
}
示例10: run
import org.junit.runner.notification.RunNotifier; //导入方法依赖的package包/类
@Override
public void run(RunNotifier notifier) {
if (failure != null) {
reportInitializationFailure(notifier, description, failure);
return;
}
for (Map.Entry<String, Description> entry : tests.entrySet()) {
Description testDescription = entry.getValue();
FileTester tester;
try {
tester = createTester(entry.getKey());
} catch (IOException e) {
reportInitializationFailure(notifier, testDescription, e);
continue;
}
if (tester == null) {
notifier.fireTestIgnored(testDescription);
continue;
}
notifier.fireTestStarted(testDescription);
try {
tester.runTest();
} catch (Throwable t) {
notifier.fireTestFailure(new Failure(testDescription, t));
}
notifier.fireTestFinished(testDescription);
}
}
示例11: runChild
import org.junit.runner.notification.RunNotifier; //导入方法依赖的package包/类
@Override
protected void runChild(final FrameworkMethod method, RunNotifier notifier) {
Description description = describeChild(method);
if (ConnectionRule.shouldRun()) {
runLeaf(methodBlock(method), description, notifier);
} else {
notifier.fireTestIgnored(description);
}
}
示例12: runChild
import org.junit.runner.notification.RunNotifier; //导入方法依赖的package包/类
@Override
protected void runChild(FrameworkMethod method, RunNotifier notifier) {
Description description = describeMethod(method);
if (isIgnored(method)) {
notifier.fireTestIgnored(description);
} else {
runLeaf(methodBlock(method), description, notifier);
}
}
示例13: runChild
import org.junit.runner.notification.RunNotifier; //导入方法依赖的package包/类
@Override
protected void runChild(final FrameworkMethod method, RunNotifier notifier) {
Description description = describeChild(method);
if (isIgnored(method)) {
notifier.fireTestIgnored(description);
} else {
//read the type of testExecutor from system property. This is sent by the gradle task. By default
//the tests are executed locally.
TestExecutorType executionType = TestExecutorType.valueOf(System.getProperty("execType", "LOCAL"));
invokeTest(notifier, executionType, method);
}
}
示例14: runChild
import org.junit.runner.notification.RunNotifier; //导入方法依赖的package包/类
@Override
protected void runChild(final FrameworkMethod method, RunNotifier notifier) {
Description description= describeChild(method);
if (isIgnored(method)) {
notifier.fireTestIgnored(description);
} else if (testData.containsKey(method)) {
runLeaf(methodBlock(method), description, notifier);
}
}
示例15: runChild
import org.junit.runner.notification.RunNotifier; //导入方法依赖的package包/类
@Override
protected void runChild(final FrameworkMethod method, RunNotifier notifier) {
Description description= describeChild(method);
if (isIgnored(method)) {
notifier.fireTestIgnored(description);
} else {
runLeaf(methodBlock(method), description, notifier);
}
}