7import static org.junit.Assert.assertEquals;
9import java.io.PrintWriter;
10import java.io.StringWriter;
12import org.junit.runner.RunWith;
13import org.robolectric.RobolectricTestRunner;
14import org.robolectric.annotation.Config;
17@RunWith(RobolectricTestRunner.class)
22 Exception exception =
new Exception();
25 StringWriter stringWriter =
new StringWriter();
26 PrintWriter printWriter =
new PrintWriter(stringWriter);
27 exception.printStackTrace(printWriter);
28 String expectStr = stringWriter.toString();
30 assertEquals(str, expectStr);
void canGetStacktraceString()
static String getStackTraceString(@Nullable Throwable tr)