Switch class loading logic in blackBoxWithJava tests

BoxWithJava tests now by default are loaded with the classloader which has
test's classpath in itself, as in the former ClassPathInTheSameClassLoaderTest
This commit is contained in:
Alexander Udalov
2013-02-08 17:51:29 +04:00
committed by Alexander Udalov
parent 22bf8b25b8
commit b485c7ae26
49 changed files with 203 additions and 238 deletions
@@ -0,0 +1,9 @@
import java.lang.String;
class J {
String value;
J(String value) {
this.value = value;
}
}
@@ -0,0 +1 @@
fun box() = J("OK").value
@@ -0,0 +1,9 @@
package protectedPack;
import java.lang.String;
class packageClass {
public String test() {
return "OK";
}
}
@@ -0,0 +1,5 @@
package protectedPack
fun box(): String {
return packageClass().test()!!
}
@@ -0,0 +1,9 @@
package protectedPack;
import java.lang.String;
public class packageFun {
String test() {
return "OK";
}
}
@@ -0,0 +1,5 @@
package protectedPack
fun box(): String {
return packageFun().test()!!
}
@@ -0,0 +1,7 @@
package protectedPack;
import java.lang.String;
public class packageProperty {
String test = "OK";
}
@@ -0,0 +1,5 @@
package protectedPack
fun box(): String {
return packageProperty().test!!
}
@@ -0,0 +1,9 @@
package protectedPack;
import java.lang.String;
public class overrideProtectedFunInPackage {
protected String foo() {
return "fail";
}
}
@@ -0,0 +1,17 @@
package protectedPackKotlin
import protectedPack.overrideProtectedFunInPackage
class Derived: overrideProtectedFunInPackage() {
protected override fun foo(): String? {
return "OK"
}
fun test(): String {
return foo()!!
}
}
fun box(): String {
return Derived().test()
}
@@ -0,0 +1,9 @@
package protectedPack;
import java.lang.String;
public class protectedFunInPackage {
protected String foo() {
return "OK";
}
}
@@ -0,0 +1,5 @@
package protectedPack
fun box(): String {
return protectedFunInPackage().foo()!!
}
@@ -0,0 +1,7 @@
package protectedPack;
import java.lang.String;
public class protectedPropertyInPackage {
protected String foo = "OK";
}
@@ -0,0 +1,5 @@
package protectedPack
fun box(): String {
return protectedPropertyInPackage().foo!!
}
@@ -0,0 +1,11 @@
package protectedPack;
import java.lang.String;
public class protectedStaticClass {
protected static class Inner {
public String foo() {
return "OK";
}
}
}
@@ -0,0 +1,11 @@
package protectedPack
class Derived(): protectedStaticClass() {
fun test(): String {
return protectedStaticClass.Inner().foo()!!
}
}
fun box(): String {
return Derived().test()
}