Testing the Eclipse StatusLineManager

Testing the Eclipse StatusLineManager

As a unit testing addict, I’ve recently started to use the wonderful SWTBot framwork, for testing the interface part of Eclipse plugins and applications skype 4 0.

When it came to test the text of the StatusLine (e.g., after selecting something on a tree, the status line should show the string for the selected element), I found some problems, not strictly related to SWTBot, but to the fact that the IStatusLineManager interface has a method for setting the text, but none for getting the current text 파닥파닥 다운로드.

I found a post which was suggesting a “Nasty” way to access the current text, by relying of the internal implementation of the StatusLineManager; relying on an internal implementation is actually a bad thing, especially because in new versions such implementation is likely to change, and your code will stop working 윈도우 라이브메일 2012 다운로드. However, in a unit test, I guess it is admissible… afterall, if the internal implementation changes, your test will break, and tests are (also) there for that reason 😉

So here’s how I managed to test the current status line text

Note, that first, we need to get the IStatusLineManager from the current site (either a view site, or an editor site), and then we do the nasty thing, by getting the internal CLabel which shows the text in the status line and simply retrieve its text 스노우 다운로드.

Hope this helps some tester out there 🙂


By |2012-06-08T11:18:34+00:00ottobre 30th, 2011|

Leave A Comment