首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用窗口测试器pro的tycho没有打开正确的窗口

使用窗口测试器pro的tycho没有打开正确的窗口
EN

Stack Overflow用户
提问于 2012-10-08 11:57:06
回答 1查看 822关注 0票数 1

我正在尝试用窗口测试器pro建立一个UI测试系统。我想通过使用Tycho插件将这些测试链接到maven构建过程中。出于练习的目的,我目前正在使用一个示例项目。

现在,当我构建我的项目时,一切看起来都很好,但是当测试开始时,我得到了以下消息,并弹出了一个默认的eclipse窗口。然后在该窗口上执行测试,并且失败。

框架参数:-application org.eclipse.tycho.surefire.osgibooter.uitest -testproperties \surefire.properties -product com.example.addressbook.bundle.product 命令行参数: 美国皇家银行( C:\Users\jla\workspace\com.example.addressbook.test\target\work\data file:/C:/Users/jla/workspace/com.example.addressbook.test/target/dev.properties -dev -application org.eclipse.tycho.surefire.osgibooter.uitest -testproperties C:\Users\jla\workspace\com.example.addressbook.test\target \surefire.properties -product com.example.addressbook.bundle.product ) !条目org.eclipse.ui 4 4 2012-10-12 16:00:36.984!org.eclipse.ui中的消息异常 org.eclipse.ui.PartInitException:未找到视图描述符: org.eclipse.ui.navigator.ProjectExplorer !条目org.eclipse.ui 4 4 2012-10-12 16:00:36.990!org.eclipse.ui中的消息异常 org.eclipse.ui.PartInitException:未找到视图描述符: org.eclipse.ui.navigator.ProjectExplorer!堆栈1 org.eclipse.ui.PartInitException:未找到视图描述符: org.eclipse.ui.navigator.ProjectExplorer

这是我的测试项目的Pom.xml:

代码语言:javascript
复制
    <?xml version="1.0" encoding="UTF-8"?>
<project
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
  xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>com.example.addressbook</groupId>
    <artifactId>com.example.addressbook.build</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <relativePath>../com.example.addressbook.build</relativePath>
  </parent>

  <artifactId>com.example.addressbook.test</artifactId>
  <packaging>eclipse-test-plugin</packaging>

  <build>
        <plugins>
            <plugin>
                <groupId>org.eclipse.tycho</groupId>
                <artifactId>tycho-surefire-plugin</artifactId>
                <version>${tycho-version}</version>

                <configuration>
                    <testSuite>com.example.addressbook.test</testSuite>
                    <testClass>com.example.addressbook.test.AppTest001</testClass>

                    <useUIHarness>true</useUIHarness>
                    <useUIThread>true</useUIThread>
                    <!-- use our product and application to launch the tests -->
                    <product>com.example.addressbook.bundle.product</product>
                    <!--  <application>org.eclipse.ui.ide.workbench</application>-->

                    <dependencies>
                        <dependency>
                            <type>p2-installable-unit</type>
                            <artifactId>com.windowtester.runtime.feature.group</artifactId>
                            <version>0.0.0</version>
                        </dependency>
                    </dependencies>
                </configuration>

            </plugin>
        </plugins>
    </build>


 </project>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-10-12 14:36:52

我终于找到了办法让它起作用。由于tycho正在使用eclipse创建的项目信息,因此有必要引用应该在MANIFEST.MF文件中测试的项目。

这是我的MANIFEST.MF文件:

代码语言:javascript
复制
    Bundle-Name: Test Bundle
Bundle-Version: 1.0.0.qualifier
Bundle-SymbolicName: com.example.addressbook.test
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Require-Bundle: org.junit,
 com.windowtester.runtime,
 com.windowtester.swt.runtime,
 com.windowtester.swing.runtime,
 org.eclipse.jface,
 org.eclipse.core.runtime,
 org.eclipse.swt,
 com.example.addressbook.bundle,
 com.example.addressbook.services

这就是我的pom.xml的样子。注意:我刚刚在产品标签下添加了一个应用程序标签。

代码语言:javascript
复制
    <?xml version="1.0" encoding="UTF-8"?>
<project
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
  xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>com.example.addressbook</groupId>
    <artifactId>com.example.addressbook.build</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <relativePath>../com.example.addressbook.build</relativePath>
  </parent>

  <artifactId>com.example.addressbook.test</artifactId>
  <packaging>eclipse-test-plugin</packaging>

  <build>
        <plugins>
            <plugin>
                <groupId>org.eclipse.tycho</groupId>
                <artifactId>tycho-surefire-plugin</artifactId>
                <version>${tycho-version}</version>

                <configuration>
                    <testSuite>com.example.addressbook.test</testSuite>
                    <testClass>com.example.addressbook.test.AppTest01</testClass>

                    <useUIHarness>true</useUIHarness>
                    <useUIThread>true</useUIThread>
                    <!-- use our product and application to launch the tests -->
                    <product>com.example.addressbook.bundle.product</product>
                    <application>com.example.addressbook.bundle.application</application>

                    <dependencies>
                        <dependency>
                            <type>p2-installable-unit</type>
                            <artifactId>com.windowtester.runtime.feature.group</artifactId>
                            <version>0.0.0</version>
                        </dependency>
                    </dependencies>
                </configuration>

            </plugin>
        </plugins>
    </build>


 </project>
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12781268

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档