Added sam test on java8 interface with default method

This commit is contained in:
Michael Bogdanov
2015-04-18 12:11:46 +03:00
parent 5c18cfebd1
commit 115c4b78c0
5 changed files with 27 additions and 2 deletions
@@ -47,4 +47,10 @@ public class BlackBoxWithJava8CodegenTestGenerated extends AbstractBlackBoxCodeg
doTestWithJava(fileName);
}
@TestMetadata("samOnInterfaceWithDefaultMethod")
public void testSamOnInterfaceWithDefaultMethod() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/java8/boxWithJava/samOnInterfaceWithDefaultMethod/");
doTestWithJava(fileName);
}
}
@@ -0,0 +1,5 @@
class JavaCall {
String call(Test test) {
return test.call();
}
}
@@ -0,0 +1,12 @@
interface Test {
String call();
default String test() {
return "K";
}
static String testStatic() {
return "K";
}
}
@@ -0,0 +1,3 @@
fun box(): String {
return JavaCall().call {"OK"}
}
@@ -153,8 +153,7 @@ public abstract class AbstractBlackBoxCodegenTest extends CodegenTestCase {
File kotlinOut = JetTestUtils.tmpDir(toString());
OutputUtilsPackage.writeAllTo(classFileFactory, kotlinOut);
// TODO: support several Java sources
File javaOut = compileJava(KotlinPackage.single(javaFilePaths), kotlinOut.getPath());
File javaOut = compileJava(javaFilePaths, kotlinOut.getPath());
// Add javac output to classpath so that the created class loader can find generated Java classes
addJvmClasspathRoot(configuration, javaOut);