Skip to content
This repository has been archived by the owner on Oct 26, 2022. It is now read-only.

tests project from setup script isn't working #17

Closed
fabianpage opened this issue Jul 23, 2010 · 1 comment
Closed

tests project from setup script isn't working #17

fabianpage opened this issue Jul 23, 2010 · 1 comment

Comments

@fabianpage
Copy link

I created a project with the "create_project" command. The Hello World Application works fine but the tests project doesn't work.

> android-plugin/script/create_project cleanProject com.example
> cd cleanProject/
> sbt
> update
> package-debug
> start-emulator // => works fine

> project tests
> test-emulator => Error

[info] android.test.suitebuilder.TestSuiteBuilder$FailedToCreateTests:
[info] Error in testSuiteConstructionFailed:
[info] java.lang.RuntimeException: Exception during suite construction
[info]  at android.test.suitebuilder.TestSuiteBuilder$FailedToCreateTests.testSuiteConstructionFailed(TestSuiteBuilder.java:239)
[info]  at java.lang.reflect.Method.invokeNative(Native Method)
[info]  at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)
[info]  at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)
[info]  at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:520)
[info]  at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1447)
[info] Caused by: java.lang.TypeNotPresentException: Type java.rmi.RemoteException not present
[info]  at java.lang.Class.getDeclaredMethods(Native Method)
[info]  at java.lang.ClassCache.getDeclaredPublicMethods(ClassCache.java:166)
[info]  at java.lang.ClassCache.getDeclaredMethods(ClassCache.java:179)
[info]  at java.lang.ClassCache.findAllMethods(ClassCache.java:249)
[info]  at java.lang.ClassCache.getFullListOfMethods(ClassCache.java:223)
[info]  at java.lang.ClassCache.getAllPublicMethods(ClassCache.java:204)
[info]  at java.lang.Class.getMethods(Class.java:1015)
[info]  at android.test.suitebuilder.TestGrouping.getTestMethods(TestGrouping.java:79)
[info]  at android.test.suitebuilder.TestGrouping.getTests(TestGrouping.java:71)
[info]  at android.test.suitebuilder.TestSuiteBuilder.build(TestSuiteBuilder.java:183)
[info]  at android.test.InstrumentationTestRunner.onCreate(InstrumentationTestRunner.java:373)
[info]  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4218)
[info]  at android.app.ActivityThread.access$3000(ActivityThread.java:125)
[info]  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2071)
[info]  at android.os.Handler.dispatchMessage(Handler.java:99)
[info]  at android.os.Looper.loop(Looper.java:123)
[info]  at android.app.ActivityThread.main(ActivityThread.java:4627)
[info]  at java.lang.reflect.Method.invokeNative(Native Method)
[info]  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
[info]  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
[info]  at dalvik.system.NativeStart.main(Native Method)
@charroch
Copy link

try to add the following to your test:

override def $tag() : Int = {
try {
return super.$tag();
} catch {
case e: Exception => throw new RuntimeException(e);
}
}

i.e.:

import junit.framework.Assert._
import root.android.test.AndroidTestCase

class UnitTests extends AndroidTestCase {
def testPackageIsCorrect {
assertEquals("novoda.testing", getContext.getPackageName)
}

override def $tag() : Int = {
try {
return super.$tag();
} catch {
case e: Exception => throw new RuntimeException(e);
}
}
}

@jberkel jberkel closed this as completed Sep 17, 2011
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants