当前位置: 首页>>代码示例>>Java>>正文


Java GeneralTestEventsProcessor.onSuiteStarted方法代码示例

本文整理汇总了Java中com.intellij.execution.testframework.sm.runner.GeneralTestEventsProcessor.onSuiteStarted方法的典型用法代码示例。如果您正苦于以下问题:Java GeneralTestEventsProcessor.onSuiteStarted方法的具体用法?Java GeneralTestEventsProcessor.onSuiteStarted怎么用?Java GeneralTestEventsProcessor.onSuiteStarted使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.execution.testframework.sm.runner.GeneralTestEventsProcessor的用法示例。


在下文中一共展示了GeneralTestEventsProcessor.onSuiteStarted方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: reportTargetWithoutOutputFiles

import com.intellij.execution.testframework.sm.runner.GeneralTestEventsProcessor; //导入方法依赖的package包/类
/**
 * If there are no output files, the test may have failed to build, or timed out. Provide a
 * suitable message in the test UI.
 */
private void reportTargetWithoutOutputFiles(Label label, TestStatus status) {
  if (status == TestStatus.PASSED) {
    // Empty test targets do not produce output XML, yet technically pass. Ignore them.
    return;
  }
  GeneralTestEventsProcessor processor = getProcessor();
  TestSuiteStarted suiteStarted = new TestSuiteStarted(label.toString());
  processor.onSuiteStarted(new TestSuiteStartedEvent(suiteStarted, /*locationUrl=*/ null));
  String targetName = label.targetName().toString();
  processor.onTestStarted(new TestStartedEvent(targetName, /*locationUrl=*/ null));
  processor.onTestFailure(
      getTestFailedEvent(
          targetName,
          STATUS_EXPLANATIONS.get(status) + " See console output for details",
          /*content=*/ null,
          /*duration=*/ 0));
  processor.onTestFinished(new TestFinishedEvent(targetName, /*duration=*/ 0L));
  processor.onSuiteFinished(new TestSuiteFinishedEvent(label.toString()));
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:24,代码来源:BlazeXmlToTestEventsConverter.java

示例2: processTestSuite

import com.intellij.execution.testframework.sm.runner.GeneralTestEventsProcessor; //导入方法依赖的package包/类
private static void processTestSuite(
    GeneralTestEventsProcessor processor,
    BlazeTestEventsHandler eventsHandler,
    @Nullable Kind kind,
    TestSuite suite) {
  if (!hasRunChild(suite)) {
    return;
  }
  // only include the innermost 'testsuite' element
  boolean logSuite = !eventsHandler.ignoreSuite(kind, suite);
  if (suite.name != null && logSuite) {
    TestSuiteStarted suiteStarted =
        new TestSuiteStarted(eventsHandler.suiteDisplayName(kind, suite.name));
    String locationUrl = eventsHandler.suiteLocationUrl(kind, suite.name);
    processor.onSuiteStarted(new TestSuiteStartedEvent(suiteStarted, locationUrl));
  }

  for (TestSuite child : suite.testSuites) {
    processTestSuite(processor, eventsHandler, kind, child);
  }
  for (TestSuite decorator : suite.testDecorators) {
    processTestSuite(processor, eventsHandler, kind, decorator);
  }
  for (TestCase test : suite.testCases) {
    processTestCase(processor, eventsHandler, kind, suite, test);
  }

  if (suite.sysOut != null) {
    processor.onUncapturedOutput(suite.sysOut, ProcessOutputTypes.STDOUT);
  }
  if (suite.sysErr != null) {
    processor.onUncapturedOutput(suite.sysErr, ProcessOutputTypes.STDERR);
  }

  if (suite.name != null && logSuite) {
    processor.onSuiteFinished(
        new TestSuiteFinishedEvent(eventsHandler.suiteDisplayName(kind, suite.name)));
  }
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:40,代码来源:BlazeXmlToTestEventsConverter.java

示例3: consumeTestResultsAvailable

import com.intellij.execution.testframework.sm.runner.GeneralTestEventsProcessor; //导入方法依赖的package包/类
@Override
public void consumeTestResultsAvailable(long timestamp, TestResults testResults) {
  final GeneralTestEventsProcessor processor = getProcessor();
  if (processor == null) {
    return;
  }
  for (TestCaseSummary suite : testResults.getTestCases()) {
    if (suite.getTestResults().isEmpty()) {
      continue;
    }
    processor.onSuiteStarted(new TestSuiteStartedEvent(suite.getTestCaseName(), null));

    for (TestResultsSummary test : suite.getTestResults()) {
      final String testName = test.getTestName();
      String locationUrl = String.format("java:test://%s.%s", test.getTestCaseName(), testName);
      processor.onTestStarted(new TestStartedEvent(testName, locationUrl));
      final String stdOut = test.getStdOut();
      if (stdOut != null) {
        processor.onTestOutput(new TestOutputEvent(testName, stdOut, true));
      }
      final String stdErr = test.getStdErr();
      if (stdErr != null) {
        processor.onTestOutput(new TestOutputEvent(testName, stdErr, false));
      }
      if (test.getType() == ResultType.FAILURE) {
        processor.onTestFailure(
            new TestFailedEvent(testName, "", test.getStacktrace(), true, null, null));
      }
      processor.onTestFinished(new TestFinishedEvent(testName, test.getTime()));
    }
    processor.onSuiteFinished(new TestSuiteFinishedEvent(suite.getTestCaseName()));
  }
}
 
开发者ID:facebook,项目名称:buck,代码行数:34,代码来源:BuckToGeneralTestEventsConverter.java

示例4: handle

import com.intellij.execution.testframework.sm.runner.GeneralTestEventsProcessor; //导入方法依赖的package包/类
@NotNull
@Override
public JsonResponse handle(@NotNull UnityTestStatePostRequest request)
{
	UUID uuid = UUID.fromString(request.uuid);
	Unity3dTestSession session = Unity3dTestSessionManager.getInstance().findSession(uuid);
	if(session == null)
	{
		return JsonResponse.asError("no session");
	}

	GeneralTestEventsProcessor processor = session.getProcessor();
	ProcessHandler processHandler = session.getProcessHandler();

	String name = request.name;
	switch(request.type)
	{
		case TestStarted:
			processor.onTestStarted(new TestStartedEvent(name, null));
			break;
		case TestIgnored:
			processor.onTestIgnored(new TestIgnoredEvent(name, StringUtil.notNullize(request.message), request.stackTrace));
			break;
		case TestFailed:
			processor.onTestFailure(new TestFailedEvent(name, StringUtil.notNullize(request.message), request.stackTrace, false, null, null));
			break;
		case TestOutput:
			boolean stdOut = "Log".equals(request.messageType) || "Warning".equals(request.messageType);
			StringBuilder builder = new StringBuilder(request.message);
			if(!stdOut)
			{
				builder.append("\n");
				String[] strings = StringUtil.splitByLines(request.stackTrace);
				for(String line : strings)
				{
					builder.append("  at ").append(line).append("\n");
				}
			}
			processor.onTestOutput(new TestOutputEvent(name, builder.toString(), stdOut));
			break;
		case TestFinished:
			long time = (long) (request.time * 1000L);
			processor.onTestFinished(new TestFinishedEvent(name, time));
			break;
		case SuiteStarted:
			processor.onSuiteStarted(new TestSuiteStartedEvent(name, null));
			break;
		case SuiteFinished:
			processor.onSuiteFinished(new TestSuiteFinishedEvent(name));
			break;
		case RunFinished:
			processor.onFinishTesting();
			processHandler.destroyProcess();
			break;
	}

	return JsonResponse.asSuccess(null);
}
 
开发者ID:consulo,项目名称:consulo-unity3d,代码行数:59,代码来源:UnityTestStatePostHandler.java


注:本文中的com.intellij.execution.testframework.sm.runner.GeneralTestEventsProcessor.onSuiteStarted方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。