[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.platform] Re: JUnit and SWT
|
hi Daniel,
The -Djava.library.path thing should work, as long as you set its value to
the directory that contains the swt libraries.
As an alternative, this is no longer required as of 3.3M4 because swt will
auto-extract and find its libraries at runtime if needed. If you're able to
use a 3.3-stream milestone build instead of 3.2.x one that you're using then
this should just work.
Grant
"Daniel MacDonald" <dmacdonald@xxxxxxxxxxxxx> wrote in message
news:19ea0fc5a43093354887c3cf578c67c2$1@xxxxxxxxxxxxxxxxxx
> Hi there, I wonder if anyone can help me,
>
> I've been writing an RCP application and am in the middle of writing a
> load of JUnit tests but I can't figure out how to test anything that uses
> SWT or JFace. The main parts I want to test are my ViewParts, Dialogs and
> Actions.
>
> I've searched around and tried including SWT using the -Djava.library.path
> parameter in the VM arguments but without success.
>
> At the simplest level, if I try to do 'Shell s = new Shell()', I get this
> error:
>
> java.lang.UnsatisfiedLinkError: no swt-win32-3235 in java.library.path
> at java.lang.ClassLoader.loadLibrary(Unknown Source)
> at java.lang.Runtime.loadLibrary0(Unknown Source)
> at java.lang.System.loadLibrary(Unknown Source)
> at org.eclipse.swt.internal.Library.loadLibrary(Library.java:123)
> at org.eclipse.swt.internal.win32.OS.<clinit>(OS.java:18)
> at org.eclipse.swt.widgets.Widget.<clinit>(Widget.java:95)
> ....
>
> Is there any way to include SWT in a JUnit test suite?
>
> Or what are the alternatives? I've looked at Instantiations RCP Developer
> but due to the cost it is (probably) not an option
>
> Cheers
> Daniel
>
>