@Test public void testPrettyPrintNullSafe2() { ModelFactory mf = ModelFactory.eINSTANCE; ErrorReport report = mf.createErrorReport(); report.setStatus(mf.createStatus()); Reports.prettyPrint(report); }
@Test public void testPrettyPrintSkipsNullException() { ModelFactory mf = ModelFactory.eINSTANCE; ErrorReport report = mf.createErrorReport(); report.setStatus(mf.createStatus()); String prettyPrint = Reports.prettyPrint(report); assertThat(prettyPrint, not(containsString("Exception"))); }
@Test public void testPrettyPrintNullSafe3() { ModelFactory mf = ModelFactory.eINSTANCE; ErrorReport report = mf.createErrorReport(); report.setStatus(mf.createStatus()); Throwable t = mf.createThrowable(); t.setClassName("org.test"); report.getStatus().setException(t); Reports.prettyPrint(report); }