TacapeForte / android-mock

Automatically exported from code.google.com/p/android-mock
0 stars 0 forks source link

ClassNotFoundException trying to mock any class. Eclipse setup. #23

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Follow the instructions on the PDF for setting up android-mock on Eclipse. 

2. Change the bin_dir and APP_UNDER_TEST paths to point to /bin/classes in the 
test and app_under_test directories, respectively.

3. Add Factory Path variable ANDROID_FRAMEWORK_MOCKS pointing to 
android_framework_mocks.jar.

4. Create a mock of an application class with @UsesMock(MyClass.class). (I 
couldn't make any class to work actually)

5. Run tests

What is the expected output? What do you see instead?
I expect the test to be run.

It appears in the Eclipse console:

[2012-06-05 16:01:39 - solvis_android_tests] Test run failed: Instrumentation 
run failed due to 'java.lang.ClassNotFoundException'

And in the log file:

Jun 6, 2012 8:14:09 AM - NOTE : Start Processing Annotations
Jun 6, 2012 8:14:09 AM - NOTE : Processing [public void testMocks() throws 
java.lang.ClassNotFoundException]
Jun 6, 2012 8:14:09 AM - NOTE : Adding Class to Mocking List: 
br.com.myself.myself_android.models.Survey
Jun 6, 2012 8:14:09 AM - NOTE : Found 1 classes to mock
Jun 6, 2012 8:14:09 AM - NOTE : Creating mocks of class: 
br.com.myself.myself_android.models.Survey
Jun 6, 2012 8:14:09 AM - NOTE : Found 2 mocked classes to save
Jun 6, 2012 8:14:09 AM - NOTE : Saving 
genmocks.br.com.myself.myself_android.models.SurveyDelegateSubclass
Jun 6, 2012 8:14:09 AM - NOTE : Saving via Eclipse 
genmocks.br.com.myself.myself_android.models.SurveyDelegateSubclass
Jun 6, 2012 8:14:09 AM - NOTE : Saving 
genmocks.br.com.myself.myself_android.models.SurveyDelegateInterface
Jun 6, 2012 8:14:09 AM - NOTE : Saving via Eclipse 
genmocks.br.com.myself.myself_android.models.SurveyDelegateInterface
Jun 6, 2012 8:14:09 AM - NOTE : Finished Processing Mocks
Jun 6, 2012 8:14:09 AM - NOTE : Start Processing Annotations
Jun 6, 2012 8:14:09 AM - NOTE : Processing []
Jun 6, 2012 8:14:09 AM - NOTE : Found 0 classes to mock
Jun 6, 2012 8:14:09 AM - NOTE : Found 0 mocked classes to save
Jun 6, 2012 8:14:09 AM - NOTE : Finished Processing Mocks

What version of the product are you using? On what operating system?
AndroidMocks 1.1.2
Android API 11
Eclipse on Windows 7 64bits

Please provide any additional information below.

Original issue reported on code.google.com by hsgub...@gmail.com on 6 Jun 2012 at 11:19