Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Robolectric test #47

Open
jxpx91 opened this issue Nov 13, 2017 · 0 comments
Open

Robolectric test #47

jxpx91 opened this issue Nov 13, 2017 · 0 comments

Comments

@jxpx91
Copy link

jxpx91 commented Nov 13, 2017

I had a problem when I use Robolectric tests. Two of my test use this library but sometimes one of them works and sometimes any works.

Gradle:
compile 'com.commit451:NativeStackBlur:1.0.2'

Here is my code:

imageLoader.displayImage(urlImage, imageTitulo, options, new ImageLoadingListener() {
            @Override
            public void onLoadingStarted(String s, View view) {}
            @Override
            public void onLoadingFailed(String s, View view, FailReason failReason) {}
            @Override
            public void onLoadingComplete(String s, View view, Bitmap bitmap) {
                Bitmap bm = NativeStackBlur.process(bitmap, 10);
                imageTitulo.setImageBitmap(bm);
                imageStreetV.setImageBitmap(bitmap);
            }
            @Override
            public void onLoadingCancelled(String s, View view) {}
        });

And here is the output:

java.lang.NoClassDefFoundError: Could not initialize class com.enrique.stackblur.NativeBlurProcess

	at com.commit451.nativestackblur.NativeStackBlur.process(NativeStackBlur.java:20)
	at mx.org.inegi.denuemv.ficha.FichaFragment$6.onLoadingComplete(FichaFragment.java:303)
	at com.nostra13.universalimageloader.core.ImageLoader.displayImage(ImageLoader.java:253)
	at com.nostra13.universalimageloader.core.ImageLoader.displayImage(ImageLoader.java:365)
	at com.nostra13.universalimageloader.core.ImageLoader.displayImage(ImageLoader.java:340)
	at mx.org.inegi.denuemv.ficha.FichaFragment.setData(FichaFragment.java:296)
	at mx.org.inegi.denuemv.MapsActivityTest.openFicha(MapsActivityTest.java:153)
	at mx.org.inegi.denuemv.MapsActivityTest.openStreetViewTest(MapsActivityTest.java:123)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.robolectric.RobolectricTestRunner$HelperTestRunner$1.evaluate(RobolectricTestRunner.java:523)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.robolectric.internal.SandboxTestRunner$2.evaluate(SandboxTestRunner.java:226)
	at org.robolectric.internal.SandboxTestRunner.runChild(SandboxTestRunner.java:108)
	at org.robolectric.internal.SandboxTestRunner.runChild(SandboxTestRunner.java:35)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.robolectric.internal.SandboxTestRunner$1.evaluate(SandboxTestRunner.java:62)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
	at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:51)
	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.intellij.rt.execution.application.AppMainV2.main(AppMainV2.java:131)

The App works as well but the tests failed, I don't know why they failed just sometimes.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant