Ramble01 / android-test-kit

Automatically exported from code.google.com/p/android-test-kit
0 stars 0 forks source link

Better error message for IllegalArgumentException: expected one element but was: #102

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
If there is a problem during Activity initialization, the you might get this 
error:

java.lang.IllegalArgumentException: expected one element but was: 
<██████████Activity@b23c7d10, 
███████████Activity@b2461610>
2014-11-03 15:20:44 [SDR.printStream] [emulator-5556] STDOUT at 
com.google.common.collect.Iterators.getOnlyElement(Iterators.java:312)
2014-11-03 15:20:44 [SDR.printStream] [emulator-5556] STDOUT at 
com.google.common.collect.Iterables.getOnlyElement(Iterables.java:289)
2014-11-03 15:20:44 [SDR.printStream] [emulator-5556] STDOUT at 
com.google.android.apps.common.testing.ui.espresso.action.CloseKeyboardAction.ge
tRootActivity(CloseKeyboardAction.java:116)
2014-11-03 15:20:44 [SDR.printStream] [emulator-5556] STDOUT at 
com.google.android.apps.common.testing.ui.espresso.action.CloseKeyboardAction.tr
yToCloseKeyboard(CloseKeyboardAction.java:64)
2014-11-03 15:20:44 [SDR.printStream] [emulator-5556] STDOUT at 
com.google.android.apps.common.testing.ui.espresso.action.CloseKeyboardAction.pe
rform(CloseKeyboardAction.java:48)
2014-11-03 15:20:44 [SDR.printStream] [emulator-5556] STDOUT at 
com.google.android.apps.common.testing.ui.espresso.ViewInteraction$1.run(ViewInt
eraction.java:119)
2014-11-03 15:20:44 [SDR.printStream] [emulator-5556] STDOUT at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:390)
2014-11-03 15:20:44 [SDR.printStream] [emulator-5556] STDOUT at 
java.util.concurrent.FutureTask.run(FutureTask.java:234)

It thinks there are 2 activities resumed. 

A better error message would be: 

"More than one activity is in RESUMED status. You may have had an error during 
your activity creation/startup process, please check your logs."  

Original issue reported on code.google.com by YogurtE...@gmail.com on 3 Nov 2014 at 10:53

GoogleCodeExporter commented 9 years ago

Original comment by vale...@google.com on 19 Nov 2014 at 11:16

GoogleCodeExporter commented 9 years ago
Fixed in Espresso 2.0

Original comment by vale...@google.com on 20 Dec 2014 at 4:33