???????????????ò??????????·????

?????? ??SnakeUnitTest????????????????Properties??

?????? ??Properties?????????Java Build Path??

?????? ?л???Projects????????Add???????????????????????????Snake?????

?????? ?л???Libraries????????Add Library???????????????User Library?????Next??????User Libraries????User Libraries??????New??????????????Library?????????OPhone??????OK???????Add Jars????????????л???OPhone SDK???????platforms/android-1.5???????oms.jar?? ???OK??

?????????????????????AndroidMenifest.xml??

?????? ???SnakeUnitTest?????AndroidMenifest.xml ??

?????? ??????????AndroidMenifest.xml ?????????????????????

?????? ?????壻

?????? android:lable??????????????????????????壻

?????? android:name???????壬??TestRunner????????????????μ?TestRunner??

?????? android:targetPackage???????壬????????????????

?????????塢??????????

?????? ??oms.unittest.snake???′???SnakeTest.java?????????????????????????????????“????????Test”?????????Snake?????Snake??SnakeView??TileView????????????????????SnakeTest??SnakeViewTest??TileViewTest??

?????? SnakeTest.java??????????????

??????SnakeTest?У???????com.example.android.snake.Snake?и????????????????????testOnPause()???Snake?е?onPause()???????в????“test??????”???????????????????????????????????????????????

????SnakeTest?????ActivityInstrumentationTestCase2????????????Snake.java?ж??????Snake???Activity??onCreate()??onPause()??????ActivityInstrumentationTestCase2????????????????Щ???????в??????????????????ú???????????context??resource???????????????InstrumentationTestCase??????????????Activity??????????

?????????TileViewTest????Σ?

????TileViewTest?????AndroidTestCase??AndroidTestCase??????JUnit TestCase????????????????????????getContext()???????????????context??????????????????context????????ò???????????resource??????Res.getXml(R.xml.test)???????resource??????????????????????????resource?????????????