Building Local Unit Tests

Three are  two mainly test methods in android.in google document one is Local unit test and another is Instrumented test. 

1.  Local unit tests are tests that run on your local machine, without needing access to the Android framework or an Android device. To learn how to develop local units tests, see Building Local Unit Tests

2.Instrumented tests are tests that run on an Android device or emulator. These tests have access to Instrumentationinformation, such as the Context for the app under test. 

Environment  Eclipse IDE for Android Developers    23.0.2.1259578  
                        jdk1.7
                        Window7  64


To setup Junit with eclipse following steps need to be followed.

Step 1: download junit jar file in   http://junit.org/junit4/ 

Step 2: set Environment. open Eclipse

  1. Go to help
  2. Install New Software
  3. Work with: Juno  http://download.eclipse.org/releases/juno/
  4. Programming languages (expand it)
  5. Install Java Development Tools
  6. Restart  

if not will get nullException. I find answer in stackoverflow.com 

Step 3: write code then test it

 
http://developer.android.com/training/testing/unit-testing/local-unit-tests.html
http://www.tutorialspoint.com/junit/junit_plug_with_eclipse.htm 
http://stackoverflow.com/questions/1250505/junit4-eclipse-an-internal-error-occured-during-launching
http://junit.org/junit4/

你可能感兴趣的:(android,JUnit4,locale)