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 (seehere).
Eventually, though, I foundthis postthat 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: Unsupported algorithm: HmacSHA1 解决方法,阿里云
解决 java.lang.RuntimeException: Could not generate DH keypair异常处理。 bcprov-ext-jdk15on-1.60、bcprov-jdk15on-1.60两个包放到jre下的$JAVA_HOME/jre/lib/ext的路径下,然后配置$JAVA_HOME/jre/lib/...
java.lang.runtimeexception unexpected subelement
1、修改jdk/jre/lib/security/java.security,加粗部分放到最前面,其它依次修改编号放到后面 security.provider.1=org.bouncycastle.jce.provider.BouncyCastleProvider security.provider.2=sun.security....
报错 java.lang.OutOfMemoryError: PermGen space 报错 java.lang.OutOfMemoryError: Java heap 启动报错java.lang.ClassNotFoundException: 1catalina.org.apache.juli.FileHandler JAVA_OPTS="-server -Xms800m ...
主要介绍了javax.net.ssl.SSLException: java.lang.RuntimeException: Could not generate DH keypair 解决方法,有需要的朋友们可以学习下。
java.lang.UnsupportedOperationException异常(csdn)————程序
加密是报:javax.net.ssl.SSLException: java.lang.RuntimeException: Could not generate DH keypair 此处提供 bcprov-ext-jdk15on-154.jar 和 bcprov-jdk15on-154.jar 压缩包中有使用说明
基于dex2jar 2.0版本解决 java.lang.RuntimeException: can not merge I and Z问题
java.lang.RuntimeException java.lang.ArithmeticException 当出现异常的运算条件时,抛出此异常。 这个异常的解释是 "数学运算异常 ",比如程序中出现了除以零这样的运算就会出这样的异常,对这种异常,...
NULL 博文链接:https://jameskaron.iteye.com/blog/2291495
NULL 博文链接:https://listen-raining.iteye.com/blog/1962065
java.lang.ExceptionInInitializerError Caused by: java.lang.IllegalArgumentException: input == null! at javax.imageio.ImageIO.read(ImageIO.java:1388) at com.pleanwar.fiying.FlyingObject.loadImage...
05-27 15:35:11.487 E/AndroidRuntime( 2352): java.lang.RuntimeException: Unable to create service com.android.systemui.keyguard.KeyguardService: java.lang.SecurityException: read wallpaper: Neither ...
4)java.lang.RuntimeException: java.lang.RuntimeException: Hive Runtime Error while closing operators: null 5)hive on tez 最终insert的表如果使用到union all 时会导致直接查询结果表数据为空的
解决Got an exception - java.lang.RuntimeException: Unable to get class information for ***Exception. 找这个解决方法找了一个晚上,希望能对你有帮助!
郁闷啊,有时候不得不承认,无论是什么事,曾经是好的,到后边未必还是好的,不要拿曾经的种种来判断今天的结果, 前景:之前本地用jeecg(1.7版本)设计流程、发布流程、修改流程,所有的操作都是项目有汉字启动的,...
dex2jar 反编译apk 报错Detail Error Information in File .\xxx-classes-error.zip ...打开 error.zip,报错内容为:java.lang.RuntimeException: can not merge I and Z 使用附件中的工具即可解决
Android Caused by: java.lang.ClassNotFoundException解决办法 出现问题: 08-13 18:29:22.924: E/AndroidRuntime(1875): Caused by: Java.lang.ClassNotFoundException:XXXXX in loader dalvik.system....
1.基于 trie 树结构实现高效词图扫描 2.生成所有切词可能的有向无环图 DAG 3.采用动态规划算法计算最佳切词组合 4.基于 HMM 模型,采用 Viterbi (维特比)算法实现未登录词识别