Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » How to test my plugin
How to test my plugin [message #46414] Wed, 11 February 2009 06:54 Go to next message
Mikael Petterson is currently offline Mikael PettersonFriend
Messages: 158
Registered: July 2009
Senior Member
Hi,

I am developing a plugin for Eclipse.
I try to write a simple testcase but it turned out it was not that simple.
This is the case.

public class ClearcaseProvider extends RepositoryProvider {
private final class RefreshStateOperation implements
IRecursiveOperation {

public IStatus visit(IResource resource, IProgressMonitor monitor)
{
StateCache cache =
StateCacheFactory.getInstance().get(resource);

}
}
}

Ok I thought since I cannot mock a singleton I can check if I really need
a singleton and make the coupling more lose. So I thought I could send an
instance of StateCacheFacotry into the constructor of ClearcaseProvider
class to make the two classes less tightly coupled. This is not possible
since that constructor will never be called from the Eclipse framework.

Any hints or pointers so I can test the plugin is very much appreciated.

//mikael
Re: How to test my plugin [message #46558 is a reply to message #46414] Wed, 11 February 2009 09:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse.kfdd.mine.nu

Just curious - have you looked at this for CC integration:

http://www.ibm.com/developerworks/rational/library/content/0 3July/2500/2834/ClearCase/clearcase_plugins.html

Thanks,
--Fredrik

Mikael Petterson wrote:
> Hi,
>
> I am developing a plugin for Eclipse.
> I try to write a simple testcase but it turned out it was not that
> simple. This is the case.
>
> public class ClearcaseProvider extends RepositoryProvider {
> private final class RefreshStateOperation implements
> IRecursiveOperation {
>
> public IStatus visit(IResource resource, IProgressMonitor monitor) {
> StateCache cache =
> StateCacheFactory.getInstance().get(resource);
>
> }
> }
> }
>
> Ok I thought since I cannot mock a singleton I can check if I really
> need a singleton and make the coupling more lose. So I thought I could
> send an instance of StateCacheFacotry into the constructor of
> ClearcaseProvider class to make the two classes less tightly coupled.
> This is not possible since that constructor will never be called from
> the Eclipse framework.
> Any hints or pointers so I can test the plugin is very much appreciated.
>
> //mikael
>
Re: How to test my plugin [message #46609 is a reply to message #46558] Wed, 11 February 2009 16:36 Go to previous message
Mikael Petterson is currently offline Mikael PettersonFriend
Messages: 158
Registered: July 2009
Senior Member
Hi,

Yes I have however that was not why I posted the question :-)

//mike
Re: How to test my plugin [message #591850 is a reply to message #46414] Wed, 11 February 2009 09:03 Go to previous message
Fredrik is currently offline FredrikFriend
Messages: 2
Registered: July 2009
Junior Member
Just curious - have you looked at this for CC integration:

http://www.ibm.com/developerworks/rational/library/content/0 3July/2500/2834/ClearCase/clearcase_plugins.html

Thanks,
--Fredrik

Mikael Petterson wrote:
> Hi,
>
> I am developing a plugin for Eclipse.
> I try to write a simple testcase but it turned out it was not that
> simple. This is the case.
>
> public class ClearcaseProvider extends RepositoryProvider {
> private final class RefreshStateOperation implements
> IRecursiveOperation {
>
> public IStatus visit(IResource resource, IProgressMonitor monitor) {
> StateCache cache =
> StateCacheFactory.getInstance().get(resource);
>
> }
> }
> }
>
> Ok I thought since I cannot mock a singleton I can check if I really
> need a singleton and make the coupling more lose. So I thought I could
> send an instance of StateCacheFacotry into the constructor of
> ClearcaseProvider class to make the two classes less tightly coupled.
> This is not possible since that constructor will never be called from
> the Eclipse framework.
> Any hints or pointers so I can test the plugin is very much appreciated.
>
> //mikael
>
Re: How to test my plugin [message #591867 is a reply to message #46558] Wed, 11 February 2009 16:36 Go to previous message
Mikael Petterson is currently offline Mikael PettersonFriend
Messages: 158
Registered: July 2009
Senior Member
Hi,

Yes I have however that was not why I posted the question :-)

//mike
Previous Topic:Running the project builders when headless
Next Topic:OSGi running my own embedded Jetty, dependent plugins not starting?
Goto Forum:
  


Current Time: Tue Apr 23 16:19:10 GMT 2024

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

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

Back to the top