How to test my plugin [message #591803] |
Wed, 11 February 2009 06:54 |
Mikael Petterson 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
|
|
|
Powered by
FUDForum. Page generated in 0.01785 seconds