android - Robolectric in CI environment -
i'm running issue robolectric tests pass in terminal with: ./gradlew test
, same command, configured tools on circleci gives me error:
java.lang.runtimeexception: java.lang.illegalargumentexception: maxsize <= 0 @ org.robolectric.robolectrictestrunner$2.evaluate(robolectrictestrunner.java:238) @ org.robolectric.robolectrictestrunner.runchild(robolectrictestrunner.java:185) @ org.robolectric.robolectrictestrunner.runchild(robolectrictestrunner.java:54) @ org.junit.runners.parentrunner$3.run(parentrunner.java:290) @ org.junit.runners.parentrunner$1.schedule(parentrunner.java:71) @ org.junit.runners.parentrunner.runchildren(parentrunner.java:288) @ org.junit.runners.parentrunner.access$000(parentrunner.java:58) @ org.junit.runners.parentrunner$2.evaluate(parentrunner.java:268) @ org.robolectric.robolectrictestrunner$1.evaluate(robolectrictestrunner.java:149) @ org.junit.runners.parentrunner.run(parentrunner.java:363) @ org.gradle.api.internal.tasks.testing.junit.junittestclassexecuter.runtestclass(junittestclassexecuter.java:86) @ org.gradle.api.internal.tasks.testing.junit.junittestclassexecuter.execute(junittestclassexecuter.java:49) @ org.gradle.api.internal.tasks.testing.junit.junittestclassprocessor.processtestclass(junittestclassprocessor.java:69) @ org.gradle.api.internal.tasks.testing.suitetestclassprocessor.processtestclass(suitetestclassprocessor.java:48) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:62) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:497) @ org.gradle.messaging.dispatch.reflectiondispatch.dispatch(reflectiondispatch.java:35) @ org.gradle.messaging.dispatch.reflectiondispatch.dispatch(reflectiondispatch.java:24) @ org.gradle.messaging.dispatch.contextclassloaderdispatch.dispatch(contextclassloaderdispatch.java:32) @ org.gradle.messaging.dispatch.proxydispatchadapter$dispatchinginvocationhandler.invoke(proxydispatchadapter.java:93) @ com.sun.proxy.$proxy2.processtestclass(unknown source) @ org.gradle.api.internal.tasks.testing.worker.testworker.processtestclass(testworker.java:105) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:62) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:497) @ org.gradle.messaging.dispatch.reflectiondispatch.dispatch(reflectiondispatch.java:35) @ org.gradle.messaging.dispatch.reflectiondispatch.dispatch(reflectiondispatch.java:24) @ org.gradle.messaging.remote.internal.hub.messagehub$handler.run(messagehub.java:360) @ org.gradle.internal.concurrent.defaultexecutorfactory$stoppableexecutorimpl$1.run(defaultexecutorfactory.java:64) @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1142) @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:617) @ java.lang.thread.run(thread.java:745) caused by: java.lang.illegalargumentexception: maxsize <= 0 @ com.nostra13.universalimageloader.cache.memory.impl.lrumemorycache.<init>(lrumemorycache.java:33) @ com.nostra13.universalimageloader.core.defaultconfigurationfactory.creatememorycache(defaultconfigurationfactory.java:114) @ com.nostra13.universalimageloader.core.imageloaderconfiguration$builder.initemptyfieldswithdefaultvalues(imageloaderconfiguration.java:584) @ com.nostra13.universalimageloader.core.imageloaderconfiguration$builder.build(imageloaderconfiguration.java:559) @ com.heetch.heetchapp.initimageloader(heetchapp.java:123) @ com.heetch.heetchapp.oncreate(heetchapp.java:55) @ org.robolectric.internal.paralleluniverse.setupapplicationstate(paralleluniverse.java:140) @ org.robolectric.robolectrictestrunner.setupapplicationstate(robolectrictestrunner.java:421) @ org.robolectric.robolectrictestrunner$2.evaluate(robolectrictestrunner.java:234) ... 34 more
i'm using robolectric 3.0-rc3 , belive bug come robolectric don't have clues on solve error.
the solution add memory cache imageloader below:
imageloaderconfiguration config = new imageloaderconfiguration.builder(this) .memorycache(new weakmemorycache()) .build();
Comments
Post a Comment