fixed Uri issue #458

Merged
merged 4 commits into from Apr 10, 2013

Conversation

Projects
None yet
6 participants
Contributor

acc15 commented Apr 9, 2013

Issue fixed:
pivotal#426

Owner

xian commented Apr 10, 2013

Oh! Wow, awesome, thanks for finding that, @acc15!

I'd love to get a test around this before merging, would you like to write it?

Contributor

acc15 commented Apr 10, 2013

I don't think that this fix requires some special test.
If i show you my screenshot when i run all tests (before this fix) of robolectric you probably be surprised.. there was no green color.. at all.

Contributor

acc15 commented Apr 10, 2013

Wait a moment please...

Contributor

acc15 commented Apr 10, 2013

Test added

Contributor

acc15 commented Apr 10, 2013

URL.toString() on Windows and Unix behaves differently:
On Windows it replaces "///" to "/", i.e. new URL("file:///abc").toString() equal to "file:/abc"
On Unix, seem like doesn't replace, i.e. new URL("file:///abc").toString() equal to "file:///abc"

Java.. =)

xian added a commit that referenced this pull request Apr 10, 2013

@xian xian merged commit 964f1ea into robolectric:master Apr 10, 2013

1 check passed

default The Travis build passed
Details
Owner

xian commented Apr 10, 2013

Thank you @acc15! (And thank you, Java! ;-)

@acc15 acc15 deleted the acc15:fix-url branch Apr 14, 2013

Any word on when the next release will be? The guys on the team unfortunate enough to be using Windows boxes can't run the tests.

Contributor

cowst commented Apr 24, 2013

We are in the same situation.
We used a virtual machine with Linux to build.
Or you can get a built snapshot unless you need to patch and build sources
yourself.

Sent from my Nexus 4
On Apr 24, 2013 12:59 AM, "Christopher Perry" notifications@github.com
wrote:

Any word on when the next release will be? The guys on the team
unfortunate enough to be using Windows boxes can't run the tests.


Reply to this email directly or view it on GitHubhttps://github.com/pivotal/robolectric/pull/458#issuecomment-16892144
.

Contributor

acc15 commented Apr 24, 2013

Use snapshot. Works stable now on Windows. It simple: git clone, mvn install -DskipTests=true. There is some other windows related bugs - but i'm don't get stuck on them.. Yet...

Contributor

cowst commented Apr 24, 2013

i doubt it's so easy, i had to call 2 targets in ant first (but this was on
alpha2 snapshots)

On Wed, Apr 24, 2013 at 11:45 AM, acc15 notifications@github.com wrote:

Use snapshot. Works stable now on Windows. It simple: git clone, mvn
install.


Reply to this email directly or view it on GitHubhttps://github.com/pivotal/robolectric/pull/458#issuecomment-16917182
.

Contributor

acc15 commented Apr 24, 2013

If this will be helpful:
https://docs.google.com/file/d/0BwFqqUDC76RAYzNYdlBRd3dURzg/edit
compiled from current master branch with all dependencies

https://docs.google.com/file/d/0BwFqqUDC76RAQUZPTVppTWdhWjg/edit
without dependencies

I'm still running into the Stub exception with the Uri class. I even tried the build provided by acc15 in his last post.

Environment is Eclipse ADT 22, using "compiled from current master branch with all dependencies." The project was created using the instructions at http://robolectric.org/eclipse-quick-start.html.

Any ideas why I would still be getting this stub exception? I followed the instructions (for pure eclipse, no Maven) exactly with the fixed build and I'm still running into problems.

Hello i am facing the same problem :
@Inject private ClientValidationService clientValidationService;

@Before
public void setUp() throws Exception {
    super.setUp();

    service = Mockito.spy( clientValidationService );
    doReturn(initializeDeviceAndAppInfo()).when(service).initializeDeviceAndAppInfo();
};

java.lang.RuntimeException: java.lang.RuntimeException: Stub!
at com.google.dexmaker.DexMaker.generateAndLoad(DexMaker.java:388)
at com.google.dexmaker.stock.ProxyBuilder.buildProxyClass(ProxyBuilder.java:252)
at com.google.dexmaker.mockito.DexmakerMockMaker.createMock(DexmakerMockMaker.java:56)
at org.mockito.internal.util.MockUtil.createMock(MockUtil.java:26)
at org.mockito.internal.MockitoCore.mock(MockitoCore.java:51)
at org.mockito.Mockito.mock(Mockito.java:1243)
at org.mockito.Mockito.mock(Mockito.java:1120)
at com.devsu.supermaxi.services.test.ClientValidationServiceTest.setUp(ClientValidationServiceTest.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at org.robolectric.RobolectricTestRunner$2.evaluate(RobolectricTestRunner.java:234)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.robolectric.RobolectricTestRunner$1.evaluate(RobolectricTestRunner.java:175)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.RuntimeException: Stub!
at dalvik.system.BaseDexClassLoader.(BaseDexClassLoader.java:5)
at dalvik.system.DexClassLoader.(DexClassLoader.java:5)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at com.google.dexmaker.DexMaker.generateAndLoad(DexMaker.java:382)
... 32 more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment