Tycho верный с Windowtester Pro не открывает правильное окно

Я пытаюсь настроить систему тестирования пользовательского интерфейса с Windowtester Pro. Я хочу связать эти тесты с процессом сборки maven с помощью плагина Tycho. Для практики я сейчас использую пример проекта.

Теперь, когда я строю свой проект, кажется, что все хорошо скомпилировано, но когда тест начинается, я получаю следующее сообщение и появляется окно затмения по умолчанию. Затем в этом окне выполняется проверка, и -suprise- не выполняется.

Рамочные аргументы:

-application org.eclipse.tycho.surefire.osgibooter.uitest -testproperties C: \ Users \ jla \ workspace \ com.example.addressbook.test \ target \ surefire.properties

-продукт com.example.addressbook.bundle.product

Аргументы командной строки:
-debug -consolelog -data C:\Users\jla\workspace\com.example.addressbook.test\target\work\data -dev файл: / C: /Users/jla/workspace/com.example.addressbook.test/ target / dev.properties -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

!ENTRY org.eclipse.ui 4 4 2012-10-12 16:00:36.984
!MESSAGE Exception in org.eclipse.ui.internal.FolderLayout.addView(String):

org.eclipse.ui.PartInitException: дескриптор представления не найден: org.eclipse.ui.navigator.ProjectExplorer

!ENTRY org.eclipse.ui 4 4 2012-10-12 16:00:36.990
!MESSAGE Exception in org.eclipse.ui.internal.FolderLayout.addView(String):

org.eclipse.ui.PartInitException: дескриптор представления не найден: org.eclipse.ui.navigator.ProjectExplorer!STACK 1 org.eclipse.ui.PartInitException: дескриптор представления не найден: org.eclipse.ui.navigator.ProjectExplorer

Это Pom.xml, который у меня есть для моего тестового проекта:

    <?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>

1 ответ

Решение

Я наконец нашел способ заставить это работать. Так как Tycho использует информацию о проекте, созданную eclipse, необходимо сослаться на проект, который предполагается протестировать, в файле MANIFEST.MF.

Это мой файл MANIFEST.MF:

    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. Примечание. Я только что добавил тег приложения прямо под тегом продукта.

    <?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>
Другие вопросы по тегам