Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » Wrong tested application is started when tests are running with Tycho
Wrong tested application is started when tests are running with Tycho [message #1800213] Fri, 21 December 2018 11:59 Go to next message
Alexey Chibisov is currently offline Alexey ChibisovFriend
Messages: 5
Registered: December 2018
Junior Member
Hello!

I created a simple gui test using SWTBot. It is a plugin for RCP E4 application. After that I wrote a pom.xml for my test and added my RCP application as a feature to target platform configuration.
If I run
mvn verify
from this test plugin module, tycho launches pure Eclipse IDE without my RCP application, that I have specified in the target platform configuration section.

But If I am running this test using Eclipse IDE as a SWTBot test, everything is working fine.

Here is my pom.xml for test module:
<?xml version="1.0" encoding="UTF-8"?>
<project >
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.jkiss.dbeaver</groupId>
        <artifactId>dbeaver</artifactId>
        <version>1.0.0-SNAPSHOT</version>
        <relativePath>../../</relativePath>
    </parent>

    <artifactId>org.jkiss.dbeaver.functional.tests</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>eclipse-test-plugin</packaging>

    <build>
        <plugins>
            <plugin>
                <groupId>org.eclipse.tycho</groupId>
                <artifactId>tycho-surefire-plugin</artifactId>
                <version>${tycho-version}</version>
                <configuration>
                    <useUIHarness>true</useUIHarness>
                    <useUIThread>false</useUIThread>
                    <product>org.jkiss.dbeaver.core.product</product>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.eclipse.tycho</groupId>
                <artifactId>target-platform-configuration</artifactId>
                <version>${tycho-version}</version>
                <configuration>
                    <dependency-resolution>
                        <extrarequirements>
                            <requirement>
                                <type>eclipse-feature</type>
                                <id>org.jkiss.dbeaver.ce.feature</id>
                                <versionrange>0.0.0</versionrange>
                            </requirement>
                            <requirement>
                                <type>eclipse-feature</type>
                                <id>org.eclipse.e4.rcp</id>
                                <versionRange>0.0.0</versionRange>
                            </requirement>
                            <requirement>
                                <type>eclipse-feature</type>
                                <id>org.eclipse.pde</id>
                                <versionRange>0.0.0</versionRange>
                            </requirement>
                        </extrarequirements>
                    </dependency-resolution>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>


I've looked at data folder and did't found plugins of my test application.
What shall I configure to make tycho copying this plugins to data folder?
Or may be I have wrong configuration now?


Re: Wrong tested application is started when tests are running with Tycho [message #1800757 is a reply to message #1800213] Mon, 07 January 2019 20:51 Go to previous messageGo to next message
Eclipse UserFriend
Your pom will cause the org.jkiss.dbeaver.core.product product's application to be launched. Check that it's referencing the right application.

You'll otherwise need to include some console output. Try running with -Dtycho.showEclipseLog=true.

Brian.
Re: Wrong tested application is started when tests are running with Tycho [message #1800946 is a reply to message #1800757] Thu, 10 January 2019 09:07 Go to previous messageGo to next message
Alexey Chibisov is currently offline Alexey ChibisovFriend
Messages: 5
Registered: December 2018
Junior Member
I've specified application using application tag. The error is now "Could not find application". But the situation is the same. Tycho does not copy my plugins in data directory.
Console log:
$ mvn verify -Dtycho.showEclipseLog=true
[INFO] Scanning for projects...
[INFO] Computing target platform for MavenProject: org.jkiss.dbeaver:org.jkiss.dbeaver.uitests:0.0.1-SNAPSHOT @ /home/alexey_chibisov/dev/dbeaver/test-plugins/org.jkiss.dbeaver.uitests/pom.xml
[INFO] Fetching p2.index from http://download.eclipse.org/releases/2018-09/
[INFO] Adding repository http://download.eclipse.org/releases/2018-09
[INFO] Fetching p2.index from http://download.eclipse.org/technology/epp/packages/2018-09/
[INFO] Fetching p2.index from http://download.eclipse.org/releases/2018-09/201809191002/
[INFO] Fetching p2.index from http://download.eclipse.org/releases/2018-09/201809191002/
[INFO] Fetching p2.index from http://download.eclipse.org/tools/orbit/downloads/drops/R20180330011457/repository/
[INFO] Fetching p2.index from http://download.eclipse.org/tools/orbit/downloads/drops/R20180330011457/repository/
[INFO] Adding repository http://download.eclipse.org/tools/orbit/downloads/drops/R20180330011457/repository
[INFO] Fetching p2.index from http://download.eclipse.org/tools/orbit/downloads/drops2/R20180330011457/repository/
[INFO] Fetching p2.index from http://download.eclipse.org/tools/orbit/downloads/drops2/R20180330011457/repository/
[INFO] Fetching p2.index from http://download.eclipse.org/nebula/releases/latest/
[INFO] Fetching p2.index from http://download.eclipse.org/nebula/releases/latest/
[INFO] Adding repository http://download.eclipse.org/nebula/releases/latest
[INFO] Adding repository https://dbeaver.io/eclipse-repo
[INFO] Adding repository http://eclipse-color-theme.github.com/update
[INFO] Fetching p2.index from http://download.eclipse.org/technology/swtbot/releases/latest/
[INFO] Fetching p2.index from http://download.eclipse.org/technology/swtbot/releases/latest/
[INFO] Adding repository http://download.eclipse.org/technology/swtbot/releases/latest
[INFO] Resolving dependencies of MavenProject: org.jkiss.dbeaver:org.jkiss.dbeaver.uitests:0.0.1-SNAPSHOT @ /home/alexey_chibisov/dev/dbeaver/test-plugins/org.jkiss.dbeaver.uitests/pom.xml
[INFO] Resolving class path of MavenProject: org.jkiss.dbeaver:org.jkiss.dbeaver.uitests:0.0.1-SNAPSHOT @ /home/alexey_chibisov/dev/dbeaver/test-plugins/org.jkiss.dbeaver.uitests/pom.xml
[INFO] 
[INFO] ------------< org.jkiss.dbeaver:org.jkiss.dbeaver.uitests >-------------
[INFO] Building org.jkiss.dbeaver.uitests 0.0.1-SNAPSHOT
[INFO] ------------------------[ eclipse-test-plugin ]-------------------------
[INFO] 
[INFO] --- tycho-packaging-plugin:1.1.0:build-qualifier (default-build-qualifier) @ org.jkiss.dbeaver.uitests ---
[INFO] The project's OSGi version is 0.0.1.201901091644
[INFO] 
[INFO] --- tycho-packaging-plugin:1.1.0:validate-id (default-validate-id) @ org.jkiss.dbeaver.uitests ---
[INFO] 
[INFO] --- tycho-packaging-plugin:1.1.0:validate-version (default-validate-version) @ org.jkiss.dbeaver.uitests ---
[INFO] 
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ org.jkiss.dbeaver.uitests ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/alexey_chibisov/dev/dbeaver/test-plugins/org.jkiss.dbeaver.uitests/src/main/resources
[INFO] 
[INFO] --- tycho-compiler-plugin:1.1.0:compile (default-compile) @ org.jkiss.dbeaver.uitests ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.4.3:testResources (default-testResources) @ org.jkiss.dbeaver.uitests ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/alexey_chibisov/dev/dbeaver/test-plugins/org.jkiss.dbeaver.uitests/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (compiletests) @ org.jkiss.dbeaver.uitests ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (test) @ org.jkiss.dbeaver.uitests ---
[INFO] No tests to run.
[INFO] 
[INFO] --- target-platform-configuration:1.1.0:target-platform (default-target-platform) @ org.jkiss.dbeaver.uitests ---
[INFO] 
[INFO] --- tycho-packaging-plugin:1.1.0:package-plugin (default-package-plugin) @ org.jkiss.dbeaver.uitests ---
[INFO] Building jar: /home/alexey_chibisov/dev/dbeaver/test-plugins/org.jkiss.dbeaver.uitests/target/org.jkiss.dbeaver.uitests-0.0.1-SNAPSHOT.jar
[INFO] 
[INFO] --- tycho-p2-plugin:1.1.0:p2-metadata-default (default-p2-metadata-default) @ org.jkiss.dbeaver.uitests ---
[INFO] 
[INFO] --- tycho-surefire-plugin:1.1.0:test (default-test) @ org.jkiss.dbeaver.uitests ---
[INFO] Expected eclipse log file: /home/alexey_chibisov/dev/dbeaver/test-plugins/org.jkiss.dbeaver.uitests/target/work/data/.metadata/.log
[INFO] Command line:
	[/opt/java/jdk1.8.0_161/jre/bin/java, -Dosgi.noShutdown=false, -Dosgi.os=linux, -Dosgi.ws=gtk, -Dosgi.arch=x86_64, -Dosgi.clean=true, -jar, /home/alexey_chibisov/.m2/repository/p2/osgi/bundle/org.eclipse.equinox.launcher/1.5.100.v20180827-1352/org.eclipse.equinox.launcher-1.5.100.v20180827-1352.jar, -debug, -consolelog, -data, /home/alexey_chibisov/dev/dbeaver/test-plugins/org.jkiss.dbeaver.uitests/target/work/data, -install, /home/alexey_chibisov/dev/dbeaver/test-plugins/org.jkiss.dbeaver.uitests/target/work, -configuration, /home/alexey_chibisov/dev/dbeaver/test-plugins/org.jkiss.dbeaver.uitests/target/work/configuration, -application, org.eclipse.tycho.surefire.osgibooter.uitest, -testproperties, /home/alexey_chibisov/dev/dbeaver/test-plugins/org.jkiss.dbeaver.uitests/target/surefire.properties, -testApplication, org.jkiss.dbeaver.core.application.standalone, -product, org.jkiss.dbeaver.core.product, -nouithread]
Configuration location:
    file:/home/alexey_chibisov/dev/dbeaver/test-plugins/org.jkiss.dbeaver.uitests/target/work/configuration/
Configuration file:
    file:/home/alexey_chibisov/dev/dbeaver/test-plugins/org.jkiss.dbeaver.uitests/target/work/configuration/config.ini loaded
Install location:
    file:/home/alexey_chibisov/dev/dbeaver/test-plugins/org.jkiss.dbeaver.uitests/target/work/
Framework located:
    file:/home/alexey_chibisov/.m2/repository/p2/osgi/bundle/org.eclipse.osgi/3.13.100.v20180827-1536/org.eclipse.osgi-3.13.100.v20180827-1536.jar
Framework classpath:
    file:/home/alexey_chibisov/.m2/repository/p2/osgi/bundle/org.eclipse.osgi/3.13.100.v20180827-1536/org.eclipse.osgi-3.13.100.v20180827-1536.jar
Debug options:
    file:/home/alexey_chibisov/dev/dbeaver/test-plugins/org.jkiss.dbeaver.uitests/.options not found
Time to load bundles: 405
Starting application: 1291
Launching application org.jkiss.dbeaver.core.application.standalone...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  17.238 s
[INFO] Finished at: 2019-01-09T19:45:07+03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-surefire-plugin:1.1.0:test (default-test) on project org.jkiss.dbeaver.uitests: Could not find application "org.jkiss.dbeaver.core.application.standalone" in the test runtime. Make sure that the test runtime includes the bundle which defines this application. -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Re: Wrong tested application is started when tests are running with Tycho [message #1801519 is a reply to message #1800946] Mon, 21 January 2019 15:44 Go to previous messageGo to next message
Eclipse UserFriend
Sorry, I missed your reply. Without being able to see your bundle definitions, my guess is that your application and product definition are included in a bundle that's not being referenced from your test bundle. You can add these requirements via the tycho-platform-configuration plugin. See the following page for an example:

https://wiki.eclipse.org/Tycho/Packaging_Types#eclipse-test-plugin
Re: Wrong tested application is started when tests are running with Tycho [message #1804577 is a reply to message #1800213] Thu, 28 March 2019 21:16 Go to previous messageGo to next message
Alexey Chibisov is currently offline Alexey ChibisovFriend
Messages: 5
Registered: December 2018
Junior Member
Well, I also missed your answer :( Sorry...
I've tried to configure target platform in my test bundle, but it didn't help.
I tried to reference on core plugin and to the main feature - no results.
All bundle configuration of test application you can see on github: https://github.com/dbeaver/dbeaver
Re: Wrong tested application is started when tests are running with Tycho [message #1805183 is a reply to message #1804577] Tue, 09 April 2019 13:05 Go to previous messageGo to next message
Eclipse UserFriend
I took a look at the main github project and your own fork, but I can't find the org.jkiss.dbeaver.uitests plugin?
Re: Wrong tested application is started when tests are running with Tycho [message #1805601 is a reply to message #1805183] Thu, 18 April 2019 12:52 Go to previous messageGo to next message
Alexey Chibisov is currently offline Alexey ChibisovFriend
Messages: 5
Registered: December 2018
Junior Member
I've just pushed it to my fork: https://github.com/tchibatron/dbeaver/tree/functional-tests/test/org.jkiss.dbeaver.uitests

I specified feature in a target platform configuration.
My current error is:
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-surefire-plugin:1.1.0:test (default-test) on project org.jkiss.dbeaver.uitests: Could not find application "org.jkiss.dbeaver.core.application.standalone" in the test runtime. Make sure that the test runtime includes the bundle which defines this application. -> [Help 1]

[Updated on: Thu, 18 April 2019 12:55]

Report message to a moderator

Re: Wrong tested application is started when tests are running with Tycho [message #1805606 is a reply to message #1805601] Thu, 18 April 2019 14:59 Go to previous messageGo to next message
Eclipse UserFriend
It took a while to figure out, but you had some lower-case names in the target-platform-configuration stanzas. Unfortunately they were being silently ignored.

[Updated on: Thu, 18 April 2019 15:02] by Moderator

Report message to a moderator

Re: Wrong tested application is started when tests are running with Tycho [message #1805676 is a reply to message #1805606] Sat, 20 April 2019 15:17 Go to previous message
Alexey Chibisov is currently offline Alexey ChibisovFriend
Messages: 5
Registered: December 2018
Junior Member
Thank you very much! It works now :)
Previous Topic:Draw2D Support in GEF
Next Topic:Unable to create run configuration with SWTBot
Goto Forum:
  


Current Time: Tue Apr 16 07:56:34 GMT 2024

Powered by FUDForum. Page generated in 0.02733 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top