use of org.eclipse.ceylon.compiler.java.test.CompilerError in project ceylon by eclipse.
the class CMRTests method testOverridesCeylonModuleVersionAlterdPackageSharing.
@Test
public void testOverridesCeylonModuleVersionAlterdPackageSharing() {
setupBinaryModulesForOverridesCeylonModuleTests();
ErrorCollector collector = new ErrorCollector();
CeyloncTaskImpl compilerTask = getCompilerTask(Arrays.asList("-src", getPackagePath() + "/modules", "-overrides", getPackagePath() + "modules/overridesCeylonModule/overrides-b-version.xml"), collector, "modules/overridesCeylonModule/module.ceylon", "modules/overridesCeylonModule/testImportHiddenPackage.ceylon");
ModulesRetriever modulesRetriever = new ModulesRetriever(compilerTask.getContext());
compilerTask.setTaskListener(modulesRetriever);
Boolean result = compilerTask.call();
Assert.assertEquals(Boolean.FALSE, result);
compareErrors(collector.get(Diagnostic.Kind.ERROR), new CompilerError(2, "imported package is not visible: package 'b.hidden' is not shared by module 'b'"));
}
use of org.eclipse.ceylon.compiler.java.test.CompilerError in project ceylon by eclipse.
the class InteropTests method testIopLambdas.
@Test
public void testIopLambdas() {
Assume.assumeTrue("Runs on JDK8", JDKUtils.jdk == JDKUtils.JDK.JDK8 || JDKUtils.jdk == JDKUtils.JDK.JDK9);
List<String> options = Arrays.asList("-source", "8", "-target", "8");
compile(options, "LambdasJava.java");
compareWithJavaSource(options, "Lambdas.src", "Lambdas.ceylon");
compileAndRun("org.eclipse.ceylon.compiler.java.test.interop.classModelCoercionTest", "LambdasRuntime.ceylon");
assertErrors("LambdasErrors", new CompilerError(12, "refined declaration is not a real method: 'm' in 'Sub3' refines 'm' in 'InterfaceWithCoercedMembers'"));
}
use of org.eclipse.ceylon.compiler.java.test.CompilerError in project ceylon by eclipse.
the class InteropTests method testIopCallsDefaultAccessClassInAnotherPkgWithOverloading.
@Test
public void testIopCallsDefaultAccessClassInAnotherPkgWithOverloading() {
compile("access/JavaDefaultAccessClass4.java");
assertErrors("CallsDefaultAccessClassInAnotherPkgWithOverloading", new CompilerError(26, "illegal argument types in invocation of overloaded method or class: there must be exactly one overloaded declaration of 'JavaDefaultAccessClass4' which accepts the given argument types ''"), new CompilerError(27, "type constructor is not visible: 'JavaDefaultAccessClass4'"), new CompilerError(28, "constructor is not visible: 'JavaDefaultAccessClass4' is protected"));
}
use of org.eclipse.ceylon.compiler.java.test.CompilerError in project ceylon by eclipse.
the class InteropTests method testAnnotationInterop.
@Test
public void testAnnotationInterop() {
Assume.assumeTrue(allowSdkTests());
compile("sdk/JavaAnnotation.java");
compareWithJavaSource("sdk/AnnotationInterop");
assertErrors("sdk/AnnotationInteropErrors", new CompilerError(2, "function or value is not defined: 'javaAnnotationNoTarget__TYPE' might be misspelled or is not imported (did you mean 'javaAnnotationTypeTarget__TYPE'?)"), new CompilerError(3, "function or value is not defined: 'javaAnnotationNoTarget__CONSTRUCTOR' might be misspelled or is not imported (did you mean 'javaAnnotationCtorTarget__CONSTRUCTOR'?)"), new CompilerError(6, "function or value is not defined: 'javaAnnotationNoTarget__FIELD' might be misspelled or is not imported (did you mean 'javaAnnotationFieldTarget__FIELD'?)"), new CompilerError(7, "function or value is not defined: 'javaAnnotationNoTarget__GETTER' might be misspelled or is not imported (did you mean 'javaAnnotationMethodTarget__GETTER'?)"), new CompilerError(8, "function or value is not defined: 'javaAnnotationNoTarget__SETTER' might be misspelled or is not imported (did you mean 'javaAnnotationMethodTarget__SETTER'?)"), new CompilerError(12, "function or value is not defined: 'javaAnnotationNoTarget__PARAMETER' might be misspelled or is not imported (did you mean 'javaAnnotationDefaultTarget__PARAMETER'?)"), new CompilerError(14, "function or value is not defined: 'javaAnnotationNoTarget__LOCAL_VARIABLE' might be misspelled or is not imported (did you mean 'javaAnnotationDefaultTarget__LOCAL_VARIABLE'?)"), new CompilerError(19, "function or value is not defined: 'javaAnnotationNoTarget__ANNOTATION_TYPE' might be misspelled or is not imported (did you mean 'javaAnnotationDefaultTarget__ANNOTATION_TYPE'?)"), new CompilerError(21, "illegal annotation argument: must be a literal value, metamodel reference, annotation instantiation, or parameter reference"), new CompilerError(21, "named argument must be assignable to parameter 'clas' of 'javaAnnotationClass2': 'Class<String>' is not assignable to 'ClassOrInterfaceDeclaration'"));
}
use of org.eclipse.ceylon.compiler.java.test.CompilerError in project ceylon by eclipse.
the class InteropTests method testIopExtendsDefaultAccessClassInAnotherPkg.
@Test
public void testIopExtendsDefaultAccessClassInAnotherPkg() {
compile("access/JavaAccessModifiers.java");
compile("access/JavaDefaultAccessClass3.java");
assertErrors("ExtendsDefaultAccessClassInAnotherPkg", new CompilerError(21, "imported declaration is not visible: 'JavaDefaultAccessClass' is not shared"), new CompilerError(22, "imported declaration is not visible: 'JavaDefaultAccessClass2' is not shared"), new CompilerError(27, "type is not visible: 'JavaDefaultAccessClass'"), new CompilerError(29, "type is not visible: 'JavaDefaultAccessClass2'"), new CompilerError(31, "constructor is not visible: 'JavaDefaultAccessClass3' is package private"));
}
Aggregations