Since I requested a clover license for nyx / xulux I got hooked to have my coverage to 100%.
The positive part is that I have another good look at my code from a different perspective and fixed numerous possible issues that could arise when other people start writing extensions (eg a gui driver), on the other hand I probably overdo it a bit. Eg I have an imageloader system in place that by default tries to use jimi for showing icons and images (hey it supports ico files). In the interface I have a method isUsable() that checks if the main jimi class is actually is loadable.
public boolean isUsable() {
try {
Class.forName("com.sun.jimi.core.Jimi");
} catch (ClassNotFoundException cnfe) {
return false;
}
return true;
}
Hmm.. How to test the classNotFound exception in this case when jimi is always on your classpath ? You have to write a classloader that throws that exception when it tries to load the jimi class.. (see the JimiImageLoaderTest)
Also my ClassLoaderUtilsTest was a horror to get to 100%..
Maybe some nice junit extensions could be created which handle this behaviour came to mind several times last night..
Have I lost it, or am I actually doing the right thing ?
Posted by mvdb at December 15, 2003 02:23 PM