Retrieving the sytem registry from within JUnit [message #24633] |
Thu, 03 July 2008 10:29  |
Eclipse User |
|
|
|
Originally posted by: paul.pwrutter.com
Hi
I'm trying to write some JUnit tests that need to have access to a remote
system in order to copy files across. I am trying access the registry via
RSECorePlugin.getTheSystemRegistry(), which works fine within a UI Thread
but simply returns NULL from within a JUnit Thread. Do you have any advice
on how to retrieve the system registry from within JUnit? I am currently
using:
Display.getDefault().syncExec(new Runnable() {
public void run() {
ISystemRegistry registry =
RSECorePlugin.getTheSystemRegistry();
}
});
But to no avail.
Many Thanks
Paul
|
|
|
Re: Retrieving the sytem registry from within JUnit [message #24754 is a reply to message #24633] |
Fri, 11 July 2008 10:01  |
Eclipse User |
|
|
|
Hi Paul,
I think that at the time being, you'll need to run your unit
tests as "JUnit Plug-in test" which starts a complete Eclipse
instance. Then, ensure that the RSEUIPlugin is loaded.
For example, look at our unit tests in org.eclipse.rse.tests
-- The RSEFileServiceTest as well as the RSEFileStoreTest classes should
have some helpful code for you.
Cheers,
--
Martin Oberhuber, Senior Member of Technical Staff, Wind River
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
Paul Rutter wrote:
> Hi
>
> I'm trying to write some JUnit tests that need to have access to a
> remote system in order to copy files across. I am trying access the
> registry via RSECorePlugin.getTheSystemRegistry(), which works fine
> within a UI Thread but simply returns NULL from within a JUnit Thread.
> Do you have any advice on how to retrieve the system registry from
> within JUnit? I am currently using:
>
> Display.getDefault().syncExec(new Runnable() {
> public void run() {
> ISystemRegistry registry =
> RSECorePlugin.getTheSystemRegistry(); }
> });
>
> But to no avail.
>
> Many Thanks
> Paul
>
>
|
|
|
Re: Retrieving the sytem registry from within JUnit [message #575912 is a reply to message #24633] |
Fri, 11 July 2008 10:01  |
Eclipse User |
|
|
|
Hi Paul,
I think that at the time being, you'll need to run your unit
tests as "JUnit Plug-in test" which starts a complete Eclipse
instance. Then, ensure that the RSEUIPlugin is loaded.
For example, look at our unit tests in org.eclipse.rse.tests
-- The RSEFileServiceTest as well as the RSEFileStoreTest classes should
have some helpful code for you.
Cheers,
--
Martin Oberhuber, Senior Member of Technical Staff, Wind River
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
Paul Rutter wrote:
> Hi
>
> I'm trying to write some JUnit tests that need to have access to a
> remote system in order to copy files across. I am trying access the
> registry via RSECorePlugin.getTheSystemRegistry(), which works fine
> within a UI Thread but simply returns NULL from within a JUnit Thread.
> Do you have any advice on how to retrieve the system registry from
> within JUnit? I am currently using:
>
> Display.getDefault().syncExec(new Runnable() {
> public void run() {
> ISystemRegistry registry =
> RSECorePlugin.getTheSystemRegistry(); }
> });
>
> But to no avail.
>
> Many Thanks
> Paul
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.07333 seconds