public void testLoadPlayerData() throws CompilationFailedException, FileNotFoundException, ResourceException, ScriptException {
final GroovyClassLoader mockClassLoader = new GroovyClassLoader() {
};
MockControl playerCtrl = MockControl.createControl(Player.class);
final Player player = (Player) playerCtrl.getMock();
final InputStream inputStream = new ByteArrayInputStream(new byte[] { '<', 'x', 'm', 'l', '/', '>' });
final XStream mockXStream = new XStream() {
@Override
public Object fromXML(InputStream input) {
// TODO Auto-generated method stub
assertEquals(inputStream, input);
methodCalled1 = true;
return player;
}
};
MockControl scriptCtrl = MockClassControl.createControl(GroovyScriptEngine.class, new Class[] { String.class }, new String[] { new String("file://") });
final GroovyScriptEngine eng = (GroovyScriptEngine) scriptCtrl.getMock();
eng.getParentClassLoader();
scriptCtrl.setDefaultReturnValue(null);
eng.loadScriptByName("player.Impl");
scriptCtrl.setReturnValue(player.getClass());
scriptCtrl.replay();
MudObjectAttendant attend = new MudObjectAttendant() {
protected InputStream createFileInputStream(File playerFile) throws FileNotFoundException {
return inputStream;