久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

使用 Mockito 1.9.5 和 DexMaker-Mockito-1.0 的驗證錯誤

VerifyError using Mockito 1.9.5 and DexMaker-Mockito-1.0(使用 Mockito 1.9.5 和 DexMaker-Mockito-1.0 的驗證錯誤)
本文介紹了使用 Mockito 1.9.5 和 DexMaker-Mockito-1.0 的驗證錯誤的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

像許多其他人一樣,我很高興聽到 dexmaker-android 組合 僅在針對真實設備運行插樁測試時 100% 工作.

在真實設備上運行測試不會出現此故障.

Like many others I was excited to hear that Mockito now works with Android and followed this tutorial to see it with my own eyes. Everything seemed fan-flapping-tastic and I got underway incorporating the mocking solution into my Android Test Project...

The error

However, on setting up my application's test project to leverage the mockito-all-1.9.5, dexmaker-1.0 and dexmaker-mockito-1.0 jars I encountered a problem with my very first test case. Precisely this problem in fact. The part that I would like assistance on is;

Caused by: java.lang.VerifyError: org/mockito/cglib/core/ReflectUtils
at org.mockito.cglib.core.KeyFactory$Generator.generateClass(KeyFactory.java:167)
at org.mockito.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)
at org.mockito.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:217)
at org.mockito.cglib.core.KeyFactory$Generator.create(KeyFactory.java:145)
at org.mockito.cglib.core.KeyFactory.create(KeyFactory.java:117)
at org.mockito.cglib.core.KeyFactory.create(KeyFactory.java:109)
at org.mockito.cglib.core.KeyFactory.create(KeyFactory.java:105)
at org.mockito.cglib.proxy.Enhancer.<clinit>(Enhancer.java:70)

I have been informed that this "simply doesn't quite work yet" since the stack trace implies that the DexMaker jar is not being used - reference this response. However, I am suspicious that I am doing something wrong with respect to my project set-up so I'm looking to draw from the collective knowledge base here to see if indeed this is user error or a beta-bug.

My Android Test Project set-up

Please find below a screenshot of my test project's configuration. The project was created via the Android Wizard and shares no special features other than the inclusion of the Mockito and DexMaker jars (mentioned above) under the libs directory.

The Test

Never mind the content of the test (the test fails before the unit test is executed) the set-up is as described below;

public class TestSpotRatingCalculator extends InstrumentationTestCase {
  @Mock
  private AService aService; // Changed the service names being used here - not important.
  @Mock
  private BService bService;
  @Mock
  private CService cService;
  @Mock
  private DService dService;

  /**
   * @see android.test.AndroidTestCase#setUp()
   */
  @Override
  protected void setUp() throws Exception {
    super.setUp();
    MockitoAnnotations.initMocks(this);  // Failure here with aforementioned stacktrace...
  }

If anyone out there has an idea what is wrong then please sound-off here.

解決方案

As hinted at here the dexmaker-android combo only works 100% when the instrumented tests are run against a real device.

Running the tests against a real device do not exhibit this failure.

這篇關于使用 Mockito 1.9.5 和 DexMaker-Mockito-1.0 的驗證錯誤的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

EditText: Disable Paste/Replace menu pop-up on Text Selection Handler click event(EditText:禁用文本選擇處理程序單擊事件上的粘貼/替換菜單彈出)
Multiline EditText with Done SoftInput Action Label on 2.3(2.3 上帶有完成 SoftInput 操作標簽的多行 EditText)
How to detect the swipe left or Right in Android?(如何在 Android 中檢測向左或向右滑動?)
Prevent dialog dismissal on screen rotation in Android(防止在Android中的屏幕旋轉對話框解除)
How do I handle ImeOptions#39; done button click?(如何處理 ImeOptions 的完成按鈕點擊?)
How do you set EditText to only accept numeric values in Android?(您如何將 EditText 設置為僅接受 Android 中的數值?)
主站蜘蛛池模板: 黄色大片免费看 | 欧美13videosex性极品 | 在线一区 | 午夜一级黄色片 | 一区二区成人 | 国产精品九九 | 五月婷六月丁香 | 国产精品日韩在线 | 国产日韩欧美 | www.国产91 | 久久综合伊人 | 亚洲精品一区中文字幕乱码 | 国产精品1区2区 | 欧美黄色小视频 | 精品亚洲第一 | 国产精品一区二区不卡 | 99久久99 | 欧美精品一区二区三区在线播放 | 欧美亚洲国语精品一区二区 | 国产sm主人调教女m视频 | 日韩在线播放av | 久草福利 | 一本色道久久综合亚洲精品高清 | 国产精品美女久久久 | 中文字幕一页二页 | 国产色| 91免费在线视频 | 午夜影院在线观看视频 | 亚洲精品久久久久久一区二区 | 精品久久久久久久久久久下田 | 日韩福利 | 在线精品国产 | 欧美在线一区二区视频 | 麻豆久久久久久 | 久久综合久久久 | 久久久www| 久久久久久免费毛片精品 | 久久久精品视频免费 | 国产精品一区二区欧美黑人喷潮水 | 国产99视频精品免费播放照片 | 精品久久久久久久久久久久久久久久久 |