Android????????о??????
???????????? ???????[ 2016/3/30 13:59:21 ] ??????????????? ???????
????Android??????????
???????????????????е?Android??????????????в?????????????????????????????????????????????????????????????????????????????????????????£????????????????????????????????????????汾?????
??????????????????????????????????????????????в??????????????????е??????????????????????????У?????????????С??飬?????????????1????????????м???????????????Щ???????????????????????????????????????????????APK?С?
??????????????λ??
?????1 ??????????λ??
??????Java????????????Android???????????????????????й??????????Android???л?????????Android??????????????????????????????????
????Java???????
????????Java????????У????????????????????????????????????????2?????????????????????????
??????????????
????
?2 ??????????
????????????У???????dosomething(Boolean param)???????????????????????????????????????????????????????????????
????????????????????????dosomething(Boolean param)??????????????????????????????????????????????????????????
??????????????????????????Щ?????????????????????з??????????????????????????
?????Щ??????з???????????????????????????????????????????????????
????????з?????????и??????????д???????????????????????????в??????????????????????????????????????????????case???????????????????????????????case???????????????????????
?????????????????????????????????????????????????·???????Java????????У???????????????????????к?????????????????б?????????????????????????????????????????????Android????????У????????????к??????????????Android SDK?е??????????ò????
????Android???????
??????Android?У????????????????????????????????????????JUnit????Java?У???д?????????????????????????д?????????????????????д????????????????????亯?????в????????Android?У???д????????????????????????????????????????????????????????SDK??????????Щ???????????????????Activity????????????е?resume????????????JUnit??????????
?????????????????????AndroidTest??Robolectric??????????????Android???????????????????????JVM????????????????????Jenkins????????У????????Android???????????????????????Robolectric???????Щ???????????????????????????????????????????Mock????
????Android??????????????
????Robolectric????????
????Android??????????????JUnit????????Robolectric???????Android????????л???????????Robolectric 3.0?????????????£?
????testCompile 'junit:junit:4.10'
????testCompile 'org.robolectric:robolectric:3.0'
????Gradle??Robolectric 2.4??????????3.0?????????Robolectric 2.4???е????????????????????ο???????????????????????2.4????????Robolectric 2.4????????????????
????classpath 'org.robolectric:robolectric-gradle-plugin:0.14.+'//??????????buildscript??dependencies??
????apply plugin: 'robolectric'
????androidTestCompile 'org.robolectric:robolectric:2.4'
?????????????У??????testCompileд??androidTest???????????Android???????????????????test???androidTest????????д??????й???????????Android???????Test Artifact????????Test Artifact???3?????
??????????????
?????3 Test Artifact
??????Gradle????У???????Artifact??е?Task??????Щ??????????????????????д????Ч?????????????????????????????·????????????????????Test Artifact????????·????????д????
????Mock????
?????????????????????????????????????????????????????????????????Robolectric??Shadow?????????????????????Mock????????Mockito?????????????????????????????????Щ?????????е?????Mockito???????£?
????repositories {
????jcenter()
????}
????dependencies {
????testCompile "org.mockito:mockito-core:1.+"
????}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11