You may have decided that the filters
provided won't do it for you. That's great. It's time for you to contribute to Eclipse.
You don't need to know much about the Eclipse API, but you should be comfortable
with the first few chapters of
Contributing to Eclipse by Beck and Gamma.
Once you know how to publish a plug-in for use by others you are ready to start developing your
If you are contributing a filter, the following should be in the plugin.xml:
<extension point = "org.eclipse.jdt.junit.testfilter"
class = "filterclass">
Where filtername is the name of the filter and
filterclass is the java class that you are contributing.
A prioritizer's plugin.xml will contain the following:
<extension point = "org.eclipse.jdt.junit.testprioritizer"
class = "prioritizerclass">
Where prioritizername is the name of the prioritizer and
prioritizerclass is the java class that you are contributing.
Creating the Class
We definitly recommend extending either AbstractTestFilter or AbstractTestPrioritizer.
If you want to, you could just implement the ITestFilter or ITestPrioritizer interface,
but AbstractTestPrioritizer provides some very useful methods.
You can import the edu.mit.lcs.pag.continuoustester plugin with linked source
to view what we did so that you have an idea.
Important: You must implement the getName() method so that it doesn't return
null!! If you don't, your manipulator will not show up as a possible choice.
Just a few things to keep in mind while developing.
If you have any questions, please ask. Hopefully we can make some revolutionary manipulators.
Let me know.
- The manipulator is used on two different VMs. It is not just one instance of
the manipulator that does everything. That is why you must recieve the information you
want by implementing setData(Map data) and save the data you want to save by
implementinggetData(). That is the only way to remember state. Those methods
are called before and after any other method call except getName()
- getData() must return a map that only contains keys and values that are
strings. This is a limitation imposed by ILaunchConfiguration. Only maps of strings to
strings can be stored as attributes in ILaunchConfigurations.
- Filters and prioritizers both recieve a list of every test that could be run.
If a prioritizer returns a test that the filter does not, it is ignored. The order
that a filter returns does not matter. A prioritizer can act like a filter by not
returning certain tests, but please don't do that. That is what filters are for.