java.lang.RuntimeException: Stub!
来源:互联网 发布:sql语句大全 创建用户 编辑:程序博客网 时间:2024/05/22 03:42
I recently tried to run my junit tests to ensure that I didn’t break anything after monkeying around with my code, and I ran into the following error:
1
Exception in thread "main" java.lang.RuntimeException: Stub!
Here’s my code that runs my tests:
1
2
3
4
5
6
7
8
9
10
11
12
13
public
class
RunTestSuite {
public
static
void
main(String[] a) {
TestRunner.run(suite());
}
public
static
Test suite() {
TestSuite suite =
new
TestSuite();
suite.addTestSuite(MyClassTests.
class
);
return
suite;
}
}
The stack trace pointed to line 8, so I didn’t know what to make of it since I just had this setup correctly, and TestSuite is a JUnit thing.
Googling mostly resulted in issues with using an Android Test Project (I’m not) and running the tests in your desktop’s JVM instead of the actual device’s (see here).
Eventually, though, I found this post that informed me that the JUnit library needs to be at the top of the test project’s build order.
Here are the steps to change the build order in Eclipse:
- Right-click your test project
- Click Bulid Path->Configure Build Path…
- Click the Order and Export tab
- Select the JUnit reference
- Click the Top button
通过把android.jar调整到bottom似乎有用
- java.lang.RuntimeException: Stub!
- Junit java.lang.RuntimeException: Stub!
- android java.lang.RuntimeException: Stub!错误
- Exception in thread "main" java.lang.RuntimeException: Stub!
- Exception in thread "main" java.lang.RuntimeException: Stub!
- android 混淆打包报错Error java.lang.RuntimeException: Stub!
- Exception in thread "main" java.lang.RuntimeException: Stub! java.lang.NoClassDefFoundError
- Exception in thread "main" java.lang.RuntimeException: Stub! java.lang.NoClassDefFoundError
- 解决报错: Exception in thread "main" java.lang.RuntimeException: Stub!
- java.lang.RuntimeException翻译
- java.lang.RuntimeException: NYI
- java.lang.runtimeexception
- java.lang.RuntimeException nativeLibraryDirectories
- java.lang.RuntimeException
- java.lang.RuntimeException
- java.lang.RuntimeException: startPreview failed
- java.lang.RuntimeException: setAudioSource failed.
- java.lang.RuntimeException: start failed.
- [ffmpeg]在Ubuntu成功编译FFmpeg并生成ffplay
- lsof
- oracle_code
- 【<私活案例1>】 某游戏网首页PS设计和Html静态效果源码
- 程序员练级攻略
- java.lang.RuntimeException: Stub!
- 可恨又可爱的404(未完待续)
- allegro中焊盘的设置
- jQuery UI库使用记录----button
- Wordpress Categories分类函数的应用 显示分类列表
- TableModel
- vc中检测内存泄露的工具VLD(visual leak detector) 转
- [ffmpeg]FFPLAY的原理
- 人大HR师姐每日圈面试分析