Here you can find the source of failException(String message, Throwable got)
Parameter | Description |
---|---|
message | a parameter |
got | this exception |
public static void failException(String message, Throwable got)
//package com.java2s; import java.util.concurrent.atomic.AtomicBoolean; public class Main { private static final AtomicBoolean isandroid = new AtomicBoolean(false); /**/*from w w w. j ava 2 s .c o m*/ * Call this if you have an exception you want to fail for! * @param message * @param got this exception */ public static void failException(String message, Throwable got) { AssertionError ae = new AssertionError(message); if (isandroid.get()) { System.out.println("ANDROID: About to throw AssertionError " + "but we cannot initialize the cause... " + "Here follows both the AssertionError and its cause"); ae.printStackTrace(); System.out.println("And the cause..."); got.printStackTrace(); } else { ae.initCause(got); } throw ae; } }