Tests fixed after default nullability for type arguments changed to NotNull
This commit is contained in:
@@ -50,6 +50,14 @@ public abstract class AbstractLoadJavaTest extends TestCaseWithTmpdir {
|
||||
Pair<NamespaceDescriptor, BindingContext> nsbAndBindingContext = compileJavaAndLoadTestNamespaceAndBindingContextFromBinary(
|
||||
Arrays.asList(javaFile, ExpectedLoadErrorsUtil.ANNOTATION_SOURCE_FILE),
|
||||
tmpdir, myTestRootDisposable, ConfigurationKind.JDK_AND_ANNOTATIONS);
|
||||
checkLoadedNamespaces(txtFile, nsa, nsbAndBindingContext);
|
||||
}
|
||||
|
||||
public static void checkLoadedNamespaces(
|
||||
File txtFile,
|
||||
NamespaceDescriptor nsa,
|
||||
Pair<NamespaceDescriptor, BindingContext> nsbAndBindingContext
|
||||
) {
|
||||
NamespaceDescriptor nsb = nsbAndBindingContext.first;
|
||||
|
||||
boolean fail = false;
|
||||
|
||||
+4
-4
@@ -107,7 +107,7 @@ public class AnnotationJavaDescriptorResolverTest extends AbstractJavaResolverDe
|
||||
actualCompileTimeConstant = getCompileTimeConstant(annotation2, annotationTypeName2, "value");
|
||||
assert actualCompileTimeConstant instanceof AnnotationValue;
|
||||
checkAnnotationCompileTimeConstant((AnnotationValue) actualCompileTimeConstant, "value",
|
||||
DEFAULT_PACKAGE + ".MyAnnotation2", "jet.Array<jet.String?>?", "[\"test\", \"test2\"]");
|
||||
DEFAULT_PACKAGE + ".MyAnnotation2", "jet.Array<jet.String>?", "[\"test\", \"test2\"]");
|
||||
|
||||
String annotationTypeName3 = DEFAULT_PACKAGE + ".MyAnnotationWithParam3";
|
||||
AnnotationDescriptor annotation3 = getAnnotationInClassByType("C", annotationTypeName3);
|
||||
@@ -163,7 +163,7 @@ public class AnnotationJavaDescriptorResolverTest extends AbstractJavaResolverDe
|
||||
|
||||
CompileTimeConstant<?> actualCompileTimeConstant = getCompileTimeConstant(annotation, annotationTypeName, "value");
|
||||
assert actualCompileTimeConstant instanceof ArrayValue;
|
||||
checkArrayCompileTimeConstant((ArrayValue) actualCompileTimeConstant, "jet.Array<java.lang.annotation.ElementType?>?",
|
||||
checkArrayCompileTimeConstant((ArrayValue) actualCompileTimeConstant, "jet.Array<java.lang.annotation.ElementType>?",
|
||||
"java.lang.annotation.ElementType", values);
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ public class AnnotationJavaDescriptorResolverTest extends AbstractJavaResolverDe
|
||||
|
||||
CompileTimeConstant<?> actualCompileTimeConstant = getCompileTimeConstant(annotation, annotationTypeName, "value");
|
||||
assert actualCompileTimeConstant instanceof ArrayValue;
|
||||
checkArrayCompileTimeConstant((ArrayValue) actualCompileTimeConstant, "jet.Array<jet.String?>?", "jet.String", values);
|
||||
checkArrayCompileTimeConstant((ArrayValue) actualCompileTimeConstant, "jet.Array<jet.String>?", "jet.String", values);
|
||||
}
|
||||
|
||||
public void testAnnotationWithEmptyArrayInParam() throws IOException {
|
||||
@@ -189,7 +189,7 @@ public class AnnotationJavaDescriptorResolverTest extends AbstractJavaResolverDe
|
||||
|
||||
CompileTimeConstant<?> actualCompileTimeConstant = getCompileTimeConstant(annotation, annotationTypeName, "value");
|
||||
assert actualCompileTimeConstant instanceof ArrayValue;
|
||||
checkArrayCompileTimeConstant((ArrayValue) actualCompileTimeConstant, "jet.Array<jet.String?>?", "jet.String", values);
|
||||
checkArrayCompileTimeConstant((ArrayValue) actualCompileTimeConstant, "jet.Array<jet.String>?", "jet.String", values);
|
||||
}
|
||||
|
||||
private static void compareJetTypeWithClass(@NotNull JetType actualType, @NotNull String expectedType) {
|
||||
|
||||
@@ -40,7 +40,6 @@ import org.jetbrains.jet.lang.resolve.TopDownAnalysisParameters;
|
||||
import org.jetbrains.jet.lang.resolve.java.DescriptorSearchRule;
|
||||
import org.jetbrains.jet.lang.resolve.java.JavaDescriptorResolver;
|
||||
import org.jetbrains.jet.lang.resolve.lazy.KotlinTestWithEnvironment;
|
||||
import org.jetbrains.jet.lang.resolve.lazy.LazyResolveTestUtil;
|
||||
import org.jetbrains.jet.lang.resolve.name.Name;
|
||||
import org.jetbrains.jet.test.util.NamespaceComparator;
|
||||
|
||||
@@ -80,10 +79,10 @@ public final class LoadJavaCustomTest extends KotlinTestWithEnvironment {
|
||||
Pair<NamespaceDescriptor, BindingContext> javaNamespaceAndBindingContext
|
||||
= compileJavaAndLoadTestNamespaceAndBindingContextFromBinary(files, tmpDir, getTestRootDisposable(),
|
||||
ConfigurationKind.JDK_ONLY);
|
||||
|
||||
NamespaceDescriptor javaNamespace = javaNamespaceAndBindingContext.first;
|
||||
//NOTE: comparing namespace to file (hack)
|
||||
NamespaceComparator.compareNamespaces(javaNamespace, javaNamespace, NamespaceComparator.DONT_INCLUDE_METHODS_OF_OBJECT, expected);
|
||||
ExpectedLoadErrorsUtil.checkForLoadErrors(javaNamespace, javaNamespaceAndBindingContext.second);
|
||||
AbstractLoadJavaTest.checkLoadedNamespaces(expected, javaNamespace, javaNamespaceAndBindingContext);
|
||||
}
|
||||
|
||||
public void testPackageLocalVisibility() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user