Android tests: add expected result for box() method

This commit is contained in:
Natalia.Ukhorskaya
2012-09-13 13:20:22 +04:00
parent acfc5b3f56
commit 9e55fd219e
3 changed files with 40 additions and 17 deletions
@@ -18,6 +18,7 @@ package org.jetbrains.jet.compiler.android;
import junit.framework.TestCase;
import java.lang.String;
import java.lang.reflect.Method;
/**
@@ -26,13 +27,13 @@ import java.lang.reflect.Method;
public class AbstractCodegenTestCaseOnAndroid extends TestCase {
protected void invokeBoxMethod(String filePath) throws Exception {
protected void invokeBoxMethod(String filePath, String expectedResult) throws Exception {
try {
Class clazz;
clazz = Class.forName(filePath.replaceAll("\\\\|-|\\.|/", "_") + ".namespace");
Method method;
method = clazz.getMethod("box");
assertEquals("OK", method.invoke(null));
assertEquals(expectedResult, method.invoke(null));
}
catch (Throwable e) {
throw new RuntimeException("File: " + filePath, e);