當前位置: 首頁>>代碼示例>>Java>>正文


Java RunNotifier.fireTestIgnored方法代碼示例

本文整理匯總了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);
    }
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:17,代碼來源:AbstractMultiTestRunner.java

示例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);
	}
}
 
開發者ID:bangarharshit,項目名稱:Oleaster,代碼行數:25,代碼來源:OleasterRunner.java

示例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);
	}
}
 
開發者ID:tanhaichao,項目名稱:leopard,代碼行數:25,代碼來源:IntegrationRunner.java

示例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 );
    }
}
 
開發者ID:vmware,項目名稱:OHMS,代碼行數:19,代碼來源:RetryRunner.java

示例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);
  }
}
 
開發者ID:GoogleCloudPlatform,項目名稱:jetty-runtime,代碼行數:26,代碼來源:LocalRemoteTestRunner.java

示例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();
        }
    }
}
 
開發者ID:PKUSilvester,項目名稱:LiteGraph,代碼行數:27,代碼來源:GremlinProcessRunner.java

示例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);
     }
 }
 
開發者ID:dmn-tck,項目名稱:tck,代碼行數:31,代碼來源:DmnTckRunner.java

示例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));
    }
}
 
開發者ID:TNG,項目名稱:ArchUnit,代碼行數:12,代碼來源:ArchUnitRunner.java

示例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);
        }
    }
}
 
開發者ID:octabase,項目名稱:fnr-java,代碼行數:14,代碼來源:FNRCipherTest.java

示例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);
	}
}
 
開發者ID:git03394538,項目名稱:lombok-ianchiu,代碼行數:33,代碼來源:DirectoryRunner.java

示例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);
    }
}
 
開發者ID:vmware,項目名稱:photon-model,代碼行數:11,代碼來源:AutoIgnoreRunner.java

示例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);
    }
}
 
開發者ID:soundvibe,項目名稱:pbt4j,代碼行數:10,代碼來源:ParametrizedRunner.java

示例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);
    }
}
 
開發者ID:pravega,項目名稱:pravega,代碼行數:13,代碼來源:SystemTestRunner.java

示例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);
	}
}
 
開發者ID:eclipse,項目名稱:xtext-core,代碼行數:10,代碼來源:AbstractParallelScenarioRunner.java

示例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);
	}
}
 
開發者ID:eclipse,項目名稱:xtext-core,代碼行數:10,代碼來源:AbstractScenarioRunner.java


注:本文中的org.junit.runner.notification.RunNotifier.fireTestIgnored方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。