当我试图执行给定的代码行时,我正在使用robolectric进行android自动化测试,使用eclipse进行ant构建
Robolectric.buildActivity(MyActivity.class).create().visible().get(); throwing org.fest.reflect.exception.ReflectionError: Unable to find method '$$robo$getData error
我在我的lib文件夹中使用以下库
Used library
fest-android-1.0.8.jar
fest-assert-core-2.0M10.jar
fest-util-1.1.6.jar
hamcrest-core-1.3.jar
junit-4.11-sources.jar
junit-4.11.jar
mockito-core-1.9.5.jar
robolectric-2.3-jar-with-dependencies.jar
robolectric-with-dependencies.jar(Used for creating a test runner class for ant and eclipse build)
删除robolectric-with-dependencies.jar后我得到了
[junit] [WARNING] Unable to get resource 'org.ccil.cowan.tagsoup:tagsoup:jar
:1.2' from repository sonatype (https://oss.sonatype.org/content/groups/public/)
: Error transferring file: oss.sonatype.org
[junit] Error transferring file: oss.sonatype.org
[junit] Error transferring file: repo1.maven.org
[junit] [WARNING] Unable to get resource 'org.json:json:jar:20080701' from r
epository sonatype (https://oss.sonatype.org/content/groups/public/): Error tran
sferring file: oss.sonatype.org
[junit] [WARNING] Unable to get resource 'org.robolectric:android-all:jar:4.
3_r2-robolectric-0' from repository central (http://repo1.maven.org/maven2): Err
or transferring file: repo1.maven.org
[junit] Downloading: org/ccil/cowan/tagsoup/tagsoup/1.2/tagsoup-1.2.jar from
repository central at http://repo1.maven.org/maven2
[junit] Downloading: org/json/json/20080701/json-20080701.jar from repositor
y central at http://repo1.maven.org/maven2
[junit] Error transferring file: repo1.maven.org
[junit] Error transferring file: repo1.maven.org
[junit] [WARNING] Unable to get resource 'org.ccil.cowan.tagsoup:tagsoup:jar
:1.2' from repository central (http://repo1.maven.org/maven2): Error transferrin
g file: repo1.maven.org
[junit] [WARNING] Unable to get resource 'org.json:json:jar:20080701' from r
epository central (http://repo1.maven.org/maven2): Error transferring file: repo
1.maven.org
[junit] Downloading: org/robolectric/android-all/4.3_r2-robolectric-0/androi
d-all-4.3_r2-robolectric-0.jar from repository sonatype at https://oss.sonatype.
org/content/groups/public/
[junit] Downloading: org/ccil/cowan/tagsoup/tagsoup/1.2/tagsoup-1.2.jar from
repository sonatype at https://oss.sonatype.org/content/groups/public/
[junit] Downloading: org/json/json/20080701/json-20080701.jar from repositor
y sonatype at https://oss.sonatype.org/content/groups/public/
[junit] Error transferring file: oss.sonatype.org
[junit] Error transferring file: oss.sonatype.org
[junit] [WARNING] Unable to get resource 'org.robolectric:android-all:jar:4.
3_r2-robolectric-0' from repository sonatype (https://oss.sonatype.org/content/g
roups/public/): Error transferring file: oss.sonatype.org
[junit] Error transferring file: oss.sonatype.org
[junit] [WARNING] Unable to get resource 'org.json:json:jar:20080701' from r
epository sonatype (https://oss.sonatype.org/content/groups/public/): Error tran
sferring file: oss.sonatype.org
[junit] [WARNING] Unable to get resource 'org.ccil.cowan.tagsoup:tagsoup:jar
:1.2' from repository sonatype (https://oss.sonatype.org/content/groups/public/)
: Error transferring file: oss.sonatype.org
[junit] Downloading: org/robolectric/android-all/4.3_r2-robolectric-0/androi
d-all-4.3_r2-robolectric-0.jar from repository central at http://repo1.maven.org
/maven2
[junit] Downloading: org/ccil/cowan/tagsoup/tagsoup/1.2/tagsoup-1.2.jar from
repository central at http://repo1.maven.org/maven2
[junit] Downloading: org/json/json/20080701/json-20080701.jar from repositor
y central at http://repo1.maven.org/maven2
[junit] Error transferring file: repo1.maven.org
[junit] Error transferring file: repo1.maven.org
[junit] [WARNING] Unable to get resource 'org.ccil.cowan.tagsoup:tagsoup:jar
:1.2' from repository central (http://repo1.maven.org/maven2): Error transferrin
g file: repo1.maven.org
[junit] Error transferring file: repo1.maven.org
[junit] [WARNING] Unable to get resource 'org.json:json:jar:20080701' from r
epository central (http://repo1.maven.org/maven2): Error transferring file: repo
1.maven.org
[junit] [WARNING] Unable to get resource 'org.robolectric:android-all:jar:4.
3_r2-robolectric-0' from repository central (http://repo1.maven.org/maven2): Err
or transferring file: repo1.maven.org
[junit] Downloading: org/json/json/20080701/json-20080701.jar from repositor
y sonatype at https://oss.sonatype.org/content/groups/public/
[junit] Downloading: org/robolectric/android-all/4.3_r2-robolectric-0/androi
d-all-4.3_r2-robolectric-0.jar from repository sonatype at https://oss.sonatype.
org/content/groups/public/
[junit] Downloading: org/ccil/cowan/tagsoup/tagsoup/1.2/tagsoup-1.2.jar from
repository sonatype at https://oss.sonatype.org/content/groups/public/
[junit] Error transferring file: oss.sonatype.org
[junit] [WARNING] Unable to get resource 'org.json:json:jar:20080701' from r
epository sonatype (https://oss.sonatype.org/content/groups/public/): Error tran
sferring file: oss.sonatype.org
[junit] Error transferring file: oss.sonatype.org
[junit] Error transferring file: oss.sonatype.org
[junit] [WARNING] Unable to get resource 'org.robolectric:android-all:jar:4.
3_r2-robolectric-0' from repository sonatype (https://oss.sonatype.org/content/g
roups/public/): Error transferring file: oss.sonatype.org
[junit] Downloading: org/json/json/20080701/json-20080701.jar from repositor
y central at http://repo1.maven.org/maven2
[junit] [WARNING] Unable to get resource 'org.ccil.cowan.tagsoup:tagsoup:jar
:1.2' from repository sonatype (https://oss.sonatype.org/content/groups/public/)
: Error transferring file: oss.sonatype.org
[junit] Downloading: org/robolectric/android-all/4.3_r2-robolectric-0/androi
d-all-4.3_r2-robolectric-0.jar from repository central at http://repo1.maven.org
/maven2
[junit] Error transferring file: repo1.maven.org
[junit] Downloading: org/ccil/cowan/tagsoup/tagsoup/1.2/tagsoup-1.2.jar from
repository central at http://repo1.maven.org/maven2
[junit] [WARNING] Unable to get resource 'org.json:json:jar:20080701' from r
epository central (http://repo1.maven.org/maven2): Error transferring file: repo
1.maven.org
[junit] Error transferring file: repo1.maven.org
[junit] Error transferring file: repo1.maven.org
[junit] [WARNING] Unable to get resource 'org.robolectric:android-all:jar:4.
3_r2-robolectric-0' from repository central (http://repo1.maven.org/maven2): Err
or transferring file: repo1.maven.org
[junit] [WARNING] Unable to get resource 'org.ccil.cowan.tagsoup:tagsoup:jar
:1.2' from repository central (http://repo1.maven.org/maven2): Error transferrin
g file: repo1.maven.org
[junit] Tests run: 9, Failures: 0, Errors: 9, Time elapsed: 0.087 sec
[junit] Test com.pivotallabs.tracker.SignInDialogTest FAILED
[junit] Running com.pivotallabs.tracker.TrackerAuthenticationRequestTest
[junit] Downloading: org/json/json/20080701/json-20080701.jar from repositor
y sonatype at https://oss.sonatype.org/content/groups/public/
[junit] Downloading: org/ccil/cowan/tagsoup/tagsoup/1.2/tagsoup-1.2.jar from
repository sonatype at https://oss.sonatype.org/content/groups/public/
[junit] Downloading: org/robolectric/android-all/4.3_r2-robolectric-0/androi
d-all-4.3_r2-robolectric-0.jar from repository sonatype at https://oss.sonatype.
org/content/groups/public/
[junit] Error transferring file: oss.sonatype.org
[junit] [WARNING] Unable to get resource 'org.ccil.cowan.tagsoup:tagsoup:jar
:1.2' from repository sonatype (https://oss.sonatype.org/content/groups/public/)
: Error transferring file: oss.sonatype.org
[junit] Error transferring file: oss.sonatype.org
[junit] [WARNING] Unable to get resource 'org.robolectric:android-all:jar:4.
3_r2-robolectric-0' from repository sonatype (https://oss.sonatype.org/content/g
roups/public/): Error transferring file: oss.sonatype.org
[junit] Error transferring file: oss.sonatype.org
[junit] [WARNING] Unable to get resource 'org.json:json:jar:20080701' from r
epository sonatype (https://oss.sonatype.org/content/groups/public/): Error tran
sferring file: oss.sonatype.org
[junit] Downloading: org/ccil/cowan/tagsoup/tagsoup/1.2/tagsoup-1.2.jar from
repository central at http://repo1.maven.org/maven2
[junit] Downloading: org/json/json/20080701/json-20080701.jar from repositor
y central at http://repo1.maven.org/maven2
[junit] Error transferring file: repo1.maven.org
[junit] [WARNING] Unable to get resource 'org.ccil.cowan.tagsoup:tagsoup:jar
:1.2' from repository central (http://repo1.maven.org/maven2): Error transferrin
g file: repo1.maven.org
[junit] Downloading: org/robolectric/android-all/4.3_r2-robolectric-0/androi
d-all-4.3_r2-robolectric-0.jar from repository central at http://repo1.maven.org
/maven2
[junit] Error transferring file: repo1.maven.org
[junit] [WARNING] Unable to get resource 'org.json:json:jar:20080701' from r
epository central (http://repo1.maven.org/maven2): Error transferring file: repo
1.maven.org
[junit] Error transferring file: repo1.maven.org
[junit] [WARNING] Unable to get resource 'org.robolectric:android-all:jar:4.
3_r2-robolectric-0' from repository central (http://repo1.maven.org/maven2): Err
or transferring file: repo1.maven.org
[junit] Downloading: org/json/json/20080701/json-20080701.jar from repositor
y sonatype at https://oss.sonatype.org/content/groups/public/
[junit] Downloading: org/robolectric/android-all/4.3_r2-robolectric-0/androi
d-all-4.3_r2-robolectric-0.jar from repository sonatype at https://oss.sonatype.
org/content/groups/public/
[junit] Downloading: org/ccil/cowan/tagsoup/tagsoup/1.2/tagsoup-1.2.jar from
repository sonatype at https://oss.sonatype.org/content/groups/public/
[junit] Error transferring file: oss.sonatype.org
[junit] [WARNING] Unable to get resource 'org.robolectric:android-all:jar:4.
3_r2-robolectric-0' from repository sonatype (https://oss.sonatype.org/content/g
roups/public/): Error transferring file: oss.sonatype.org
[junit] Error transferring file: oss.sonatype.org
[junit] [WARNING] Unable to get resource 'org.json:json:jar:20080701' from r
epository sonatype (https://oss.sonatype.org/content/groups/public/): Error tran
sferring file: oss.sonatype.org
[junit] Error transferring file: oss.sonatype.org
[junit] Downloading: org/robolectric/android-all/4.3_r2-robolectric-0/androi
d-all-4.3_r2-robolectric-0.jar from repository central at http://repo1.maven.org
/maven2
[junit] [WARNING] Unable to get resource 'org.ccil.cowan.tagsoup:tagsoup:jar
:1.2' from repository sonatype (https://oss.sonatype.org/content/groups/public/)
: Error transferring file: oss.sonatype.org
[junit] Downloading: org/json/json/20080701/json-20080701.jar from repositor
y central at http://repo1.maven.org/maven2
[junit] Error transferring file: repo1.maven.org
[junit] Downloading: org/ccil/cowan/tagsoup/tagsoup/1.2/tagsoup-1.2.jar from
repository central at http://repo1.maven.org/maven2
[junit] [WARNING] Unable to get resource 'org.robolectric:android-all:jar:4.
3_r2-robolectric-0' from repository central (http://repo1.maven.org/maven2): Err
or transferring file: repo1.maven.org
[junit] Error transferring file: repo1.maven.org
[junit] Error transferring file: repo1.maven.org
[junit] [WARNING] Unable to get resource 'org.ccil.cowan.tagsoup:tagsoup:jar
:1.2' from repository central (http://repo1.maven.org/maven2): Error transferrin
g file: repo1.maven.org
[junit] [WARNING] Unable to get resource 'org.json:json:jar:20080701' from r
epository central (http://repo1.maven.org/maven2): Error transferring file: repo
1.maven.org
[junit] Tests run: 2, Failures: 0, Errors: 2, Time elapsed: 0.022 sec
[junit] Test com.pivotallabs.tracker.TrackerAuthenticationRequestTest FAILED
[junit] Running com.pivotallabs.util.StringsTest
[junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0.002 sec
[junit] Running com.pivotallabs.views.LoadingTextViewTest
[junit] Downloading: org/json/json/20080701/json-20080701.jar from repositor
y sonatype at https://oss.sonatype.org/content/groups/public/
[junit] Downloading: org/robolectric/android-all/4.3_r2-robolectric-0/androi
d-all-4.3_r2-robolectric-0.jar from repository sonatype at https://oss.sonatype.
org/content/groups/public/
[junit] Downloading: org/ccil/cowan/tagsoup/tagsoup/1.2/tagsoup-1.2.jar from
repository sonatype at https://oss.sonatype.org/content/groups/public/
[junit] Error transferring file: oss.sonatype.org
[junit] Error transferring file: oss.sonatype.org
[junit] [WARNING] Unable to get resource 'org.json:json:jar:20080701' from r
epository sonatype (https://oss.sonatype.org/content/groups/public/): Error tran
sferring file: oss.sonatype.org
[junit] Error transferring file: oss.sonatype.org
[junit] [WARNING] Unable to get resource 'org.robolectric:android-all:jar:4.
3_r2-robolectric-0' from repository sonatype (https://oss.sonatype.org/content/g
roups/public/): Error transferring file: oss.sonatype.org
[junit] [WARNING] Unable to get resource 'org.ccil.cowan.tagsoup:tagsoup:jar
:1.2' from repository sonatype (https://oss.sonatype.org/content/groups/public/)
: Error transferring file: oss.sonatype.org
[junit] Downloading: org/json/json/20080701/json-20080701.jar from repositor
y central at http://repo1.maven.org/maven2
[junit] Downloading: org/robolectric/android-all/4.3_r2-robolectric-0/androi
d-all-4.3_r2-robolectric-0.jar from repository central at http://repo1.maven.org
/maven2
[junit] Error transferring file: repo1.maven.org
[junit] Downloading: org/ccil/cowan/tagsoup/tagsoup/1.2/tagsoup-1.2.jar from
repository central at http://repo1.maven.org/maven2
[junit] [WARNING] Unable to get resource 'org.json:json:jar:20080701' from r
epository central (http://repo1.maven.org/maven2): Error transferring file: repo
1.maven.org
[junit] Error transferring file: repo1.maven.org
[junit] Error transferring file: repo1.maven.org
[junit] [WARNING] Unable to get resource 'org.robolectric:android-all:jar:4.
3_r2-robolectric-0' from repository central (http://repo1.maven.org/maven2): Err
or transferring file: repo1.maven.org
[junit] [WARNING] Unable to get resource 'org.ccil.cowan.tagsoup:tagsoup:jar
:1.2' from repository central (http://repo1.maven.org/maven2): Error transferrin
g file: repo1.maven.org
[junit] Downloading: org/json/json/20080701/json-20080701.jar from repositor
y sonatype at https://oss.sonatype.org/content/groups/public/
[junit] Downloading: org/robolectric/android-all/4.3_r2-robolectric-0/androi
d-all-4.3_r2-robolectric-0.jar from repository sonatype at https://oss.sonatype.
org/content/groups/public/
[junit] Downloading: org/ccil/cowan/tagsoup/tagsoup/1.2/tagsoup-1.2.jar from
repository sonatype at https://oss.sonatype.org/content/groups/public/
[junit] Error transferring file: oss.sonatype.org
[junit] Error transferring file: oss.sonatype.org
[junit] [WARNING] Unable to get resource 'org.json:json:jar:20080701' from r
epository sonatype (https://oss.sonatype.org/content/groups/public/): Error tran
sferring file: oss.sonatype.org
[junit] Error transferring file: oss.sonatype.org
[junit] [WARNING] Unable to get resource 'org.robolectric:android-all:jar:4.
3_r2-robolectric-0' from repository sonatype (https://oss.sonatype.org/content/g
roups/public/): Error transferring file: oss.sonatype.org
[junit] Downloading: org/json/json/20080701/json-20080701.jar from repositor
y central at http://repo1.maven.org/maven2
[junit] [WARNING] Unable to get resource 'org.ccil.cowan.tagsoup:tagsoup:jar
:1.2' from repository sonatype (https://oss.sonatype.org/content/groups/public/)
: Error transferring file: oss.sonatype.org
[junit] Downloading: org/robolectric/android-all/4.3_r2-robolectric-0/androi
d-all-4.3_r2-robolectric-0.jar from repository central at http://repo1.maven.org
/maven2
[junit] Error transferring file: repo1.maven.org
[junit] Downloading: org/ccil/cowan/tagsoup/tagsoup/1.2/tagsoup-1.2.jar from
repository central at http://repo1.maven.org/maven2
[junit] [WARNING] Unable to get resource 'org.json:json:jar:20080701' from r
epository central (http://repo1.maven.org/maven2): Error transferring file: repo
1.maven.org
[junit] Error transferring file: repo1.maven.org
[junit] Error transferring file: repo1.maven.org
[junit] [WARNING] Unable to get resource 'org.robolectric:android-all:jar:4.
3_r2-robolectric-0' from repository central (http://repo1.maven.org/maven2): Err
or transferring file: repo1.maven.org
[junit] [WARNING] Unable to get resource 'org.ccil.cowan.tagsoup:tagsoup:jar
:1.2' from repository central (http://repo1.maven.org/maven2): Error transferrin
g file: repo1.maven.org
[junit] Tests run: 2, Failures: 0, Errors: 2, Time elapsed: 0.017 sec
[junit] Test com.pivotallabs.views.LoadingTextViewTest FAILED
BUILD FAILED
D:\Robolectric(SetUp)\New folder\robolectric-ant-sample-master\custom_rules.xml:
58: Unit test(s) failed. See reports!
Total time: 9 seconds
似乎它试图从maven repo下载一些内容,但我没有使用它。