Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » DSDP - Target Management » Retrieving the sytem registry from within JUnit
Retrieving the sytem registry from within JUnit [message #24633] Thu, 03 July 2008 10:29 Go to next message
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 Go to previous message
Martin Oberhuber is currently offline Martin Oberhuber
Messages: 983
Registered: July 2009
Senior Member
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 Go to previous message
Martin Oberhuber is currently offline Martin Oberhuber
Messages: 983
Registered: July 2009
Senior Member
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
>
>
Previous Topic:Need a simple tutorial or help
Next Topic:Custom port for SSH in Remote Systems
Goto Forum:
  


Current Time: Thu Aug 21 10:15:44 EDT 2014

Powered by FUDForum. Page generated in 0.09765 seconds