Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsRetrieving the sytem registry from within JUnit
https://www.eclipse.org/forums/index.php/mv/msg/8056/24633/#msg_24633
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:
Many Thanks
Paul]]>2008-07-03T14:29:19-00:00Re: Retrieving the sytem registry from within JUnit
https://www.eclipse.org/forums/index.php/mv/msg/8056/575912/#msg_575912
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
>
>]]>Martin Oberhuber2008-07-11T14:01:51-00:00Re: Retrieving the sytem registry from within JUnit
https://www.eclipse.org/forums/index.php/mv/msg/8056/24754/#msg_24754
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
>
>]]>Martin Oberhuber2008-07-11T14:01:51-00:00