java.lang.NullPointerException at org.robolectric.res.ThemeStyleSet$OverlayedStyle.equals

398 views
Skip to first unread message

VIGNESH G

unread,
Oct 15, 2019, 3:22:10 AM10/15/19
to Robolectric
[Robolectric] com.zoho.sheet.android.AddPeopleActivityTest.trailTestMethod: sdk=28; resources=legacy
[Robolectric] NOTICE: legacy resources mode is deprecated; see http://robolectric.org/migrating/#migrating-to-40

java.lang.NullPointerException
at org.robolectric.res.ThemeStyleSet$OverlayedStyle.equals(ThemeStyleSet.java:67)
at org.robolectric.res.ThemeStyleSet.apply(ThemeStyleSet.java:29)
at org.robolectric.shadows.ShadowLegacyAssetManager.applyThemeStyle(ShadowLegacyAssetManager.java:910)
at org.robolectric.shadows.ShadowLegacyAssetManager.applyStyleToTheme(ShadowLegacyAssetManager.java:950)
at android.content.res.AssetManager.applyStyleToTheme(AssetManager.java)
at android.content.res.ResourcesImpl$ThemeImpl.applyStyle(ResourcesImpl.java:1305)
at android.content.res.Resources$Theme.applyStyle(Resources.java:1420)
at android.view.ContextThemeWrapper.onApplyThemeResource(ContextThemeWrapper.java:186)
at android.app.Activity.onApplyThemeResource(Activity.java:4362)
at android.view.ContextThemeWrapper.initializeTheme(ContextThemeWrapper.java:198)
at android.view.ContextThemeWrapper.setTheme(ContextThemeWrapper.java:140)
at android.app.Activity.setTheme(Activity.java:4354)
at android.support.v7.app.AppCompatActivity.setTheme(AppCompatActivity.java:90)
at org.robolectric.shadows.ShadowActivity.callAttach(ShadowActivity.java:217)
at org.robolectric.android.controller.ActivityController.attach(ActivityController.java:44)
at org.robolectric.android.controller.ActivityController.of(ActivityController.java:27)
at org.robolectric.Robolectric.buildActivity(Robolectric.java:72)
at org.robolectric.Robolectric.buildActivity(Robolectric.java:68)
at org.robolectric.Robolectric.setupActivity(Robolectric.java:76)
at com.****.****.android.AddPeopleActivityTest.setupFragment(AddPeopleActivityTest.java:20)
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.RunBefores.evaluate(RunBefores.java:24)
at org.robolectric.internal.SandboxTestRunner$2.evaluate(SandboxTestRunner.java:260)
at org.robolectric.internal.SandboxTestRunner.runChild(SandboxTestRunner.java:130)
at org.robolectric.internal.SandboxTestRunner.runChild(SandboxTestRunner.java:42)
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:84)
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:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)


Process finished with exit code 255
Gradle :
//RoboElectric
testImplementation 'org.robolectric:robolectric:4.0'

Test Class:

@RunWith(RobolectricTestRunner.class)

public class AddPeopleActivityTest {

public AddPeopleActivity activity;
@Before
public void setupFragment() {
// activity = Robolectric.setupActivity(AddPeopleActivity.class);
activity = Robolectric.buildActivity(AddPeopleActivity.class).create().get();
// SupportFragmentTestUtil.startVisibleFragment(fragment);
}
Reply all
Reply to author
Forward
0 new messages