1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119<!DOCTYPE html> 120<html devsite> 121<head> 122 123 124 <meta name="top_category" value="develop" /> 125 126 <meta name="subcategory" value="reference" /> 127 128 129 <meta name="book_path" value="/reference/android/support/test/_book.yaml" /> 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145<title>DefaultFailureHandler</title> 146 147 148</head> 149 150<body class="gc-documentation develop reference api apilevel-"> 151<div id="doc-api-level" class="" style="display:none"></div> 152 153 154 155 156<div id="naMessage"></div> 157 158<div id="api-info-block"> 159<div class="api-level"> 160 161 162 163 164</div> 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183<div class="sum-details-links"> 184 185Summary: 186 187 188 189 190 191 192 193 194 195 <a href="#pubctors">Ctors</a> 196 197 198 199 200 | <a href="#pubmethods">Methods</a> 201 202 203 204 205 | <a href="#inhmethods">Inherited Methods</a> 206 207| <a href="#" onclick="return toggleAllClassInherited()" id="toggleAllClassInherited">[Expand All]</a> 208 209</div><!-- end sum-details-links --> 210</div><!-- end api-info-block --> 211 212<div class="api apilevel-" id="jd-content"> 213 214<!-- ======== START OF CLASS DATA ======== --> 215 216<h1 class="api-title">DefaultFailureHandler</h1> 217<p> 218<code class="api-signature"> 219 public 220 221 final 222 223 class 224 DefaultFailureHandler 225</code> 226<br> 227 228 229<code class="api-signature"> 230 231 extends Object 232 233 234 235</code> 236 237<code class="api-signature"> 238 239 240 implements 241 242 <a href="/reference/android/support/test/espresso/FailureHandler.html">FailureHandler</a> 243 244 245 246</code> 247 248</p><table class="jd-inheritance-table"> 249 250 251 <tr> 252 253 <td colspan="2" class="jd-inheritance-class-cell">java.lang.Object 254 </td> 255 </tr> 256 257 258 <tr> 259 260 <td class="jd-inheritance-space"> ↳</td> 261 262 <td colspan="1" class="jd-inheritance-class-cell">android.support.test.espresso.base.DefaultFailureHandler 263 </td> 264 </tr> 265 266 267</table> 268 269 270 271 272<br><hr> 273 274 275 <p>Espresso's default <code><a href="/reference/android/support/test/espresso/FailureHandler.html">FailureHandler</a></code>. If this does not fit your needs, feel free to provide 276 your own implementation via Espresso.setFailureHandler(FailureHandler). 277</p> 278 279 280 281 282 283 284 285<h2 class="api-section">Summary</h2> 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309<!-- ======== CONSTRUCTOR SUMMARY ======== --> 310<table id="pubctors" class="responsive constructors"> 311<tr><th colspan="2"><h3>Public constructors</h3></th></tr> 312 313 314 315 316 <tr class="api apilevel-" > 317 318 319 <td width="100%"> 320 <code> 321 <a href="/reference/android/support/test/espresso/base/DefaultFailureHandler.html#DefaultFailureHandler(android.content.Context)">DefaultFailureHandler</a>(Context appContext) 322 </code> 323 324 </td> 325 </tr> 326 327 328 329</table> 330 331 332 333 334 335 336<!-- ========== METHOD SUMMARY =========== --> 337<table id="pubmethods" class="responsive methods"> 338<tr><th colspan="2"><h3>Public methods</h3></th></tr> 339 340 341 342 343 <tr class="api apilevel-" > 344 345 346 <td><code> 347 348 349 350 351 352 void</code> 353 </td> 354 355 <td width="100%"> 356 <code> 357 <a href="/reference/android/support/test/espresso/base/DefaultFailureHandler.html#handle(java.lang.Throwable, org.hamcrest.Matcher<android.view.View>)">handle</a>(Throwable error, Matcher<View> viewMatcher) 358 </code> 359 360 <p>Handle the given error in a manner that makes sense to the environment in which the test is 361 executed (e.g. 362 363 364</p> 365 366 </td> 367 </tr> 368 369 370 371</table> 372 373 374 375 376 377 378 379<!-- ========== METHOD SUMMARY =========== --> 380<table id="inhmethods" class="methods inhtable"> 381<tr><th><h3>Inherited methods</h3></th></tr> 382 383 384<tr class="api apilevel-" > 385<td colspan="2"> 386 387 <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Object" class="jd-expando-trigger closed" 388 ><img height="34" id="inherited-methods-java.lang.Object-trigger" 389 src="/assets/images/styles/disclosure_down.png" 390 class="jd-expando-trigger-img" /></a>From 391class 392<code> 393 394 java.lang.Object 395 396</code> 397<div id="inherited-methods-java.lang.Object"> 398 <div id="inherited-methods-java.lang.Object-list" 399 class="jd-inheritedlinks"> 400 </div> 401 <div id="inherited-methods-java.lang.Object-summary" style="display: none;"> 402 <table class="jd-sumtable-expando responsive"> 403 404 405 406 407 <tr class="api apilevel-" > 408 409 410 <td><code> 411 412 413 414 415 416 Object</code> 417 </td> 418 419 <td width="100%"> 420 <code> 421 clone() 422 </code> 423 424 </td> 425 </tr> 426 427 428 429 <tr class="api apilevel-" > 430 431 432 <td><code> 433 434 435 436 437 438 boolean</code> 439 </td> 440 441 <td width="100%"> 442 <code> 443 equals(Object arg0) 444 </code> 445 446 </td> 447 </tr> 448 449 450 451 <tr class="api apilevel-" > 452 453 454 <td><code> 455 456 457 458 459 460 void</code> 461 </td> 462 463 <td width="100%"> 464 <code> 465 finalize() 466 </code> 467 468 </td> 469 </tr> 470 471 472 473 <tr class="api apilevel-" > 474 475 476 <td><code> 477 478 479 480 final 481 482 Class<?></code> 483 </td> 484 485 <td width="100%"> 486 <code> 487 getClass() 488 </code> 489 490 </td> 491 </tr> 492 493 494 495 <tr class="api apilevel-" > 496 497 498 <td><code> 499 500 501 502 503 504 int</code> 505 </td> 506 507 <td width="100%"> 508 <code> 509 hashCode() 510 </code> 511 512 </td> 513 </tr> 514 515 516 517 <tr class="api apilevel-" > 518 519 520 <td><code> 521 522 523 524 final 525 526 void</code> 527 </td> 528 529 <td width="100%"> 530 <code> 531 notify() 532 </code> 533 534 </td> 535 </tr> 536 537 538 539 <tr class="api apilevel-" > 540 541 542 <td><code> 543 544 545 546 final 547 548 void</code> 549 </td> 550 551 <td width="100%"> 552 <code> 553 notifyAll() 554 </code> 555 556 </td> 557 </tr> 558 559 560 561 <tr class="api apilevel-" > 562 563 564 <td><code> 565 566 567 568 569 570 String</code> 571 </td> 572 573 <td width="100%"> 574 <code> 575 toString() 576 </code> 577 578 </td> 579 </tr> 580 581 582 583 <tr class="api apilevel-" > 584 585 586 <td><code> 587 588 589 590 final 591 592 void</code> 593 </td> 594 595 <td width="100%"> 596 <code> 597 wait(long arg0, int arg1) 598 </code> 599 600 </td> 601 </tr> 602 603 604 605 <tr class="api apilevel-" > 606 607 608 <td><code> 609 610 611 612 final 613 614 void</code> 615 </td> 616 617 <td width="100%"> 618 <code> 619 wait(long arg0) 620 </code> 621 622 </td> 623 </tr> 624 625 626 627 <tr class="api apilevel-" > 628 629 630 <td><code> 631 632 633 634 final 635 636 void</code> 637 </td> 638 639 <td width="100%"> 640 <code> 641 wait() 642 </code> 643 644 </td> 645 </tr> 646 647 648 649 </table> 650 </div> 651</div> 652</td></tr> 653 654 655 656<tr class="api apilevel-" > 657<td colspan="2"> 658 659 <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-android.support.test.espresso.FailureHandler" class="jd-expando-trigger closed" 660 ><img height="34" id="inherited-methods-android.support.test.espresso.FailureHandler-trigger" 661 src="/assets/images/styles/disclosure_down.png" 662 class="jd-expando-trigger-img" /></a>From 663interface 664<code> 665 666 <a href="/reference/android/support/test/espresso/FailureHandler.html">android.support.test.espresso.FailureHandler</a> 667 668</code> 669<div id="inherited-methods-android.support.test.espresso.FailureHandler"> 670 <div id="inherited-methods-android.support.test.espresso.FailureHandler-list" 671 class="jd-inheritedlinks"> 672 </div> 673 <div id="inherited-methods-android.support.test.espresso.FailureHandler-summary" style="display: none;"> 674 <table class="jd-sumtable-expando responsive"> 675 676 677 678 679 <tr class="api apilevel-" > 680 681 682 <td><code> 683 abstract 684 685 686 687 688 void</code> 689 </td> 690 691 <td width="100%"> 692 <code> 693 <a href="/reference/android/support/test/espresso/FailureHandler.html#handle(java.lang.Throwable, org.hamcrest.Matcher<android.view.View>)">handle</a>(Throwable error, Matcher<View> viewMatcher) 694 </code> 695 696 <p>Handle the given error in a manner that makes sense to the environment in which the test is 697 executed (e.g. 698 699 700</p> 701 702 </td> 703 </tr> 704 705 706 707 </table> 708 </div> 709</div> 710</td></tr> 711 712 713</table> 714 715 716 717<!-- XML Attributes --> 718 719 720<!-- Enum Values --> 721 722 723<!-- Constants --> 724 725 726<!-- Fields --> 727 728 729<!-- Public ctors --> 730 731 732<!-- ========= CONSTRUCTOR DETAIL ======== --> 733<h2 class="api-section">Public constructors</h2> 734 735 736 737<A NAME="DefaultFailureHandler(android.content.Context)"></A> 738 739<div class="api apilevel-"> 740 <h3 class="api-name">DefaultFailureHandler</h3> 741 <div class="api-level"> 742 <div></div> 743 744 745 746 </div> 747<pre class="api-signature no-pretty-print"> 748DefaultFailureHandler (Context appContext)</pre> 749 750 751 752 753 <p></p> 754 <table class="responsive"> 755 <tr><th colspan=2>Parameters</th></tr> 756 <tr> 757 <td><code>appContext</code></td> 758 <td width="100%"> 759 <code>Context</code> 760 <!-- no parameter comment --></td> 761 </tr> 762 </table> 763 764</div> 765 766 767 768 769 770<!-- ========= CONSTRUCTOR DETAIL ======== --> 771<!-- Protected ctors --> 772 773 774 775<!-- ========= METHOD DETAIL ======== --> 776<!-- Public methdos --> 777 778<h2 class="api-section">Public methods</h2> 779 780 781 782<A NAME="handle(java.lang.Throwable, org.hamcrest.Matcher<android.view.View>)"></A> 783 784<div class="api apilevel-"> 785 <h3 class="api-name">handle</h3> 786 <div class="api-level"> 787 <div></div> 788 789 790 791 </div> 792<pre class="api-signature no-pretty-print"> 793void handle (Throwable error, 794 Matcher<View> viewMatcher)</pre> 795 796 797 798 799 <p>Handle the given error in a manner that makes sense to the environment in which the test is 800 executed (e.g. take a screenshot, output extra debug info, etc). Upon handling, most handlers 801 will choose to propagate the error. 802</p> 803 <table class="responsive"> 804 <tr><th colspan=2>Parameters</th></tr> 805 <tr> 806 <td><code>error</code></td> 807 <td width="100%"> 808 <code>Throwable</code> 809 <!-- no parameter comment --></td> 810 </tr> 811 <tr> 812 <td><code>viewMatcher</code></td> 813 <td width="100%"> 814 <code>Matcher</code> 815 <!-- no parameter comment --></td> 816 </tr> 817 </table> 818 819</div> 820 821 822 823 824 825<!-- ========= METHOD DETAIL ======== --> 826 827 828 829<!-- ========= END OF CLASS DATA ========= --> 830 831</div><!-- end jd-content --> 832 833 834 835<div class="data-reference-resources-wrapper"> 836 837 <ul data-reference-resources> 838 839 <li><h2>Annotations</h2> 840 <ul> 841 <li class="api apilevel-"><a href="/reference/android/support/test/espresso/base/Default.html">Default</a></li> 842 <li class="api apilevel-"><a href="/reference/android/support/test/espresso/base/MainThread.html">MainThread</a></li> 843 </ul> 844 </li> 845 846 <li><h2>Interfaces</h2> 847 <ul> 848 <li class="api apilevel-"><a href="/reference/android/support/test/espresso/base/ActiveRootLister.html">ActiveRootLister</a></li> 849 </ul> 850 </li> 851 852 <li><h2>Classes</h2> 853 <ul> 854 <li class="api apilevel-"><a href="/reference/android/support/test/espresso/base/BaseLayerModule.html">BaseLayerModule</a></li> 855 <li class="api apilevel-"><a href="/reference/android/support/test/espresso/base/BaseLayerModule.FailureHandlerHolder.html">BaseLayerModule.FailureHandlerHolder</a></li> 856 <li class="selected api apilevel-"><a href="/reference/android/support/test/espresso/base/DefaultFailureHandler.html">DefaultFailureHandler</a></li> 857 <li class="api apilevel-"><a href="/reference/android/support/test/espresso/base/IdlingResourceRegistry.html">IdlingResourceRegistry</a></li> 858 <li class="api apilevel-"><a href="/reference/android/support/test/espresso/base/RootViewPicker.html">RootViewPicker</a></li> 859 <li class="api apilevel-"><a href="/reference/android/support/test/espresso/base/UiControllerModule.html">UiControllerModule</a></li> 860 <li class="api apilevel-"><a href="/reference/android/support/test/espresso/base/ViewFinderImpl.html">ViewFinderImpl</a></li> 861 </ul> 862 </li> 863 864 865 866 </ul> 867 868</div> 869 870 871 872</body> 873</html> 874