Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-core-dev] Testing the Eclipse Editor component logic

Hello,

I have a question about unit testing the Eclipse text editor framework,
that may or may not be finding the right outlet in this mailing
list. Feel free to point me to better options.

I'm working on a plugin which editor augments on the existing JDT editor
using aspects.

Now, Eclipse text editors that derive from AbstractTextEditor are
organized in clear components, following an MVC architecture. Those
components are then accessed through precise paths,
e.g. reconciliation. You can find one example of a custom reconciler and
the assumptions it can (and does) use on the behavior of the editor
here:

http://blog.ankursharma.org/2009/08/adding-spellchecking-to-custom-editors_19.html

I'd like to write headless unit tests against those assumptions, that
would check that my weaving through aspects has not broken anything along
the way. For example, in the case of reconciliation, I would like to
open an editor, input some incorrect content (with respect to some
reconciliation strategy), wait for a while, and check that Problems are
indeed reported : that would ensure that I haven't broken any essential
part of the reconciliation mechanism along the way.

Note that which problems are reported, or how they would be signaled to
the user in a UI component doesn't concern me, here. I want to test that
my swapping a SourceViewer for a custom one through aspects doesn't break
editor logic, /not/ my specific reconciliation strategy. In fact, I'd
probably mock it for that test. Moreover, the UI testing, being
presumably not runnable in a headless fashion, is beyond the scope of my
question.

It seems this should be easy to do if the appropriate structures
existed. Is there any test framework in sync with Eclipse's
architectural assumptions that would let me do what I have in mind ?
Such mocks would have but to reproduce the Eclipse editor workflows.
Surely this would be among Eclipse's own unit tests, right ? ... though
I can't seem to find anything of the sort. Any ideas ?

-- 
FG




Back to the top