diff options
author | Ivan Dubrov <idubrov@guidewire.com> | 2016-03-02 13:26:05 -0800 |
---|---|---|
committer | Ivan Dubrov <idubrov@guidewire.com> | 2016-03-02 13:26:07 -0800 |
commit | a0d28ad675ee916bbd7b4bb125bd73ca9de45cf7 (patch) | |
tree | b20068bb72ce134e263722fb153f2b3cbcbde77e /dcevm/src/test | |
parent | dc59f725304bddd9f27d9fced9e883fd9d481b19 (diff) | |
download | dcevm-a0d28ad675ee916bbd7b4bb125bd73ca9de45cf7.tar.gz dcevm-a0d28ad675ee916bbd7b4bb125bd73ca9de45cf7.zip |
Adding failing test case (#94)
Diffstat (limited to 'dcevm/src/test')
-rw-r--r-- | dcevm/src/test/java7/com/github/dcevm/test/methods/MethodReflectionTest.java | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/dcevm/src/test/java7/com/github/dcevm/test/methods/MethodReflectionTest.java b/dcevm/src/test/java7/com/github/dcevm/test/methods/MethodReflectionTest.java index a5304734..6b04e702 100644 --- a/dcevm/src/test/java7/com/github/dcevm/test/methods/MethodReflectionTest.java +++ b/dcevm/src/test/java7/com/github/dcevm/test/methods/MethodReflectionTest.java @@ -149,4 +149,47 @@ public class MethodReflectionTest { Assert.assertFalse(found); } + + // Version 0 + public static class TestArgumentRedefined { + public static String hello(TestArgumentRedefined arg) { + return arg.doHello(); + } + + public String doHello() { + return "hello0"; + } + } + + public static class TestArgumentRedefined___1 { + public static String hello(TestArgumentRedefined arg) { + return arg.doHello(); + } + + public String doHello() { + return "hello1"; + } + } + + @Test + public void testReflectionArgumentRedefined() throws Exception { + + assert __version__() == 0; + + TestArgumentRedefined t = new TestArgumentRedefined(); + Method declaredMethod = TestArgumentRedefined.class.getDeclaredMethod("hello", + TestArgumentRedefined.class); + + + for (int i = 0; i < 10; i++) { + assertEquals("hello0", declaredMethod.invoke(null, t)); + + __toVersion__(1); + + assertEquals("hello1", declaredMethod.invoke(null, t)); + + __toVersion__(0); + } + } + } |