-AndOperator erweitert

This commit is contained in:
Enrico Schrödter 2016-04-19 15:24:43 +02:00
parent 5a7c2310a1
commit 8bad95f774

View File

@ -29,4 +29,25 @@ public class AddOperatorTest extends SourceFileBytecodeTest{
Object obj = cls.newInstance();
assertTrue(true);
}
@Test
public void testTwoIntegers() throws Exception{
ClassLoader classLoader = getClassLoader();
Class cls = classLoader.loadClass(testName);
Object obj = cls.newInstance();
Integer x = new Integer(1);
Integer y = new Integer(2);
Class[] params = new Class[]{
x.getClass(),
y.getClass(),
};
Method method = cls.getDeclaredMethod("method", params);
Integer returnValue = (Integer) method.invoke(obj, x, y);
assertEquals(new Integer(3), returnValue);
}
}