• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java GeneralTestEventsProcessor类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



GeneralTestEventsProcessor类属于com.intellij.execution.testframework.sm.runner包,在下文中一共展示了GeneralTestEventsProcessor类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: consumeTestRunStarted

import com.intellij.execution.testframework.sm.runner.GeneralTestEventsProcessor; //导入依赖的package包/类
@Override
public void consumeTestRunStarted(long timestamp) {
  final GeneralTestEventsProcessor processor = getProcessor();
  if (processor == null) {
    return;
  }
  processor.onUncapturedOutput(
      "Test run started at " + DateFormatUtil.formatTimeWithSeconds(new Date(timestamp)) + "\n",
      ProcessOutputTypes.STDOUT);
}
 
开发者ID:facebook,项目名称:buck,代码行数:11,代码来源:BuckToGeneralTestEventsConverter.java


示例4: consumeTestRunComplete

import com.intellij.execution.testframework.sm.runner.GeneralTestEventsProcessor; //导入依赖的package包/类
@Override
public void consumeTestRunComplete(long timestamp) {
  mConnection.disconnect();
  myHandler.detachProcess();
  final GeneralTestEventsProcessor processor = getProcessor();
  if (processor == null) {
    return;
  }
  processor.onFinishTesting();
}
 
开发者ID:facebook,项目名称:buck,代码行数:11,代码来源:BuckToGeneralTestEventsConverter.java


示例5: 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


示例6: consumeBuildEnd

import com.intellij.execution.testframework.sm.runner.GeneralTestEventsProcessor; //导入依赖的package包/类
@Override
public void consumeBuildEnd(long timestamp) {
  final GeneralTestEventsProcessor processor = getProcessor();
  if (processor == null) {
    return;
  }
  processor.onUncapturedOutput(
      "Build finished at " + DateFormatUtil.formatTimeWithSeconds(new Date(timestamp)) + "\n",
      ProcessOutputTypes.STDOUT);
}
 
开发者ID:facebook,项目名称:buck,代码行数:11,代码来源:BuckToGeneralTestEventsConverter.java


示例7: consumeBuildStart

import com.intellij.execution.testframework.sm.runner.GeneralTestEventsProcessor; //导入依赖的package包/类
@Override
public void consumeBuildStart(long timestamp) {
  final GeneralTestEventsProcessor processor = getProcessor();
  if (processor == null) {
    return;
  }
  processor.onUncapturedOutput(
      "Build started at " + DateFormatUtil.formatTimeWithSeconds(new Date(timestamp)) + "\n",
      ProcessOutputTypes.STDOUT);
}
 
开发者ID:facebook,项目名称:buck,代码行数:11,代码来源:BuckToGeneralTestEventsConverter.java


示例8: consumeCompilerError

import com.intellij.execution.testframework.sm.runner.GeneralTestEventsProcessor; //导入依赖的package包/类
@Override
public void consumeCompilerError(
    String target, long timestamp, String error, ImmutableSet<String> suggestions) {
  final GeneralTestEventsProcessor processor = getProcessor();
  if (processor != null) {
    processor.onUncapturedOutput(
        "Build failed at " + DateFormatUtil.formatTimeWithSeconds(new Date(timestamp)) + "\n",
        ProcessOutputTypes.STDOUT);
  }
  mConnection.disconnect();
  myHandler.detachProcess();
}
 
开发者ID:facebook,项目名称:buck,代码行数:13,代码来源:BuckToGeneralTestEventsConverter.java


示例9: findHandler

import com.intellij.execution.testframework.sm.runner.GeneralTestEventsProcessor; //导入依赖的package包/类
@Nonnull
static DefaultHandler findHandler(final Supplier<Reader> readerSupplier, GeneralTestEventsProcessor processor) {
  for (ImportTestOutputExtension extension : Extensions.getExtensions(EP_NAME)) {
    Reader reader = readerSupplier.get();
    if (reader == null) continue;
    try {
      DefaultHandler handler = extension.createHandler(reader, processor);
      if (handler != null) return handler;
    }
    catch (IOException ignored) {
    }
  }
  return new ImportedTestContentHandler(processor);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:15,代码来源:ImportTestOutputExtension.java


示例10: ImportedTestContentHandler

import com.intellij.execution.testframework.sm.runner.GeneralTestEventsProcessor; //导入依赖的package包/类
public ImportedTestContentHandler(GeneralTestEventsProcessor processor) {
  myProcessor = processor;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:ImportedTestContentHandler.java


示例11: 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


示例12: newSession

import com.intellij.execution.testframework.sm.runner.GeneralTestEventsProcessor; //导入依赖的package包/类
public UUID newSession(ProcessHandler processHandler, GeneralTestEventsProcessor processor)
{
	UUID uuid = UUID.randomUUID();
	mySessions.put(uuid, new Unity3dTestSession(processHandler, processor));
	return uuid;
}
 
开发者ID:consulo,项目名称:consulo-unity3d,代码行数:7,代码来源:Unity3dTestSessionManager.java


示例13: Unity3dTestSession

import com.intellij.execution.testframework.sm.runner.GeneralTestEventsProcessor; //导入依赖的package包/类
public Unity3dTestSession(ProcessHandler processHandler, GeneralTestEventsProcessor processor)
{
	myProcessor = processor;
	myProcessHandler = processHandler;
}
 
开发者ID:consulo,项目名称:consulo-unity3d,代码行数:6,代码来源:Unity3dTestSession.java


示例14: getProcessor

import com.intellij.execution.testframework.sm.runner.GeneralTestEventsProcessor; //导入依赖的package包/类
public GeneralTestEventsProcessor getProcessor()
{
	return myProcessor;
}
 
开发者ID:consulo,项目名称:consulo-unity3d,代码行数:5,代码来源:Unity3dTestSession.java


示例15: setProcessor

import com.intellij.execution.testframework.sm.runner.GeneralTestEventsProcessor; //导入依赖的package包/类
@Override
public void setProcessor(@Nullable GeneralTestEventsProcessor processor) {
    super.setProcessor(processor);
    if (processor != null)
        processor.onRootPresentationAdded("Test Suite", null, null);
}
 
开发者ID:getgauge,项目名称:Intellij-Plugin,代码行数:7,代码来源:GaugeOutputToGeneralTestEventsProcessor.java


示例16: SurefireTestReportsParser

import com.intellij.execution.testframework.sm.runner.GeneralTestEventsProcessor; //导入依赖的package包/类
public SurefireTestReportsParser(MavenProject mavenProject, Project project, GeneralTestEventsProcessor testEventsProcessor) {
    this.mavenProject = mavenProject;
    mavenProjectsManager = MavenProjectsManager.getInstance(project);
    this.testEventsProcessor = testEventsProcessor;
}
 
开发者ID:destin,项目名称:maven-test-support-plugin,代码行数:6,代码来源:SurefireTestReportsParser.java


示例17: ReportParser

import com.intellij.execution.testframework.sm.runner.GeneralTestEventsProcessor; //导入依赖的package包/类
public ReportParser(GeneralTestEventsProcessor testEventsProcessor) {
    this.testEventsProcessor = testEventsProcessor;
}
 
开发者ID:destin,项目名称:maven-test-support-plugin,代码行数:4,代码来源:ReportParser.java


示例18: BaseThriftTestHandler

import com.intellij.execution.testframework.sm.runner.GeneralTestEventsProcessor; //导入依赖的package包/类
public BaseThriftTestHandler(GeneralTestEventsProcessor eventsProcessor) {
  myEventsProcessor = eventsProcessor;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:4,代码来源:BaseThriftTestHandler.java


示例19: createHandler

import com.intellij.execution.testframework.sm.runner.GeneralTestEventsProcessor; //导入依赖的package包/类
public BaseThriftTestHandler createHandler(GeneralTestEventsProcessor processor) {
  return new BaseThriftTestHandler(processor);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:4,代码来源:ThriftTestHandlerFactory.java


示例20: parseTestResults

import com.intellij.execution.testframework.sm.runner.GeneralTestEventsProcessor; //导入依赖的package包/类
public static void parseTestResults(Supplier<Reader> readerSupplier, GeneralTestEventsProcessor processor) throws IOException {
  parseTestResults(readerSupplier.get(), ImportTestOutputExtension.findHandler(readerSupplier, processor));
}
 
开发者ID:consulo,项目名称:consulo,代码行数:4,代码来源:ImportedToGeneralTestEventsConverter.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Bytes类代码示例发布时间:2022-05-23
下一篇:
Java S3DPacketDisplayScoreboard类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap