【问题标题】:Adding multi test suite support to the Eclipse PDE unit automation process向 Eclipse PDE 单元自动化过程添加多测试套件支持
【发布时间】:2011-05-25 22:07:30
【问题描述】:

我正在尝试从此处 [1] 调整 pde 单元测试自动化流程以处理多个测试套件。这篇文章使用了无法处理多个测试套件的 org.eclipse.jdt.internal.junit.model.ITestRunListener2。我正在考虑改用 org.eclipse.jdt.junit.TestRunListener 。

我尝试将 org.eclipse.jdt.internal.junit.model.ITestRunListener2 的包含实现转换为实现 junit.runner.TestRunListener,因为它的 testRunStarted() 方法包含一个测试套件名称参数,但找不到任何示例关于如何调整 org.eclipse.jdt.internal.junit.model.RemoteTestRunnerClient 来使用它(我不确定 PDE 测试结果协议是否支持它)。

  1. 使用 JUnitCore.addTestRunListener(listener) 是否能够替代整个测试结果侦听器方法?无需远程运行测试。
  2. 关于如何向 [1] 添加多套件支持的任何其他建议?

[1]http://www.eclipse.org/articles/article.php?file=Article-PDEJUnitAntAutomation/index.html


你好,这是 OP,无法添加评论 Paul Webster 的回复,所以我发布了这个。

RemoteTestRunnerClient 的特点是它根据 org.eclipse.jdt.internal.junit.runner.MessageId 中定义的协议将通知委托给它的侦听器,并从 TCP 套接字读取消息。问题是 TEST_RUN_START/END 消息不包含套件的名称,导致所有测试都与同一个套件相关联。

我在设置自动化测试框架时确实查看了 Eclipse 测试框架,但找不到任何令人信服的理由来支持它而不是文章中建议的方法。我不确定,但我认为文章不使用 ETF 的原因是缺乏对测试结果聚合的足够支持。到目前为止,我能够指定哪些套件应该通过 test.xml 文件运行,因为我目前正在使用传递给“org.eclipse.pde.junit.runtime.coretestapplication”应用程序的“-classnames”参数。我不介意考虑转向 ETF,但希望事先有一个令人信服的理由。

底线是,由于我的设置完成了所需的 99%,我更喜欢快速而简单的解决方法,而不是完整的测试系统转换。

【问题讨论】:

    标签: eclipse automated-tests pde


    【解决方案1】:

    我认为你不需要做任何事情。 RemoteTestRunnerClient。它需要一个ITestRunListener2,由TestSessionNotifier 实现。向TestRunListenerAdapter 实现的ITestSessionListener 发出事件,后者将它们转发给TestRunListener

    话虽如此,那篇文章中的指针之一是指向 Eclipse 测试框架 [1]。

    我们使用它来运行我们的插件测试。在获得框架本身之后,每个测试插件只需要一个 test.xml [2] 文件。该文件可以指定 UI 测试和无头测试,并且可以列出该插件的多个 TestSuite。我已经链接了我们的示例。

    [1]http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.test/testframework.html?view=co

    [2]http://dev.eclipse.org/viewcvs/viewvc.cgi/e4/org.eclipse.e4.ui/tests/org.eclipse.e4.ui.tests/test.xml?view=co&content-type=text%2Fplain

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-03-25
      • 2010-09-20
      • 2016-09-13
      • 1970-01-01
      • 2010-09-10
      • 2015-05-12
      • 2016-08-23
      • 1970-01-01
      相关资源
      最近更新 更多