Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 271257 - LinkageError when using org.junit.Assert
Summary: LinkageError when using org.junit.Assert
Status: RESOLVED DUPLICATE of bug 268881
Alias: None
Product: SWTBot
Classification: Technology
Component: SWTBot (show other bugs)
Version: 2.0.0-dev   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-05 18:59 EDT by Will Horn CLA
Modified: 2009-04-28 18:48 EDT (History)
0 users

See Also:


Attachments
TestCase (1.91 KB, application/octet-stream)
2009-04-05 18:59 EDT, Will Horn CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Will Horn CLA 2009-04-05 18:59:56 EDT
Created attachment 130952 [details]
TestCase

Build ID: 2.0.0.204-dev

Steps To Reproduce:
1. Install SWTBot into Eclipse 3.5M6
2. Import the attached test case project
3. Run swtbot.LinkageTest as an SWTBot test
4. Get the following error:

java.lang.LinkageError: loader constraint violation: loader (instance of org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) previously initiated loading for a different type with name "org/hamcrest/Matcher"

Both org.junit4 and org.hamcrest export the org.hamcrest package and both bundles contain org.hamcrest.Matcher.  The failing method call is:
    org.junit.Assert.assertThat("asdf", is("asdf"));

I think either the org.junit4 bundle needs to be fixed (see bug 266962), or the org.hamcrest package SWTBot ships needs to exclude hamcrest-core.
Comment 1 Ketan Padegaonkar CLA 2009-04-28 18:48:08 EDT
Closing as duplicate of bug bug 268881.

*** This bug has been marked as a duplicate of bug 268881 ***