This evening I had to make a new unit test for one of the classes in my A DUNGEON HORROR DEED editor, for a while Eclipse had spat some kind of IDE NULL pointer exception in my face every time I tried to run a test. I have not done anything about since the classes under test not have changed.
But now it was urgent, so away I went to the web and was lucky to find a couple of good suggestions on a Stack Overflow entry. I used this one that specified what to do in the Eclipse IDE:
- Go to help
- Select: Install New Software
- In the Work with text box type: Juno
- Expand Programming languages in the tree view
- Select: Install Eclipse Java Development Tools
- Install it
And it worked in first try:
So now I can make my testing count again!
As an aside I can mention that the Dice class that have methods I have used since 1989 when I made a program for rolling new Characters for Warhammer Fantasy Roleplay have a method for rolling a specific range from (and including) a minimum integer value to a maximum. I have never tried what happens if you give the method a minimum that is larger than the maximum. So of course I made a test where I tried this. I expected the method to switch the two parameters and still deliver a range roll from (and including) the lowest to the highest of the two values.
And of course it crashed, away I went an refactored the method to switch the values if the minimum was largest and now the test succeeds. And then I added some explanatory java doc as well: