diff --git a/test/bytecode/types/AutoOverloading.jav b/test/bytecode/types/AutoOverloading.jav index 860f5483..193bbfe7 100644 --- a/test/bytecode/types/AutoOverloading.jav +++ b/test/bytecode/types/AutoOverloading.jav @@ -2,16 +2,16 @@ import java.util.Vector; class AutoOverloading{ - methode2(String p){ + method2(String p){ } - methode2(Integer p){ + method2(Integer p){ } - methode(p){ - methode2(p); + method(p){ + method2(p); } } \ No newline at end of file diff --git a/test/bytecode/types/AutoOverloadingTest.java b/test/bytecode/types/AutoOverloadingTest.java index 41c0bfc7..8aea83fd 100644 --- a/test/bytecode/types/AutoOverloadingTest.java +++ b/test/bytecode/types/AutoOverloadingTest.java @@ -29,4 +29,56 @@ public class AutoOverloadingTest extends SourceFileBytecodeTest{ Object obj = cls.newInstance(); assertTrue(true); } + + @Test + public void testString() { + try{ + ClassLoader classLoader = getClassLoader(); + + Class cls = classLoader.loadClass(testName); + + Object obj = cls.newInstance(); + + File file = new File(rootDirectory); + URL url = file.toURL(); + URL[] urls = new URL[]{url}; + + Class string = classLoader.loadClass("java.lang.String"); + + Class[] params = new Class[1]; + params[0] = string; + + Method method = cls.getDeclaredMethod("method", params); + method.invoke(obj, string.newInstance()); + assertTrue(true); + }catch(Exception e){ + throw new RuntimeException(e); + } + } + + @Test + public void testInteger() { + try{ + ClassLoader classLoader = getClassLoader(); + + Class cls = classLoader.loadClass(testName); + + Object obj = cls.newInstance(); + + File file = new File(rootDirectory); + URL url = file.toURL(); + URL[] urls = new URL[]{url}; + + Class integer = classLoader.loadClass("java.lang.Integer"); + + Class[] params = new Class[1]; + params[0] = integer; + + Method method = cls.getDeclaredMethod("method", params); + method.invoke(obj, integer.newInstance()); + assertTrue(true); + }catch(Exception e){ + throw new RuntimeException(e); + } + } }