Robolectric2.2 + Eclipse + windows7 Tests giving error

188 views
Skip to first unread message

qwini Math

unread,
Nov 12, 2013, 12:24:12 AM11/12/13
to robol...@googlegroups.com, qwin...@gmail.com
Hello All,

    This is my first post in this group and also trying Robolectric for the first time for my application. I followed every step mentioned here to create the testproject.
But while running my test java project (only 1 test class with 5 tests), all tests are giving error with following failure trace.

org.fest.reflect.exception.ReflectionError: Unable to invoke method 'performCreate' with arguments [null]
at org.fest.reflect.method.Invoker.cannotInvokeMethod(Invoker.java:124)
at org.fest.reflect.method.Invoker.invoke(Invoker.java:116)
at org.robolectric.util.ActivityController$1.run(ActivityController.java:116)
at org.robolectric.shadows.ShadowLooper.runPaused(ShadowLooper.java:256)
at org.robolectric.util.ActivityController.create(ActivityController.java:111)
at org.robolectric.util.ActivityController.create(ActivityController.java:123)
at com.pivotallabs.HomeActivityTest.setUp(HomeActivityTest.java:35)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
at org.robolectric.RobolectricTestRunner$2.evaluate(RobolectricTestRunner.java:234)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.robolectric.RobolectricTestRunner$1.evaluate(RobolectricTestRunner.java:175)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
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.OutOfMemoryError: Java heap space
at java.lang.AbstractStringBuilder.<init>(Unknown Source)
at java.lang.StringBuilder.<init>(Unknown Source)
at org.robolectric.res.Attribute.addType(Attribute.java:75)
at org.robolectric.res.PreferenceLoader.processNode(PreferenceLoader.java:44)
at org.robolectric.res.PreferenceLoader.processChildren(PreferenceLoader.java:27)
at org.robolectric.res.PreferenceLoader.processNode(PreferenceLoader.java:53)
at org.robolectric.res.PreferenceLoader.processChildren(PreferenceLoader.java:27)
at org.robolectric.res.PreferenceLoader.processResourceXml(PreferenceLoader.java:20)
at org.robolectric.res.XmlLoader.processResourceXml(XmlLoader.java:50)
at org.robolectric.res.DocumentLoader.loadResourceXmlFile(DocumentLoader.java:72)
at org.robolectric.res.DocumentLoader.loadFile(DocumentLoader.java:61)
at org.robolectric.res.DocumentLoader.load(DocumentLoader.java:42)
at org.robolectric.res.PackageResourceLoader.loadEverything(PackageResourceLoader.java:59)
at org.robolectric.res.PackageResourceLoader.doInitialize(PackageResourceLoader.java:26)
at org.robolectric.res.XResourceLoader.initialize(XResourceLoader.java:29)
at org.robolectric.res.XResourceLoader.getValue(XResourceLoader.java:53)
at org.robolectric.res.PackageResourceLoader.getValue(PackageResourceLoader.java:7)
at org.robolectric.res.RoutingResourceLoader.getValue(RoutingResourceLoader.java:31)
at org.robolectric.shadows.ShadowAssetManager.resolveStyle(ShadowAssetManager.java:250)
at org.robolectric.shadows.ShadowResources.attrsToTypedArray(ShadowResources.java:129)
at org.robolectric.shadows.ShadowResources.access$000(ShadowResources.java:52)
at org.robolectric.shadows.ShadowResources$ShadowTheme.obtainStyledAttributes(ShadowResources.java:465)
at org.robolectric.shadows.ShadowResources$ShadowTheme.obtainStyledAttributes(ShadowResources.java:460)
at org.robolectric.shadows.ShadowResources$ShadowTheme.obtainStyledAttributes(ShadowResources.java:455)
at android.content.res.Resources$Theme.obtainStyledAttributes(Resources.java)
at android.content.Context.obtainStyledAttributes(Context.java:338)

In the console i am getting

 WARNING: no system properties value for ro.build.date.utc
DEBUG: Loading resources for android from jar:C:\Users\uesr\.m2\repository\org\robolectric\android-res\4.1.2_r1_rc\android-res-4.1.2_r1_rc-real.jar!/res...
DEBUG: Loading resources for android from jar:C:\Users\uesr\.m2\repository\org\robolectric\android-res\4.1.2_r1_rc\android-res-4.1.2_r1_rc-real.jar!/res...
DEBUG: Loading resources for android from jar:C:\Users\uesr\.m2\repository\org

        


test project image is attached here..

Any help will be appreciated ....

Thanks..





Capture.JPG
Reply all
Reply to author
Forward
0 new messages