Skip to main content


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 14:29 Go to next message
Eclipse UserFriend
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 14:01 Go to previous message
Martin Oberhuber is currently offline Martin OberhuberFriend
Messages: 1007
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 14:01 Go to previous message
Martin Oberhuber is currently offline Martin OberhuberFriend
Messages: 1007
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: Sat Apr 27 03:41:53 GMT 2024

Powered by FUDForum. Page generated in 0.02855 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top