Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] Getting a combination of JUnit4, Hamcrest, Mockito to work in Eclipse AND Tycho

Thanks Hendrik,

We'll consider doing the same :).

Best
Stephan

Am 21.07.2017 um 11:45 schrieb Henrik Steudel:
> Hi Stephan,
> We provide the whole target platform as hosted P2-Repository for both
> Eclipse and Tycho. Details:
> http://wiki.eclipse.org/Equinox/p2/Publisher#Features_And_Bundles_Publisher_Application
> 
> 
> We are not using the p2-maven-plugin-way to generate dependencies "on
> the fly". Would be neat to configure some kind of transformer comparable
> to maven-shade-plugin, though.
> 
> Kind regards
> Henrik
> 
> Am 21.07.2017 um 11:20 schrieb Stephan Druskat:
>> Thanks Hendrik,
>>
>> Have you automated the "unsigning", e.g., with maven-jarsigner-plugin?
>> If so, could you please provide an example? That'd be great!
>>
>> Many thanks
>> Stephan
>>
>> Am 21.07.2017 um 10:26 schrieb Henrik Steudel:
>>> Hi,
>>> we ran into the same problem with non-matching signer information and
>>> worked around that by stripping signer information from
>>> org.hamcrest.core: META-INF\ECLIPSE_.RSA, META-INF\ECLIPSE_.SF and
>>> trailing signer entries from manifest itself.
>>>
>>> Kind regards
>>> Henrik
>>>
>>> Am 20.07.2017 um 16:27 schrieb Stephan Druskat:
>>>> Thanks,
>>>>
>>>> I've tried the Orbit bundles first of course, but they let the test
>>>> fail
>>>> when running in the IDE:
>>>>
>>>> - java.lang.SecurityException: class "org.hamcrest.Matchers"'s signer
>>>> information does not match signer information of other classes in the
>>>> same package
>>>>
>>>> Thanks!
>>>> Stephan
>>>>
>>>> Am 20.07.2017 um 16:19 schrieb Matthew Piggott:
>>>>> Not really answering your question but Orbit has both JUnit and
>>>>> Hamcrest
>>>>> -
>>>>> http://download.eclipse.org/tools/orbit/downloads/drops/R20170516192513/
>>>>>
>>>>>
>>>>> Mockito is there too but is an older version.
>>>>>
>>>>> On 20 July 2017 at 10:12, Stephan Druskat <stephan.druskat@xxxxxxxxx
>>>>> <mailto:stephan.druskat@xxxxxxxxx>> wrote:
>>>>>
>>>>>       Dear List,
>>>>>
>>>>>       I've managed to get JUnit 4.12 + Hamcrest 1.3 + Mockito 2.8.47
>>>>> to work
>>>>>       in Eclipse so that when I add them as dependencies, the tests
>>>>> will run.
>>>>>
>>>>>       (The way I've done this is using the p2-maven-plugin
>>>>>       (https://github.com/reficio/p2-maven-plugin/
>>>>>       <https://github.com/reficio/p2-maven-plugin/>) to bundle the
>>>>> following
>>>>>       artifacts from Maven Central into plugins/a feature and
>>>>> provie them
>>>>>       via P2:
>>>>>
>>>>>       https://github.com/reficio/p2-maven-plugin/
>>>>>       <https://github.com/reficio/p2-maven-plugin/>
>>>>>       - junit 4.12
>>>>>       - org.mockito.mockito-core 2.8.47
>>>>>       - org.hamcrest.all 1.3.0
>>>>>       )
>>>>>
>>>>>       Adding the plugins to my test fragment as dependencies makes the
>>>>> tests
>>>>>       run in Eclipse.
>>>>>
>>>>>       However, the Tycho build of the same fragment will fail with the
>>>>>       following messages:
>>>>>
>>>>>       java.lang.LinkageError: loader constraint violation: loader
>>>>> (instance of
>>>>>       org/eclipse/osgi/internal/loader/EquinoxClassLoader) previously
>>>>>       initiated loading for a different type with name
>>>>> "org/hamcrest/Matcher"
>>>>>               at java.lang.ClassLoader.defineClass1(Native Method)
>>>>>               at
>>>>> java.lang.ClassLoader.defineClass(ClassLoader.java:763)
>>>>>               at
>>>>>     
>>>>> org.eclipse.osgi.internal.loader.ModuleClassLoader.defineClass(ModuleClassLoader.java:273)
>>>>>
>>>>>
>>>>>               at
>>>>>     
>>>>> org.eclipse.osgi.internal.loader.classpath.ClasspathManager.defineClass(ClasspathManager.java:632)
>>>>>
>>>>>
>>>>>               at
>>>>>     
>>>>> org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findClassImpl(ClasspathManager.java:586)
>>>>>
>>>>>
>>>>>               at
>>>>>     
>>>>> org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClassImpl(ClasspathManager.java:538)
>>>>>
>>>>>
>>>>>               at
>>>>>     
>>>>> org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:525)
>>>>>
>>>>>
>>>>>               at
>>>>>     
>>>>> org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:325)
>>>>>
>>>>>
>>>>>               at
>>>>>     
>>>>> org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:345)
>>>>>
>>>>>
>>>>>               at
>>>>>     
>>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:423)
>>>>>
>>>>>
>>>>>               at
>>>>>     
>>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:372)
>>>>>
>>>>>
>>>>>               at
>>>>>     
>>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:364)
>>>>>
>>>>>
>>>>>               at
>>>>>     
>>>>> org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:161)
>>>>>
>>>>>
>>>>>               at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
>>>>>               at
>>>>> org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:12)
>>>>>               at org.junit.Assert.assertThat(Assert.java:956)
>>>>>               at org.junit.Assert.assertThat(Assert.java:923)
>>>>>
>>>>>       So it seems that some other plugin is loading the package
>>>>>       "org.hamcrest.Matcher" before this fragment does. This is
>>>>> probably due
>>>>>       to the import/export/partial import/partial export chaos
>>>>> surrounding the
>>>>>       JUnit/Hamcrest/Mockito setup.
>>>>>
>>>>>       Does anyone have an idea, or even better: a working example, of
>>>>> how to
>>>>>       get the three components work together both within the IDE (for
>>>>> quick
>>>>>       checks on whether tests run) and Tycho (for checks during the
>>>>> build?
>>>>>
>>>>>       Many thanks indeed!
>>>>>       Best
>>>>>       Stephan
>>>>>       _______________________________________________
>>>>>       tycho-user mailing list
>>>>>       tycho-user@xxxxxxxxxxx <mailto:tycho-user@xxxxxxxxxxx>
>>>>>       To change your delivery options, retrieve your password, or
>>>>>       unsubscribe from this list, visit
>>>>>       https://dev.eclipse.org/mailman/listinfo/tycho-user
>>>>>       <https://dev.eclipse.org/mailman/listinfo/tycho-user>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> tycho-user mailing list
>>>>> tycho-user@xxxxxxxxxxx
>>>>> To change your delivery options, retrieve your password, or
>>>>> unsubscribe from this list, visit
>>>>> https://dev.eclipse.org/mailman/listinfo/tycho-user
>>>>>
>>>> _______________________________________________
>>>> tycho-user mailing list
>>>> tycho-user@xxxxxxxxxxx
>>>> To change your delivery options, retrieve your password, or
>>>> unsubscribe from this list, visit
>>>> https://dev.eclipse.org/mailman/listinfo/tycho-user
>>>
> 


Back to the top