Jan Berkel submitted a pull request to Robolectric that was merged into master on March 8th. You can now call Robolectric.getFakeHttpLayer().interceptHttpRequests(false);
in the beginning of your test to bypass the mocked http layer in Robolectric.
You can download the jar directly from Sonatype to include in your Eclipse Android project. If you are using Maven and 1.1 has not yet been released (check at the Sonatype url above) then you will need to add the sonatype snapshot repo and use robolectric 1.1-SNAPSHOT. You can do this by adding the following to your pom.xml
<repositories>
<repository>
<id>sonatype-snapshots</id>
<name>Sonatype Snapshots</name>
<layout>default</layout>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
...
<dependencies>
<dependency>
<groupId>com.pivotallabs</groupId>
<artifactId>robolectric</artifactId>
<version>1.1-SNAPSHOT</version>
<scope>test</scope>
</dependency>
...
</dependencies>
I am using this for integration test that run against a real server and it works well.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…