use of com.redhat.ceylon.compiler.java.test.CompilerError in project ceylon-compiler by ceylon.
the class InteropTests method testIopCallsDefaultAccessClassInAnotherPkgWithOverloading.
@Test
public void testIopCallsDefaultAccessClassInAnotherPkgWithOverloading() {
compile("access/JavaDefaultAccessClass4.java");
assertErrors("CallsDefaultAccessClassInAnotherPkgWithOverloading", new CompilerError(26, "ambiguous invocation of overloaded method or class: there must be exactly one overloaded declaration of 'JavaDefaultAccessClass4' that accepts the given argument types ''"), new CompilerError(26, "class cannot be instantiated: 'JavaDefaultAccessClass4' does not have a default constructor"), new CompilerError(27, "type constructor is not visible: 'JavaDefaultAccessClass4'"), new CompilerError(28, "protected constructor is not visible: 'JavaDefaultAccessClass4'"));
}
use of com.redhat.ceylon.compiler.java.test.CompilerError in project ceylon-compiler by ceylon.
the class InteropTests method testIopRefinesDefaultAccessMethodWithShared.
@Test
public void testIopRefinesDefaultAccessMethodWithShared() {
compile("access/JavaAccessModifiers.java");
assertErrors("access/RefinesDefaultAccessMethodWithShared", new CompilerError(22, "non-actual member collides with an inherited member: 'defaultAccessMethod' in 'RefinesDefaultAccessMethodWithShared' refines 'defaultAccessMethod' in 'JavaAccessModifiers'"));
}
use of com.redhat.ceylon.compiler.java.test.CompilerError in project ceylon-compiler by ceylon.
the class InteropTests method testIopAmbiguousOverloading.
@Test
public void testIopAmbiguousOverloading() {
compile("TypesJava.java", "JavaWithOverloadedMembers.java");
assertErrors("AmbiguousOverloading", new CompilerError(25, "ambiguous invocation of overloaded method or class: there must be exactly one overloaded declaration of 'ambiguousOverload' that accepts the given argument types 'String, String'"), new CompilerError(26, "ambiguous invocation of overloaded method or class: there must be exactly one overloaded declaration of 'ambiguousOverload2' that accepts the given argument types 'Integer, Integer'"));
}
use of com.redhat.ceylon.compiler.java.test.CompilerError in project ceylon-compiler by ceylon.
the class CMRHTTPTests method testMdlHTTPForbidden.
@Test
public void testMdlHTTPForbidden() throws IOException {
File repo = makeRepo();
final int port = allocPortForTest();
final String repoAURL = getRepoUrl(port);
HttpServer server = startServer(port, repo, true, null, HttpError.FORBIDDEN);
try {
// then try to compile our module by outputting to HTTP
assertErrors("modules/single/module", Arrays.asList("-out", repoAURL), null, new CompilerError(-1, "Failed to write module to repository: authentication failed on repository " + repoAURL));
} finally {
server.stop(1);
}
}
use of com.redhat.ceylon.compiler.java.test.CompilerError in project ceylon-compiler by ceylon.
the class CMRHTTPTests method testMdlHTTPTimeout.
@Test
public void testMdlHTTPTimeout() throws IOException {
String moduleA = "com.redhat.ceylon.compiler.java.test.cmr.modules.depend.a";
// Clean up any cached version
File carFileInCache = getModuleArchive(moduleA, "6.6.6", cacheDir);
if (carFileInCache.exists())
carFileInCache.delete();
// Compile the first module in its own repo
File repo = makeRepo();
Boolean result = getCompilerTask(Arrays.asList("-out", repo.getPath()), "modules/depend/a/module.ceylon", "modules/depend/a/package.ceylon", "modules/depend/a/A.ceylon").call();
Assert.assertEquals(Boolean.TRUE, result);
File carFile = getModuleArchive(moduleA, "6.6.6", repo.getPath());
assertTrue(carFile.exists());
final int port = allocPortForTest();
final String repoAURL = getRepoUrl(port);
String[] files = new String[] { "modules/depend/b/module.ceylon", "modules/depend/b/package.ceylon", "modules/depend/b/a.ceylon", "modules/depend/b/B.ceylon" };
List<String> options = Arrays.asList("-out", destDir, "-rep", repoAURL, "-verbose:cmr", "-cp", getClassPathAsPath(), "-timeout", "1");
// now serve the first repo over HTTP
HttpServer server = startServer(port, repo, false, null, TimeoutIn.GetMiddle);
try {
// then try to compile only one module (the other being loaded from its car)
assertErrors(files, options, null, new CompilerError(24, "cannot find module artifact com.redhat.ceylon.compiler.java.test.cmr.modules.depend.a-6.6.6.car\n" + " due to connection error: java.net.SocketTimeoutException: Timed out reading com.redhat.ceylon.compiler.java.test.cmr.modules.depend.a-6.6.6.car from " + repoAURL + "\n" + " \t- dependency tree: com.redhat.ceylon.compiler.java.test.cmr.modules.depend.b/6.6.6 -> com.redhat.ceylon.compiler.java.test.cmr.modules.depend.a/6.6.6"));
} finally {
server.stop(1);
}
if (carFileInCache.exists())
carFileInCache.delete();
server = startServer(port, repo, false, null, TimeoutIn.GetInitial);
try {
// then try to compile only one module (the other being loaded from its car)
assertErrors(files, options, null, new CompilerError(24, "cannot find module artifact com.redhat.ceylon.compiler.java.test.cmr.modules.depend.a-6.6.6.car\n" + " due to connection error: java.net.SocketTimeoutException: Timed out during connection to " + repoAURL + "/com/redhat/ceylon/compiler/java/test/cmr/modules/depend/a/6.6.6/com.redhat.ceylon.compiler.java.test.cmr.modules.depend.a-6.6.6.car\n" + " \t- dependency tree: com.redhat.ceylon.compiler.java.test.cmr.modules.depend.b/6.6.6 -> com.redhat.ceylon.compiler.java.test.cmr.modules.depend.a/6.6.6"));
} finally {
server.stop(1);
}
if (carFileInCache.exists())
carFileInCache.delete();
server = startServer(port, repo, false, null, TimeoutIn.Head);
try {
// then try to compile only one module (the other being loaded from its car)
assertErrors(files, options, null, new CompilerError(24, "cannot find module artifact com.redhat.ceylon.compiler.java.test.cmr.modules.depend.a-6.6.6(.car|.jar)\n" + " \t- dependency tree: com.redhat.ceylon.compiler.java.test.cmr.modules.depend.b/6.6.6 -> com.redhat.ceylon.compiler.java.test.cmr.modules.depend.a/6.6.6"));
} finally {
server.stop(1);
}
// now with put
server = startServer(port, repo, true, null, TimeoutIn.PutInitial);
try {
// then try to compile our module by outputting to HTTP
assertErrors("modules/single/module", Arrays.asList("-out", repoAURL, "-verbose:cmr", "-timeout", "1"), null, new CompilerError(-1, "Failed to write module to repository: java.net.SocketTimeoutException: Timed out writing to " + repoAURL + "/com/redhat/ceylon/compiler/java/test/cmr/modules/single/6.6.6/com.redhat.ceylon.compiler.java.test.cmr.modules.single-6.6.6.src"));
} finally {
server.stop(1);
}
// now with put
server = startServer(port, repo, true, null, TimeoutIn.PutMiddle);
try {
// then try to compile our module by outputting to HTTP
assertErrors("modules/single/module", Arrays.asList("-out", repoAURL, "-verbose:cmr", "-timeout", "1"), null, new CompilerError(-1, "Failed to write module to repository: java.net.SocketTimeoutException: Timed out writing to " + repoAURL + "/com/redhat/ceylon/compiler/java/test/cmr/modules/single/6.6.6/com.redhat.ceylon.compiler.java.test.cmr.modules.single-6.6.6.src"));
} finally {
server.stop(1);
}
}
Aggregations