我在创建重启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运行套件是不够的,我应该在测试实现中改变一些东西吗?
答案 0 :(得分:0)
您无法从Eclipse内部(使用或不使用SWTBot)测试应用程序的重启。点击"重启"将重新启动与初始应用程序完全相同的应用程序,包括执行测试。
如果你想拥有多个具有不同IDE执行功能的套件,你需要从外部协调你的测试""例如,通过配置对tycho-surefire-plugin的连续调用。