From dc0cf0cd340cbbc5de24457abd01307317adf2db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrico=20Schr=C3=B6dter?= Date: Wed, 11 Nov 2015 11:11:50 +0100 Subject: [PATCH] ExtendsVectorString erweitert --- .../types/ExtendsVectorStringTest.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/test/bytecode/types/ExtendsVectorStringTest.java b/test/bytecode/types/ExtendsVectorStringTest.java index 08549aae..cd248e97 100644 --- a/test/bytecode/types/ExtendsVectorStringTest.java +++ b/test/bytecode/types/ExtendsVectorStringTest.java @@ -3,6 +3,7 @@ package bytecode.types; import static org.junit.Assert.*; import java.lang.reflect.Constructor; +import java.lang.reflect.Method; import org.junit.BeforeClass; import org.junit.Test; @@ -51,7 +52,23 @@ public class ExtendsVectorStringTest extends ASTBytecodeTest{ @Test public void testParameter(){ - throw new RuntimeException("Not implemented yet!"); + try{ + ClassLoader classLoader = getClassLoader(); + + Class cls = classLoader.loadClass(testName); + + Object obj = cls.newInstance(); + + Class stringClass = classLoader.loadClass("java.lang.Object"); + + Class[] params = new Class[1]; + params[0] = stringClass; + + Method method = cls.getDeclaredMethod("add", params); + method.invoke(obj, stringClass.newInstance()); + }catch(Exception e){ + throw new RuntimeException(e); + } } }