備忘録がわり

『Android ApplicationをEclipseで開発しているが、テスト自動化したい』
というわけで、JUnitを使ってクラスに対してテストクラスを作成。
で、実行と。


こけました。
Eclipseのコンソール上にこんなメッセージを出してきた。

 # A fatal error has been detected by the Java Runtime Environment:
 #
 #  Internal Error (classFileParser.cpp:3174), pid=3300, tid=4016
 #  Error: ShouldNotReachHere()
 #
 # JRE version: 6.0_20-b02
 # Java VM: Java HotSpot(TM) Client VM (16.3-b01 mixed mode windows-x86 )
 # An error report file with more information is saved as:
 # D:\eclipse\BallPonpon\hs_err_pid3300.log
 #
 # If you would like to submit a bug report, please visit:
 #   http://java.sun.com/webapps/bugreport/crash.jsp
 #

このメソッドでこけているみたいです。ShouldNotReachHere()
Eclipse + ShouldNotReachHereで検索するとこのページを発見。

http://b.hatena.ne.jp/dmp939/Android/junit/

dmp939さんが発見した外国のページを読むと解決方法がかいてありましたよ!!!

http://www.svetandroida.cz/testing-android-applica...



以下引用。
    …

    Internal Error (classFileParser.cpp:2924), pid=11018, tid=3084700560 # Error: ShouldNotReachHere()

    …

To be able to run tests from Eclipse you have to replace android.jar by junit.jar

   1. go to „Run Configurations“
   2. search for configuration running your unit test
   3. go to „Classpath“ tab
   4. remove „Android Library“ from „Bootstrap Entries“
   5. then go to project build path configuration
   6. and add Junit library to your project
   7. you should be able to run junit unit tests


この通りにしてみると…




成功です!!!

このページへのコメント

S7RFB5 I really enjoy the blog article.Really thank you! Keep writing.

0
Posted by awesome things! 2014年01月20日(月) 22:53:00 返信

aoJv5C Major thankies for the article.Really thank you! Great.

0
Posted by watch for this 2013年12月20日(金) 22:29:44 返信

コメントをかく


「http://」を含む投稿は禁止されています。

利用規約をご確認のうえご記入下さい

Menu

メニューサンプル1

管理人/副管理人のみ編集できます