This repository was archived by the owner on May 26, 2018. It is now read-only.

Description
Info
I'm currently trying to create a JUnit test for objects in the world. To do this i've created a fake world to mess around in. The world code works well enough that i can get results out of it as needed. Issue is i keep getting this crashing any time ModClassLoader tries to create itself. Which i've figured out how to avoid for the most part but some code doesn't allow me to avoid it. Mainly anything that tries to populate crash reports with instance information.
JUnit Test code
https://github.com/Universal-Electricity/Resonant-Engine/blob/1.7/src/test/java/resonant/lib/test/world/WorldTest.java
Crash
line 46 in ModClassLoader
this.mainClassLoader = (LaunchClassLoader)parent;
Caused by: java.lang.ClassCastException: sun.misc.Launcher$AppClassLoader cannot be cast to net.minecraft.launchwrapper.LaunchClassLoader
at cpw.mods.fml.common.ModClassLoader.(ModClassLoader.java:46)
at cpw.mods.fml.common.Loader.(Loader.java:181)
at cpw.mods.fml.common.Loader.instance(Loader.java:160)
at cpw.mods.fml.common.FMLCommonHandler.(FMLCommonHandler.java:87)
at cpw.mods.fml.common.FMLCommonHandler.(FMLCommonHandler.java:77)
... 31 more
Possible fix?
I'm most likely wrong on this but maybe an instanceof check could be added. This way JUnit tests can at least create the instance even if it doesn't function.