Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » UI Tests fail on Mac
UI Tests fail on Mac [message #1718609] Mon, 28 December 2015 09:48 Go to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
Hi

first of all, I don't have a Mac, but I know many of you have one so you
could probably help me with UI tests failure on Mac, for one of my Xtext
project, https://github.com/LorenzoBettini/jbase (I already set
-XstartOnFirstThread when running on Mac)

A user reported UI tests failures on Mac,
https://github.com/LorenzoBettini/jbase/issues/3. The UI tests concern
content assist, workbench integration, and variable extract refactoring.

The tests that fail need the Java classpath. On the issue the complete
failure is reported, but the suspicious parts can be summarized:

ERRORS OMITTED: The type <JRE type> cannot be resolved. It is indirectly
referenced from required .class files...

java.lang.AssertionError: No such proposal: toString Found:

Loading target platform... DONE.
org.eclipse.jdt.internal.compiler.problem.AbortCompilation: Pb(324) The
type java.lang.Object cannot be resolved. It is indirectly referenced
from required .class files

Unbound classpath container: 'JRE System Library [JavaSE-1.6]' in
project 'TestProject'
The project cannot be built until build path errors are resolved
Couldn't resolve reference to JvmType 'String'.

So I guess that JRE is not picked when running UI tests. Surefire also
reports this message

objc[881]: Class JavaLaunchHelper is implemented in both
/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/jre/bin/java
and
/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/jre/lib/libinstrument.dylib.
One of the two will be used. Which one is undefined.

are there any special installation configurations for Java on Mac?

many thanks in advance
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book


Re: UI Tests fail on Mac [message #1718611 is a reply to message #1718609] Mon, 28 December 2015 09:59 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
did you set the -XstartOnFirstThread https://wiki.eclipse.org/Tycho/FAQ
but your problem seems different.



Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Mon, 28 December 2015 10:00]

Report message to a moderator

Re: UI Tests fail on Mac [message #1718626 is a reply to message #1718611] Mon, 28 December 2015 12:03 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
looks like jdt.launching.osx* is missing on the classpath

adding a dependeny to org.eclipse.jdt.launching.macosx gives an error that it is not available.
looks like the target platform config is messed up.

https://dev.eclipse.org/mhonarc/lists/tycho-user/msg06622.html
mentions a similar problem but has no solution for it

adding the plugin explicitely to the target file gives

Caused by: java.lang.IllegalStateException: org.eclipse.jdt.launching.macosx 3.3.0.v20150313-0517 cannot be installed in this environment because its filter is not applicable.
at org.eclipse.equinox.internal.p2.director.Slicer.validateInput(Slicer.java:106)
at org.eclipse.equinox.internal.p2.director.Slicer.slice(Slicer.java:57)
at org.eclipse.tycho.p2.util.resolution.AbstractSlicerResolutionStrategy.slice(AbstractSlicerResolutionStrategy.java:76)
... 29 more



(in my projects i always build against a binary built target)

i have no idea on how to fix this.
maybe the tycho mailing list is a better place to ask


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: UI Tests fail on Mac [message #1718631 is a reply to message #1718626] Mon, 28 December 2015 13:21 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
On 28/12/2015 13:03, Christian Dietrich wrote:
> looks like jdt.launching.osx* is missing on the classpath
>
> adding a dependeny to org.eclipse.jdt.launching.macosx gives an error
> that it is not available.
> looks like the target platform config is messed up.
>
> https://dev.eclipse.org/mhonarc/lists/tycho-user/msg06622.html mentions
> a similar problem but has no solution for it
>
> adding the plugin explicitely to the target file gives
>
> Caused by: java.lang.IllegalStateException:
> org.eclipse.jdt.launching.macosx 3.3.0.v20150313-0517 cannot be
> installed in this environment because its filter is not applicable.
> at
> org.eclipse.equinox.internal.p2.director.Slicer.validateInput(Slicer.java:106)
>
> at
> org.eclipse.equinox.internal.p2.director.Slicer.slice(Slicer.java:57)
> at
> org.eclipse.tycho.p2.util.resolution.AbstractSlicerResolutionStrategy.slice(AbstractSlicerResolutionStrategy.java:76)
>
> ... 29 more
>
>
>
> (in my projects i always build against a binary built target)
>
> i have no idea on how to fix this.
> maybe the tycho mailing list is a better place to ask

Hi

what do you mean by "binary built target"?

I thought the error might be due to this info

objc[881]: Class JavaLaunchHelper is implemented in both
/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/jre/bin/java
and
/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/jre/lib/libinstrument.dylib.
One of the two will be used. Which one is undefined.

Do you have a JRE or a JDK on your machine?

thanks in advance
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book


Re: UI Tests fail on Mac [message #1718632 is a reply to message #1718626] Mon, 28 December 2015 13:26 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
the following worked for me

- adapt the target-plaform-configuration places

<plugin>
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>target-platform-configuration</artifactId>
				<configuration>
					<environments>
          			</environments>
					<dependency-resolution>
						<extraRequirements>
							<!-- to get the org.eclipse.osgi.compatibility.state plugin iff 
							the targeted Eclipse version (e.g., Luna) has it
							(backwards compatible with kepler and previous versions) -->
							<requirement>
								<type>eclipse-feature</type>
								<id>org.eclipse.rcp</id>
								<versionRange>0.0.0</versionRange>
							</requirement>
							
						</extraRequirements>
					</dependency-resolution>
				</configuration>
			</plugin>


and add the explict dependency to the manifest

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: jbase.tests
Bundle-Vendor: Lorenzo Bettini
Bundle-Version: 0.1.0.qualifier
Bundle-SymbolicName: jbase.tests; singleton:=true
Bundle-ActivationPolicy: lazy
Require-Bundle: jbase,
 jbase.ui,
 org.eclipse.core.runtime,
 org.eclipse.xtext.junit4,
 org.eclipse.xtext.xbase.lib,
 org.eclipse.ui.workbench;resolution:=optional,
 org.objectweb.asm;bundle-version="[5.0.1,6.0.0)";resolution:=optional,
 org.eclipse.xtext.xbase.junit,
 org.eclipse.jdt.core,
 org.eclipse.jdt.launching.macosx;resolution:=optional,
 jbase.testlanguage.tests,
 org.eclipse.xtext.common.types.ui,
 org.eclipse.ui.ide,
 org.eclipse.pde.core;bundle-version="3.10.101"
Import-Package: org.apache.log4j,
 org.junit;version="4.5.0",
 org.junit.runner;version="4.5.0",
 org.junit.runner.manipulation;version="4.5.0",
 org.junit.runner.notification;version="4.5.0",
 org.junit.runners;version="4.5.0",
 org.junit.runners.model;version="4.5.0",
 org.hamcrest.core
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Export-Package: jbase,
 jbase



still the question why this does not happen automagically (tycho bug?)


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: UI Tests fail on Mac [message #1718633 is a reply to message #1718632] Mon, 28 December 2015 13:26 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
j have a jdk

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: UI Tests fail on Mac [message #1718645 is a reply to message #1718632] Mon, 28 December 2015 17:43 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
Hi Christian

please see my comments inline

On 28/12/2015 14:26, Christian Dietrich wrote:
> the following worked for me
>
> - adapt the target-plaform-configuration places
>
>
> <plugin>
> <groupId>org.eclipse.tycho</groupId>
> <artifactId>target-platform-configuration</artifactId>
> <configuration>
> <environments>
> </environments>
> <dependency-resolution>
> <extraRequirements>
> <!-- to get the
> org.eclipse.osgi.compatibility.state plugin iff
> the targeted Eclipse version (e.g., Luna)
> has it
> (backwards compatible with kepler and
> previous versions) -->
> <requirement>
> <type>eclipse-feature</type>
> <id>org.eclipse.rcp</id>
> <versionRange>0.0.0</versionRange>
> </requirement>
>
> </extraRequirements>
> </dependency-resolution>
> </configuration>
> </plugin>
>

This is already specified in the pom.xml of the tests plugin...
do you mean this has to be specified somewhere else?

>
> and add the explict dependency to the manifest
>
>
> Manifest-Version: 1.0
> Bundle-ManifestVersion: 2
> Bundle-Name: jbase.tests
> Bundle-Vendor: Lorenzo Bettini
> Bundle-Version: 0.1.0.qualifier
> Bundle-SymbolicName: jbase.tests; singleton:=true
> Bundle-ActivationPolicy: lazy
> Require-Bundle: jbase,
> jbase.ui,
> org.eclipse.core.runtime,
> org.eclipse.xtext.junit4,
> org.eclipse.xtext.xbase.lib,
> org.eclipse.ui.workbench;resolution:=optional,
> org.objectweb.asm;bundle-version="[5.0.1,6.0.0)";resolution:=optional,
> org.eclipse.xtext.xbase.junit,
> org.eclipse.jdt.core,
> org.eclipse.jdt.launching.macosx;resolution:=optional,
> jbase.testlanguage.tests,
> org.eclipse.xtext.common.types.ui,
> org.eclipse.ui.ide,
> org.eclipse.pde.core;bundle-version="3.10.101"
> Import-Package: org.apache.log4j,
> org.junit;version="4.5.0",
> org.junit.runner;version="4.5.0",
> org.junit.runner.manipulation;version="4.5.0",
> org.junit.runner.notification;version="4.5.0",
> org.junit.runners;version="4.5.0",
> org.junit.runners.model;version="4.5.0",
> org.hamcrest.core
> Bundle-RequiredExecutionEnvironment: JavaSE-1.7
> Export-Package: jbase,
> jbase

Does it work also with this dependency?

org.eclipse.jdt.launching

i.e., the one that does not depend on the operating system?

I saw your pull request https://github.com/LorenzoBettini/jbase/pull/9
(the job for pull request fails, but that's due to my experiment for
using MacOSX build in Travis; this fails for other reasons)

But in your pull request I don't see the changes you mention: the only
commit of the pull request,
https://github.com/cdietrich/jbase/commit/edc4206fb747f7134861a2a39ccfac3b1cd1d912
, is the one which removes the <environment> specifications which I had
recently pushed... is that removal crucial for making it work?

thanks again
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book


Re: UI Tests fail on Mac [message #1718647 is a reply to message #1718645] Mon, 28 December 2015 17:57 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
no unfortunately not. thus i made the dependency optional in my pullreq.
(seems the git add missed the adoptions to the manifest)


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: UI Tests fail on Mac [message #1718650 is a reply to message #1718647] Mon, 28 December 2015 18:02 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
and yes: it is not working if i list the environments explicitely

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: UI Tests fail on Mac [message #1718659 is a reply to message #1718650] Mon, 28 December 2015 19:12 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
i found another solution

<plugin>
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>target-platform-configuration</artifactId>
				<configuration>
					<dependency-resolution>
						<extraRequirements>
							<!-- to get the org.eclipse.osgi.compatibility.state plugin iff 
							the targeted Eclipse version (e.g., Luna) has it
							(backwards compatible with kepler and previous versions) -->
							<requirement>
								<type>eclipse-feature</type>
								<id>org.eclipse.rcp</id>
								<versionRange>0.0.0</versionRange>
							</requirement>
							<requirement>
								<type>eclipse-feature</type>
								<id>org.eclipse.jdt</id>
								<versionRange>0.0.0</versionRange>
							</requirement>
						</extraRequirements>
					</dependency-resolution>
				</configuration>
			</plugin>


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: UI Tests fail on Mac [message #1718741 is a reply to message #1718659] Tue, 29 December 2015 16:26 Go to previous message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
On 12/28/2015 8:12 PM, Christian Dietrich wrote:
> i found another solution
>
>
> <plugin>
> <groupId>org.eclipse.tycho</groupId>
> <artifactId>target-platform-configuration</artifactId>
> <configuration>
> <dependency-resolution>
> <extraRequirements>
> <!-- to get the
> org.eclipse.osgi.compatibility.state plugin iff
> the targeted Eclipse version (e.g., Luna)
> has it
> (backwards compatible with kepler and
> previous versions) -->
> <requirement>
> <type>eclipse-feature</type>
> <id>org.eclipse.rcp</id>
> <versionRange>0.0.0</versionRange>
> </requirement>
> <requirement>
> <type>eclipse-feature</type>
> <id>org.eclipse.jdt</id>
> <versionRange>0.0.0</versionRange>
> </requirement>
> </extraRequirements>
> </dependency-resolution>
> </configuration>
> </plugin>
>

Thank you Christian!
This really solves the problem :)
Apparently, org.eclipse.jdt feature drags in also jdt.launching.macosx
(even in Linux).

cheers
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book


Previous Topic:Reference to an object without name
Next Topic:EMF Model to .mydsl file Validation
Goto Forum:
  


Current Time: Thu Mar 28 18:38:39 GMT 2024

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

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

Back to the top