public void JavaAbstractMethodTest() { // Library is referencing APIv1, ICursor is from APIv2 // if the Library assembly isn't fixed, the MyClrCursor instance is not even created Test.Bindings.ICursor ic = new Library.MyClrCursor(); // we should be able to call Method without issue ic.Method(); try { // when calling Newmethod, we should get Java.Lang.AbstractMethodError. we catch // general Exception on purpose, so that AbstractmethodError is not marked by MarkStep // but by FixAbstractMethodStep ic.NewMethod(); } catch (Exception e) { if (e.GetType().ToString() != "Java.Lang.AbstractMethodError") { throw e; } } var mi = ic.GetType().GetMethod("MethodWithCursor"); if (mi != null && mi.GetMethodBody().LocalVariables.Count == 0) { throw new Exception("FixAbstractMethodStep broken, MethodWithRT added, while it should not be"); } }
public void JavaAbstractMethodTest() { // Library is referencing APIv1, ICursor is from APIv2 // if the Library assembly isn't fixed, the MyClrCursor instance is not even created Test.Bindings.ICursor ic = new Library.MyClrCursor(); // we should be able to call Method without issue ic.Method(); try { // when calling Newmethod, we should get Java.Lang.AbstractMethodError. we catch // general Exception on purpose, so that AbstractmethodError is not marked by MarkStep // but by FixAbstractMethodStep ic.NewMethod(); } catch (Exception e) { if (e.GetType().ToString() != "Java.Lang.AbstractMethodError") { throw e; } } }