The default version of the JRE that IE uses is defined in the registry under:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\AdvancedOptions\JAVA_SUN\SELECT
This contains the RegPath key which defines where IE looks for Java. See if changing this to the other path helps.
Otherwise, in your test code you could call the other version of Java using the "OBJECT classid=..." tag in your script and enter the CLSID for the version of Java that you desire to call (i.e. 1.4.2_13 has a CLSID of 8AD9C840-044E-11D1-B3E9-00805F499D93)