Discussion:
Problems running tests with luna platform
(too old to reply)
Simon Goodall
2015-03-16 22:23:27 UTC
Permalink
Hi,

I have been trying to migrate my product from a Indigo base to a Luna base.
I have things working in Eclipse, but I am having trouble getting my unit
tests to run in Tycho. Specifically I seem to be unable to add Mockito
(mockito-all obtained from maven central) as a dependency to my test
project either as a real plugin or a fragment). Removing the mockito
dependency allows the test to pass. Tycho reports a fairly vague bundle is
not found exception for my test bundle/fragment. However there does appear
to be a number of unresolved capability requirements which I am unsure
where they have come from.

Any suggestions on getting this to run? I have attached the error output of
the test run and I have uploaded a sample project to github [1]. This can
be run with "mvn -X clean integration-test -Pluna"

[1] https://github.com/drsgoodall/tycho-mockito-issue

Thanks,

Simon
Marc-André Laperle
2015-03-16 23:18:10 UTC
Permalink
I don't think you can add dependencies (mockito-all) from maven like that, it has to be an Eclipse plugin. I tried your example and added the mockito from Eclipse Orbit [1] and it works. See attached patch.

[1] http://download.eclipse.org/tools/orbit/downloads/

Hope this helps,
Marc-Andre

________________________________
From: tycho-user-***@eclipse.org [tycho-user-***@eclipse.org] on behalf of Simon Goodall [***@simongoodall.co.uk]
Sent: Monday, 16 March 2015 6:23 PM
To: Tycho user list
Subject: [tycho-user] Problems running tests with luna platform

Hi,

I have been trying to migrate my product from a Indigo base to a Luna base. I have things working in Eclipse, but I am having trouble getting my unit tests to run in Tycho. Specifically I seem to be unable to add Mockito (mockito-all obtained from maven central) as a dependency to my test project either as a real plugin or a fragment). Removing the mockito dependency allows the test to pass. Tycho reports a fairly vague bundle is not found exception for my test bundle/fragment. However there does appear to be a number of unresolved capability requirements which I am unsure where they have come from.

Any suggestions on getting this to run? I have attached the error output of the test run and I have uploaded a sample project to github [1]. This can be run with "mvn -X clean integration-test -Pluna"

[1] https://github.com/drsgoodall/tycho-mockito-issue

Thanks,

Simon
Jeff MAURY
2015-03-16 23:25:46 UTC
Permalink
The problem is that the mockito JAR you are referencing does need
the org.objenesis package which is not available on the Luna P2 repo.

Regards
Jeff


On Tue, Mar 17, 2015 at 12:18 AM, Marc-André Laperle <
Post by Marc-André Laperle
I don't think you can add dependencies (mockito-all) from maven like
that, it has to be an Eclipse plugin. I tried your example and added the
mockito from Eclipse Orbit [1] and it works. See attached patch.
[1] http://download.eclipse.org/tools/orbit/downloads/
Hope this helps,
Marc-Andre
------------------------------
*Sent:* Monday, 16 March 2015 6:23 PM
*To:* Tycho user list
*Subject:* [tycho-user] Problems running tests with luna platform
Hi,
I have been trying to migrate my product from a Indigo base to a Luna
base. I have things working in Eclipse, but I am having trouble getting my
unit tests to run in Tycho. Specifically I seem to be unable to add Mockito
(mockito-all obtained from maven central) as a dependency to my test
project either as a real plugin or a fragment). Removing the mockito
dependency allows the test to pass. Tycho reports a fairly vague bundle is
not found exception for my test bundle/fragment. However there does appear
to be a number of unresolved capability requirements which I am unsure
where they have come from.
Any suggestions on getting this to run? I have attached the error output
of the test run and I have uploaded a sample project to github [1]. This
can be run with "mvn -X clean integration-test -Pluna"
[1] https://github.com/drsgoodall/tycho-mockito-issue
Thanks,
Simon
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
--
Jeff MAURY


"Legacy code" often differs from its suggested alternative by actually
working and scaling.
- Bjarne Stroustrup

http://www.jeffmaury.com
http://riadiscuss.jeffmaury.com
http://www.twitter.com/jeffmaury
Mickael Istria
2015-03-17 06:57:43 UTC
Permalink
Orbit provides Mockito 1.9.5 in
http://download.eclipse.org/tools/orbit/downloads/drops/R20150124073747/repository/
. You should try to consume this bundle instead of the Maven artifact.
HTH
--
Mickael Istria
Eclipse developer at JBoss, by Red Hat <http://www.jboss.org/tools>
My blog <http://mickaelistria.wordpress.com> - My Tweets
<http://twitter.com/mickaelistria>
Simon Goodall
2015-03-17 09:16:47 UTC
Permalink
Hi Mickael,

The orbit version looks like the way forward and Marc-Andre's patch works
for my test case. I'll see if I can integrate it into my full build and
eclipse environment.

Thanks,

Simon
Post by Mickael Istria
Orbit provides Mockito 1.9.5 in
http://download.eclipse.org/tools/orbit/downloads/drops/R20150124073747/repository/
. You should try to consume this bundle instead of the Maven artifact.
HTH
--
Mickael Istria
Eclipse developer at JBoss, by Red Hat <http://www.jboss.org/tools>
My blog <http://mickaelistria.wordpress.com> - My Tweets
<http://twitter.com/mickaelistria>
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
Simon Goodall
2015-03-17 09:16:44 UTC
Permalink
Hi Jeff,

The bundle should contain all of the required dependencies so I do not
believe this is the problem.Objenesis is both imported and exported. Adding
an explicit requirement on org.objenesis to the test target platform from
orbit does not help. Perhaps the luna bundles/packages are conflicting with
the build in ones?

Thanks,

Simon
Post by Jeff MAURY
The problem is that the mockito JAR you are referencing does need
the org.objenesis package which is not available on the Luna P2 repo.
Regards
Jeff
On Tue, Mar 17, 2015 at 12:18 AM, Marc-André Laperle <
Post by Marc-André Laperle
I don't think you can add dependencies (mockito-all) from maven like
that, it has to be an Eclipse plugin. I tried your example and added the
mockito from Eclipse Orbit [1] and it works. See attached patch.
[1] http://download.eclipse.org/tools/orbit/downloads/
Hope this helps,
Marc-Andre
------------------------------
*Sent:* Monday, 16 March 2015 6:23 PM
*To:* Tycho user list
*Subject:* [tycho-user] Problems running tests with luna platform
Hi,
I have been trying to migrate my product from a Indigo base to a Luna
base. I have things working in Eclipse, but I am having trouble getting my
unit tests to run in Tycho. Specifically I seem to be unable to add Mockito
(mockito-all obtained from maven central) as a dependency to my test
project either as a real plugin or a fragment). Removing the mockito
dependency allows the test to pass. Tycho reports a fairly vague bundle is
not found exception for my test bundle/fragment. However there does appear
to be a number of unresolved capability requirements which I am unsure
where they have come from.
Any suggestions on getting this to run? I have attached the error
output of the test run and I have uploaded a sample project to github [1].
This can be run with "mvn -X clean integration-test -Pluna"
[1] https://github.com/drsgoodall/tycho-mockito-issue
Thanks,
Simon
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
--
Jeff MAURY
"Legacy code" often differs from its suggested alternative by actually
working and scaling.
- Bjarne Stroustrup
http://www.jeffmaury.com
http://riadiscuss.jeffmaury.com
http://www.twitter.com/jeffmaury
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
Simon Goodall
2015-03-17 09:51:32 UTC
Permalink
Adding just org.hamcrest as an additional test target dep appears to fix
the issue with my maven bundle. I am still not sure why this is just a
problem with Luna.

Simon
Post by Simon Goodall
Hi Jeff,
The bundle should contain all of the required dependencies so I do not
believe this is the problem.Objenesis is both imported and exported. Adding
an explicit requirement on org.objenesis to the test target platform from
orbit does not help. Perhaps the luna bundles/packages are conflicting with
the build in ones?
Thanks,
Simon
Post by Jeff MAURY
The problem is that the mockito JAR you are referencing does need
the org.objenesis package which is not available on the Luna P2 repo.
Regards
Jeff
On Tue, Mar 17, 2015 at 12:18 AM, Marc-André Laperle <
Post by Marc-André Laperle
I don't think you can add dependencies (mockito-all) from maven like
that, it has to be an Eclipse plugin. I tried your example and added the
mockito from Eclipse Orbit [1] and it works. See attached patch.
[1] http://download.eclipse.org/tools/orbit/downloads/
Hope this helps,
Marc-Andre
------------------------------
*Sent:* Monday, 16 March 2015 6:23 PM
*To:* Tycho user list
*Subject:* [tycho-user] Problems running tests with luna platform
Hi,
I have been trying to migrate my product from a Indigo base to a Luna
base. I have things working in Eclipse, but I am having trouble getting my
unit tests to run in Tycho. Specifically I seem to be unable to add Mockito
(mockito-all obtained from maven central) as a dependency to my test
project either as a real plugin or a fragment). Removing the mockito
dependency allows the test to pass. Tycho reports a fairly vague bundle is
not found exception for my test bundle/fragment. However there does appear
to be a number of unresolved capability requirements which I am unsure
where they have come from.
Any suggestions on getting this to run? I have attached the error
output of the test run and I have uploaded a sample project to github [1].
This can be run with "mvn -X clean integration-test -Pluna"
[1] https://github.com/drsgoodall/tycho-mockito-issue
Thanks,
Simon
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
--
Jeff MAURY
"Legacy code" often differs from its suggested alternative by actually
working and scaling.
- Bjarne Stroustrup
http://www.jeffmaury.com
http://riadiscuss.jeffmaury.com
http://www.twitter.com/jeffmaury
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
Simon Goodall
2015-03-17 09:09:22 UTC
Permalink
Hi Marc-Andre,

Thanks for the orbit pointer and the patch. The maven artifact is an OSGi
bundle and I have been using it (v 1.9.5) for quite some time now with no
problems. It is only just become a problem when attempting to run with
Luna. I previously switched from orbit to the maven combined bundle due to
problems getting the dependency set/order correct - conflicting eclipse and
orbit bundles and getting it to run in eclipse and in Tycho. I'll try again
with the newer repo.

Thanks,

Simon

On 16 March 2015 at 23:18, Marc-André Laperle <
Post by Marc-André Laperle
I don't think you can add dependencies (mockito-all) from maven like
that, it has to be an Eclipse plugin. I tried your example and added the
mockito from Eclipse Orbit [1] and it works. See attached patch.
[1] http://download.eclipse.org/tools/orbit/downloads/
Hope this helps,
Marc-Andre
------------------------------
*Sent:* Monday, 16 March 2015 6:23 PM
*To:* Tycho user list
*Subject:* [tycho-user] Problems running tests with luna platform
Hi,
I have been trying to migrate my product from a Indigo base to a Luna
base. I have things working in Eclipse, but I am having trouble getting my
unit tests to run in Tycho. Specifically I seem to be unable to add Mockito
(mockito-all obtained from maven central) as a dependency to my test
project either as a real plugin or a fragment). Removing the mockito
dependency allows the test to pass. Tycho reports a fairly vague bundle is
not found exception for my test bundle/fragment. However there does appear
to be a number of unresolved capability requirements which I am unsure
where they have come from.
Any suggestions on getting this to run? I have attached the error output
of the test run and I have uploaded a sample project to github [1]. This
can be run with "mvn -X clean integration-test -Pluna"
[1] https://github.com/drsgoodall/tycho-mockito-issue
Thanks,
Simon
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
Simon Goodall
2015-03-17 11:01:43 UTC
Permalink
Unfortunately I cannot use the orbit mockito as this results in the
exception "signer information does not match signer information of other
classes in the same package" caused I believe by eclipse signing the
bundles. I now recall this being the reason for switching to the maven
version of Mockito. As noted in one of my other replies, adding
org.hamcrest as an explicit target platform dep seems to work.

Simon.
Post by Simon Goodall
Hi Marc-Andre,
Thanks for the orbit pointer and the patch. The maven artifact is an OSGi
bundle and I have been using it (v 1.9.5) for quite some time now with no
problems. It is only just become a problem when attempting to run with
Luna. I previously switched from orbit to the maven combined bundle due to
problems getting the dependency set/order correct - conflicting eclipse and
orbit bundles and getting it to run in eclipse and in Tycho. I'll try again
with the newer repo.
Thanks,
Simon
On 16 March 2015 at 23:18, Marc-André Laperle <
Post by Marc-André Laperle
I don't think you can add dependencies (mockito-all) from maven like
that, it has to be an Eclipse plugin. I tried your example and added the
mockito from Eclipse Orbit [1] and it works. See attached patch.
[1] http://download.eclipse.org/tools/orbit/downloads/
Hope this helps,
Marc-Andre
------------------------------
*Sent:* Monday, 16 March 2015 6:23 PM
*To:* Tycho user list
*Subject:* [tycho-user] Problems running tests with luna platform
Hi,
I have been trying to migrate my product from a Indigo base to a Luna
base. I have things working in Eclipse, but I am having trouble getting my
unit tests to run in Tycho. Specifically I seem to be unable to add Mockito
(mockito-all obtained from maven central) as a dependency to my test
project either as a real plugin or a fragment). Removing the mockito
dependency allows the test to pass. Tycho reports a fairly vague bundle is
not found exception for my test bundle/fragment. However there does appear
to be a number of unresolved capability requirements which I am unsure
where they have come from.
Any suggestions on getting this to run? I have attached the error
output of the test run and I have uploaded a sample project to github [1].
This can be run with "mvn -X clean integration-test -Pluna"
[1] https://github.com/drsgoodall/tycho-mockito-issue
Thanks,
Simon
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
Continue reading on narkive:
Loading...