Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cbi-dev] CBI - Tycho - Mockito - signed bundles - problem

Hi all,

I am currently running into a problem with my Tycho-based build for RAP that is using various components from CBI, including the signing plug-in. Maybe someone has already a workaround, a good idea how to circumvent it, or maybe others are facing the same problem.

The short simplified description:
- There is a bundle A.bundle and a fragment with the test cases B.fragment.
- The jar files are signed with the new CBI signing plug-in (1.0.1)
- The tests are using Mockito...

(1) Tycho compiles A.bundle and creates the jar file
(2) tycho-pack200a, eclipse-jarsigner, and tycho-pack200b are doing their job and sign the A.bundle.jar
(3) Tycho compiles the B.fragment
(4) maven-surefire-plugin executes the plain JUnit tests from B.fragment
(4.1) Tests try to mock classes with Mockito from A.bundle but these cannot run because of this error:
'Caused by: org.apache.maven.surefire.testset.TestSetFailedException: org.eclipse.rap.rwt.osgi.internal.ApplicationLauncherImpl_Test; nested exception is java.lang.SecurityException: class "org.eclipse.rap.rwt.osgi.internal.ApplicationReferenceImpl"'s signer information does not match signer information of other classes in the same package'

A similar problem is described in [1], and [2] refers to exactly my problem.

Has anyone seen a similar problem, or has anyone a good suggestion how to solve this?

Thanks,
Markus


[1] BugĀ 349164 - Mockito cannot mock the classes under development
https://bugs.eclipse.org/bugs/show_bug.cgi?id=349164

[2] Issue 393: SecurityException when using spy() on class from signed JAR file
http://code.google.com/p/mockito/issues/detail?id=393


Back to the top