Failure in trying to use AndroidTestCase


#1

 

package com.silverkeytech.android_rivers

import android.test.AndroidTestCase
import junit.framework.Assert
import java.io.Console

public class DownloadFeedTests : AndroidTestCase() {
  protected override fun setUp() {
  super<AndroidTestCase>.setUp()
  }

  public fun testStandardRSSFeed(){
  DownloadFeed(this.getContext(), false).executeOnComplete {
           Assert.assertTrue(true)
  }
  .execute(“http://static.scripting.com/rss.xml”)
  }
}

I linked to junit-411.jar

Above code generates

Throwable: Can’t find super function for PsiMethod:tearDown defined in PsiClass:AndroidTestCase

[Internal Error] java.lang.IllegalStateException: Can’t find super function for PsiMethod:tearDown defined in PsiClass:AndroidTestCase
at org.jetbrains.jet.lang.resolve.java.kotlinSignature.SignaturesPropagationData.getSuperFunctionsForMethod(SignaturesPropagationData.java:226)
at org.jetbrains.jet.lang.resolve.java.kotlinSignature.SignaturesPropagationData.<init>(SignaturesPropagationData.java:68)
at org.jetbrains.jet.lang.resolve.java.resolver.JavaFunctionResolver.resolveMethodToFunctionDescriptor(JavaFunctionResolver.java:145)
at org.jetbrains.jet.lang.resolve.java.resolver.JavaFunctionResolver.resolveNamedGroupFunctions(JavaFunctionResolver.java:248)
at org.jetbrains.jet.lang.resolve.java.resolver.JavaFunctionResolver.resolveFunctionGroup(JavaFunctionResolver.java:300)
at org.jetbrains.jet.lang.resolve.java.JavaDescriptorResolver.resolveFunctionGroup(JavaDescriptorResolver.java:170)
at org.jetbrains.jet.lang.resolve.java.scope.JavaClassMembersScope.computeFunctionDescriptor(JavaClassMembersScope.java:56)
at org.jetbrains.jet.lang.resolve.java.scope.JavaBaseScope.getFunctions(JavaBaseScope.java:105)
at org.jetbrains.jet.lang.resolve.java.scope.JavaBaseScope.computeFieldAndFunctionDescriptors(JavaBaseScope.java:146)
at org.jetbrains.jet.lang.resolve.java.scope.JavaBaseScope.computeAllDescriptors(JavaBaseScope.java:132)
at org.jetbrains.jet.lang.resolve.java.scope.JavaBaseScope.getAllDescriptors(JavaBaseScope.java:120)
at org.jetbrains.jet.lang.resolve.OverrideResolver.getCallableMembersFromType(OverrideResolver.java:356)
at org.jetbrains.jet.lang.resolve.OverrideResolver.getCallableMembersFromSupertypes(OverrideResolver.java:349)
at org.jetbrains.jet.lang.resolve.OverrideResolver.generateOverridesInAClass(OverrideResolver.java:121)
at org.jetbrains.jet.lang.resolve.OverrideResolver.generateOverridesAndDelegationInAClass(OverrideResolver.java:117)
at org.jetbrains.jet.lang.resolve.OverrideResolver.generateOverridesAndDelegation(OverrideResolver.java:93)
at org.jetbrains.jet.lang.resolve.OverrideResolver.process(OverrideResolver.java:75)
at org.jetbrains.jet.lang.resolve.TopDownAnalyzer.doProcess(TopDownAnalyzer.java:127)
at org.jetbrains.jet.lang.resolve.TopDownAnalyzer.analyzeFiles(TopDownAnalyzer.java:259)
at org.jetbrains.jet.lang.resolve.java.AnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(AnalyzerFacadeForJVM.java:204)
at org.jetbrains.jet.lang.resolve.java.AnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(AnalyzerFacadeForJVM.java:186)
at org.jetbrains.jet.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$1.invoke(KotlinToJVMBytecodeCompiler.java:319)
at org.jetbrains.jet.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$1.invoke(KotlinToJVMBytecodeCompiler.java:315)
at org.jetbrains.jet.cli.common.messages.AnalyzerWithCompilerReport.analyzeAndReport(AnalyzerWithCompilerReport.java:221)
at org.jetbrains.jet.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.analyze(KotlinToJVMBytecodeCompiler.java:314)
at org.jetbrains.jet.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.analyzeAndGenerate(KotlinToJVMBytecodeCompiler.java:294)
at org.jetbrains.jet.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.analyzeAndGenerate(KotlinToJVMBytecodeCompiler.java:275)
at org.jetbrains.jet.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModule(KotlinToJVMBytecodeCompiler.java:113)
at org.jetbrains.jet.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules(KotlinToJVMBytecodeCompiler.java:134)
at org.jetbrains.jet.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.java:132)
at org.jetbrains.jet.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.java:54)
at org.jetbrains.jet.cli.common.CLICompiler.exec(CLICompiler.java:117)
at org.jetbrains.jet.cli.jvm.K2JVMCompiler.exec(K2JVMCompiler.java:181)
at org.jetbrains.jet.cli.jvm.K2JVMCompiler.exec(K2JVMCompiler.java:54)
at org.jetbrains.jet.cli.common.CLICompiler.exec(CLICompiler.java:47)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.jetbrains.jet.compiler.runner.CompilerRunnerUtil.invokeExecMethod(CompilerRunnerUtil.java:97)
at org.jetbrains.jet.compiler.runner.KotlinCompilerRunner.execInProcess(KotlinCompilerRunner.java:77)
at org.jetbrains.jet.compiler.runner.KotlinCompilerRunner.access$000(KotlinCompilerRunner.java:39)
at org.jetbrains.jet.compiler.runner.KotlinCompilerRunner$1.fun(KotlinCompilerRunner.java:62)
at org.jetbrains.jet.compiler.runner.KotlinCompilerRunner$1.fun(KotlinCompilerRunner.java:59)
at org.jetbrains.jet.compiler.runner.CompilerRunnerUtil.outputCompilerMessagesAndHandleExitCode(CompilerRunnerUtil.java:106)
at org.jetbrains.jet.compiler.runner.KotlinCompilerRunner.runInProcess(KotlinCompilerRunner.java:59)
at org.jetbrains.jet.compiler.runner.KotlinCompilerRunner.runCompiler(KotlinCompilerRunner.java:51)
at org.jetbrains.jet.plugin.compiler.JetCompiler.runCompiler(JetCompiler.java:141)
at org.jetbrains.jet.plugin.compiler.JetCompiler.doCompile(JetCompiler.java:130)
at org.jetbrains.jet.plugin.compiler.JetCompiler.compile(JetCompiler.java:94)
at com.intellij.compiler.impl.CompileDriver.compileSources(CompileDriver.java:2017)
at com.intellij.compiler.impl.CompileDriver.translate(CompileDriver.java:1340)
at com.intellij.compiler.impl.CompileDriver.doCompile(CompileDriver.java:1046)
at com.intellij.compiler.impl.CompileDriver.doCompile(CompileDriver.java:788)
at com.intellij.compiler.impl.CompileDriver.access$1200(CompileDriver.java:109)
at com.intellij.compiler.impl.CompileDriver$9.run(CompileDriver.java:736)
at com.intellij.compiler.progress.CompilerTask.run(CompilerTask.java:153)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$TaskRunnable.run(ProgressManagerImpl.java:501)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:191)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:232)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:181)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$8.run(ProgressManagerImpl.java:406)
at com.intellij.openapi.application.impl.ApplicationImpl$6.run(ApplicationImpl.java:465)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:153)


#2

The above code is written in an Android Test Module.


#3

This is definetly a bug, but I couldn't reproduce it for a simple project. Could you report an issue to our tracker with information about kotlin compiler version used? Thanks.


#4

http://youtrack.jetbrains.com/issue/KT-3176

I include the link to the whole project as well (it’s an open source project)