Robolectric 中的 IllegalStateException SupportFragmentTestUtil.startVisibleFragment(mg Fragment)
IllegalStateException in Roboelectric with SupportFragmentTestUtil.startVisibleFragment(myFragment)
我正在设置此 class 以测试我的片段:
@RunWith(RobolectricTestRunner.class)
public class MyFragmentTest {
MyFragment myFragment;
@Before
public void setUp(){
myFragment = (MyFragment)FmyFragment.instantiate(ApplicationProvider.getApplicationContext(), MyFragment.class.getName());
SupportFragmentTestUtil.startVisibleFragment(myFragment);
}
}
但是那一行
SupportFragmentTestUtil.startVisibleFragment(myFragment);
抛出以下异常:
java.lang.IllegalStateException: Recursive entry to executePendingTransactions
我是不是在我的设置中遗漏了什么?我尝试了很多东西,这是我最接近用 roboelectric 开始我的片段的一次。
如果您需要更多信息,请随时询问。
问题出在使用 roboelectric 时的 Glide Bug。
我正在设置此 class 以测试我的片段:
@RunWith(RobolectricTestRunner.class)
public class MyFragmentTest {
MyFragment myFragment;
@Before
public void setUp(){
myFragment = (MyFragment)FmyFragment.instantiate(ApplicationProvider.getApplicationContext(), MyFragment.class.getName());
SupportFragmentTestUtil.startVisibleFragment(myFragment);
}
}
但是那一行
SupportFragmentTestUtil.startVisibleFragment(myFragment);
抛出以下异常:
java.lang.IllegalStateException: Recursive entry to executePendingTransactions
我是不是在我的设置中遗漏了什么?我尝试了很多东西,这是我最接近用 roboelectric 开始我的片段的一次。
如果您需要更多信息,请随时询问。
问题出在使用 roboelectric 时的 Glide Bug。