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:
committed by
Alexander Udalov
parent
22bf8b25b8
commit
b485c7ae26
@@ -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!!
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package protectedPack;
|
||||
|
||||
import java.lang.String;
|
||||
|
||||
public class overrideProtectedFunInPackage {
|
||||
protected String foo() {
|
||||
return "fail";
|
||||
}
|
||||
}
|
||||
+17
@@ -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()
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package protectedPack;
|
||||
|
||||
import java.lang.String;
|
||||
|
||||
public class protectedFunInPackage {
|
||||
protected String foo() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package protectedPack
|
||||
|
||||
fun box(): String {
|
||||
return protectedFunInPackage().foo()!!
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package protectedPack;
|
||||
|
||||
import java.lang.String;
|
||||
|
||||
public class protectedPropertyInPackage {
|
||||
protected String foo = "OK";
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package protectedPack
|
||||
|
||||
fun box(): String {
|
||||
return protectedPropertyInPackage().foo!!
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package protectedPack;
|
||||
|
||||
import java.lang.String;
|
||||
|
||||
public class protectedStaticClass {
|
||||
protected static class Inner {
|
||||
public String foo() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package protectedPack
|
||||
|
||||
class Derived(): protectedStaticClass() {
|
||||
fun test(): String {
|
||||
return protectedStaticClass.Inner().foo()!!
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return Derived().test()
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
public class funCallInConstructor {
|
||||
|
||||
protected final String protectedProperty;
|
||||
|
||||
public funCallInConstructor(String str) {
|
||||
protectedProperty = str;
|
||||
}
|
||||
|
||||
protected static String protectedFun() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
class A: funCallInConstructor(funCallInConstructor.protectedFun()) {
|
||||
fun test(): String {
|
||||
return protectedProperty!!
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return A().test()
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
public class funClassObject {
|
||||
|
||||
protected static String protectedFun() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
class A {
|
||||
class object: funClassObject() {
|
||||
fun test(): String {
|
||||
return funClassObject.protectedFun()!!
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return A.test()
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
public class funGenericClass<T> {
|
||||
protected static String protectedFun() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class Derived(): funGenericClass<String>() {
|
||||
fun test(): String {
|
||||
return funGenericClass.protectedFun()!!
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return Derived().test()
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
public class funNestedStaticClass {
|
||||
public static class Inner {
|
||||
protected static String protectedFun() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
class Derived(): funNestedStaticClass.Inner() {
|
||||
fun test(): String {
|
||||
return funNestedStaticClass.Inner.protectedFun()!!
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return Derived().test()
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
public class funNestedStaticClass2 {
|
||||
public static class A {
|
||||
public static class B {
|
||||
protected static String protectedFun() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
class Derived(): funNestedStaticClass2.A.B() {
|
||||
fun test(): String {
|
||||
return funNestedStaticClass2.A.B.protectedFun()!!
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return Derived().test()
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
public class funNestedStaticGenericClass<T> {
|
||||
public static class Inner<S> {
|
||||
protected static String protectedFun() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
class Derived(): funNestedStaticGenericClass<String>.Inner<String>() {
|
||||
fun test(): String {
|
||||
return funNestedStaticGenericClass.Inner.protectedFun()!!
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return Derived().test()
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
public class funNotDirectSuperClass {
|
||||
protected static String protectedFun() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
open class A : funNotDirectSuperClass() {}
|
||||
|
||||
class Derived(): A() {
|
||||
fun test(): String {
|
||||
return funNotDirectSuperClass.protectedFun()!!
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return Derived().test()
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
public class funObject {
|
||||
|
||||
protected static String protectedFun() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
object A: funObject() {
|
||||
fun test(): String {
|
||||
return funObject.protectedFun()!!
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return A.test()
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
public class simpleClass {
|
||||
protected static class Inner {
|
||||
public Inner() {}
|
||||
public String foo() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class Derived(): simpleClass() {
|
||||
fun test(): String {
|
||||
return simpleClass.Inner().foo()!!
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return Derived().test()
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
public class simpleClass2 {
|
||||
public static class A {
|
||||
protected static class B {
|
||||
public B() {
|
||||
}
|
||||
|
||||
public String foo() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class Derived(): simpleClass2.A() {
|
||||
fun test(): String {
|
||||
return simpleClass2.A.B().foo()!!
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return Derived().test()
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
public class simpleFun {
|
||||
protected static String protectedFun() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class Derived(): simpleFun() {
|
||||
fun test(): String {
|
||||
return simpleFun.protectedFun()!!
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return Derived().test()
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
public class simpleProperty {
|
||||
protected static final String protectedProperty = "OK";
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
class Derived(): simpleProperty() {
|
||||
fun test(): String {
|
||||
return simpleProperty.protectedProperty!!
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return Derived().test()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user