Upgrade to Pro — share decks privately, control downloads, hide ads and more …

AndroidをJUnit4でやる / Using JUnit4 with Android

ryosms
December 06, 2014

AndroidをJUnit4でやる / Using JUnit4 with Android

「AndroidでJUnit4を使う方法 - Qiita」
http://qiita.com/AbeHaruhiko/items/8b3b11421b431d219617

の内容をAndroid Studio 1.0RCでやってみただけ

ryosms

December 06, 2014
Tweet

More Decks by ryosms

Other Decks in Technology

Transcript

  1. Step2: ґଘؔ܎ͷ௥Ճ § ςετ༻ͷґଘؔ܎ʹJUnitͱAndroid JUnit4Λ௥Ճ͢Δ § {project_root}/app/build.gradleΛमਖ਼ + project.ext { // dependenciesʹ௚઀όʔδϣϯΛهड़ͯ͠΋Մʢ޷Έͷ໰୊ʣ

    + junitVersion = '4.11' + androidJunitVersion = '0.5' + } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:21.0.2' + androidTestCompile "junit:junit:${junitVersion}" + androidTestCompile "com.uphyca:android-junit4:${androidJunitVersion}" }
  2. Step3: ςετϥϯφʔͷઃఆ § ςετϥϯφʔΛJUnit4༻ͷ΋ͷʹஔ͖׵͑Δ § {project_root}/app/build.gradleΛमਖ਼ // android { defaultConfig { applicationId

    ”hoge.fuga.hage" minSdkVersion 8 targetSdkVersion 21 versionCode 1 versionName "1.0" + testInstrumentationRunner ↲ + "com.uphyca.testing.JUnit4InstrumentationTestRunner” }