List of usage examples for java.lang AssertionError toString
public String toString()
From source file:org.apache.hadoop.test.TestGenericTestUtils.java
@Test public void testAssertExceptionContainsNullEx() throws Throwable { try {//from www.j a va2 s . c om assertExceptionContains("", null); } catch (AssertionError e) { if (!e.toString().contains(E_NULL_THROWABLE)) { throw e; } } }
From source file:org.apache.hadoop.test.TestGenericTestUtils.java
@Test public void testAssertExceptionContainsNullString() throws Throwable { try {// w ww . j av a2s . com assertExceptionContains("", new BrokenException()); } catch (AssertionError e) { if (!e.toString().contains(E_NULL_THROWABLE_STRING)) { throw e; } } }
From source file:org.apache.hadoop.test.TestGenericTestUtils.java
@Test public void testAssertExceptionContainsWrongText() throws Throwable { try {/*from w w w . j a v a 2 s . co m*/ assertExceptionContains("Expected", new Exception("(actual)")); } catch (AssertionError e) { String s = e.toString(); if (!s.contains(E_UNEXPECTED_EXCEPTION) || !s.contains("(actual)")) { throw e; } if (e.getCause() == null) { throw new AssertionError("No nested cause in assertion", e); } } }