【问题标题】:SWTBot Restart rcp application in testSWTBot 在测试中重新启动 rcp 应用程序
【发布时间】:2014-10-19 14:04:03
【问题描述】:

我在创建重新启动 rcp 应用程序的 SWTBot 测试时遇到问题。当我从 Eclipse 运行一组测试时,当 rcp app 重新启动时,它也会重新启动该套件。因此,在重新启动之前已经运行的测试将再次运行。 我读到您可以运行一系列测试,仅使用 Tycho Surefire、bash... 我尝试使用 tycho 运行,但是当重新启动测试运行时出现以下错误:

[ERROR] Failed to execute goal org.eclipse.tycho:tycho-surefire-plugin:0.20.0:test (default-test) on project projectName.ui.swtbottest: An unexpected error occured (return code -1). See log for details. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.eclipse.tycho:tycho-surefire-plugin:0.20.0:test
(default-test) on project projectName.ui.swtbottest: An unexpected error occured (return code -1). See log for details.

    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)

知道为什么会这样吗?仅使用 tycho 运行套件是不够的,我应该在测试实现中进行一些更改吗?

【问题讨论】:

    标签: eclipse unit-testing tycho swtbot tycho-surefire-plugin


    【解决方案1】:

    您无法从 Eclipse 内部测试应用程序的重新启动(使用或不使用 SWTBot)。点击“重新启动”将重新启动与初始应用程序完全相同的应用程序,包括执行测试。

    如果您想拥有多个执行不同 IDE 的套件,则需要“从外部”编排您的测试,例如通过配置对 tycho-surefire-plugin 的连续调用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-02-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-03-01
      相关资源
      最近更新 更多